arislaode / neuro_geocode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run project on Local:

  • Python version Python versions PyPi

  • Yandex Geocoder requires an API developer key, you can get it here to use this library.

  • change ".env-example" to ".env"

  • update ".env" :

    API_KEY_YANDEX = "your-api-key"
  • create environment

    pip install virtualenv
    virtualenv -p python3 env
  • active environment:

    source env/bin/activate
  • install all package needed

pip install -r requirements.txt
  • run tests
pytest
  • run linters
flake8 api/api.py app.py tests/
  • run project
flask run
  • Test API address use postman :

    • Method : POST
    • Add url : http://127.0.0.1:5000/v1/address
    • Select tab "Body" -> "form-data"
    • insert two key:
      • decimal_one = 36.440429
      • decimal_two = 55.964957
    • Click "Send"
  • Test API coordinates use postman :

    • Method : POST
    • Add url : http://127.0.0.1:5000/v1/coordinates
    • Select tab "Body" -> "form-data"
    • insert key:
      • coordinates = Россия, Московская область, городской округ Истра, А-108, Минско-Волоколамский перегон, 58-й километр
    • Click "Send"
  • You can see the result in /log/app.log or check stream result use command:

    tail -f /log/app.log

Running via Docker

  • Build Image
docker image build -t docker-neuro .
  • Running Container
docker run -p 5000:5000 docker-neuro
  • Test your api project

About


Languages

Language:Python 98.2%Language:Dockerfile 1.8%