An asynchronous geolocation service to perform geocoding of addresses and reverse-geocoding of long/lat coordinates.
A fast and reliable distributed task processing library for Python 3. https://dramatiq.io
Why dramatiq?
https://dramatiq.io/motivation.html
1. High reliability and performance
2. Simple and easy to understand core
3. Convention over configuration
Most of the features are equivalent between Celery and Dramatiq
. Asynchronous communication
. Parallel processing
. Event-driven protocols
. Multi-platform Execution
Still, I decided to go for Dramatiq for the below reason
- Simple learning curve
- Task Prioritization
- Code auto-reload using watch library makes development easy
- Reliable delivery.
- Can learn more by experimenting with documentation and examples given since developer community & Stack overflow supports are less
NOTE:
https://stackoverflow.com/search?q=celery (17,105 results)
https://stackoverflow.com/search?q=dramatiq(6 results)
RabbitMQ is an opensource message broker
RabbitMQ is lightweight and easy to deploy on premises and in the cloud. It supports multiple messaging protocols
RabbitMQ can be deployed in distributed and federated configurations to meet high-scale, high-availability requirements.
https://www.rabbitmq.com/install-windows-manual.html
Open "RabbitMQ Command Prompt (sbin dir)" and run the following command
rabbitmq-plugins enable rabbitmq_management
It will enable all the plugins that is associated with the RabbitMQ. Now open the browser and type http://localhost:15672 it will open a RabbitMQ console login with "guest as username" and "guest as password".
Redis is an open source in-memory data structure store, used as a database, cache and message broker.
It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams
https://redislabs.com/blog/redis-on-windows-10/
Simple and consistent geocoding library written in Python.
https://github.com/DenisCarriere/geocoder
Used OSM (OpenStreetMap) geocoding provider.
>>> import geocoder
>>> g = geocoder.osm('New York city')
>>> g.json
-
Install RabbitMQ and Redis
-
Geocoder
$ pip install geocoder
- Dramatiq with RabbitMQ
$ pip install dramatiq[rabbitmq]
- Dramatiq with Redis
$ pip install dramatiq[redis]
- Watch
$ pip install watchdog_gevent
$ pip install watchdog
- Run RabbitMQ: rabbitmq-server
- Run Redis: redis-server
- Run a batch file workers.bat
- In another terminal, run python main.py "H. C. Andersens Blvd. 27, 1553 København V, Denmark"
- In another terminal, run python main.py "(55.674146, 12.569553)"