Giter Site home page Giter Site logo

cep-to-coords's Introduction

Pacote Python para converter CEP em latitude e longitude

Como usar:

  1. Instale:
git clone https://github.com/millengustavo/cep-to-coords.git
cd cep-to-coords
git checkout master
pip install -e .
  1. Converta um CEP para latitude e longitude:
from cep_to_coords.convert import cep_to_coords


coordenadas = cep_to_coords('22070-900')
print(coordenadas)

# {'latitude': -22.9864082, 'longitude': -43.189592}

Opcional - Usando o https://cepaberto.com/

Para usar esse conversor você precisa se cadastrar no site e exportar seu token como variável de ambiente CEP_ABERTO_TOKEN

export CEP_ABERTO_TOKEN='seu_token'
from cep_to_coords.convert import cep_to_coords
from cep_to_coords.strategies import CEPAbertoConverter


coordenadas = cep_to_coords('22070-900', factory=CEPAbertoConverter)
print(coordenadas)

# {'latitude': -22.9864082, 'longitude': -43.189592}

Testando

python -m unittest discover

cep-to-coords's People

Contributors

funcional-health-tech avatar millengustavo avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.