Skip to main content

Python project to get insights and distances to explore the places of the Earth

Project description

Dora the Explorer

As the name suggests everything, this package is intended for exploring the earth. Imagine you have a set of places (at max 4 places) to vist, how do you know exactly to find the best route to cover all the places? This package helps to find the best route which is pre-planned and displays the route with respect to distance and finally reaching the source place i.e., home.

We have known about one of the famous problems in mathematics - graph theory that is Travelling Salesman Problem. To give a simple gist about the problem, basically there is a salesman who has to travel a bunch of places (cities) to deliver the items. There could be so many possibilities to cover all the cities and reach to his/her source place. But it is very important for a salesman to choose the best possible route which gives a minimal distance. By this he/she can save a lot time and deliver the items at the earliest. For this project, I have considered distance as an important factor, later on time and other factors shall be added.

A typical example can be seen below. When selected 4 places that belong to India the result is obtained having the shortest path to cover the places. The path is just a straight line between the cities.

with_map

What if we want to get the actual route direction from each city that is joining another city?.

with_directions

For getting the map results, it is important to have Mapbox API which is a free API. To get the API - register on mapbox website. Once registered, create a secret token by clicking Create a token button by navigating to this page. Save the token as it will be needed for generating the map results.

Installation

pip install dora-explorer --user

Implementation

from dora_explorer.distance_locator import DistanceLocator

dl = DistanceLocator()

from_ = 'Hindupur'
to_ = 'Bengaluru'

distance = dl.get_distance(from_=from_, to_=to_)
print(distance) # 95.84
from dora_explorer.tiny_explore import DoraTheExplorer

place_list = ['Delhi', 'Hyderabad', 'Hindupur', 'Mumbai']
explore = DoraTheExplorer(place_list=place_list)

min_dis = explore.get_min_dis(source_city='Mumbai')
print(min_dis) # 3583.36

geo_token = <Mapbox API Token>
path = explore.get_path(source_city='Mumbai', with_map=True, with_directions=True, geo_token=geo_token)
print(path) # Mumbai >> Delhi >> Hyderabad >> Hindupur >> Mumbai

Note: The source_city param can also be given an integer. Either 1 or 2 or 3 or 4 as in a list of four places is passed.

from dora_explorer.tiny_explore import DoraTheExplorer

place_list = ['Delhi', 'Hyderabad', 'Hindupur', 'Mumbai']
explore = DoraTheExplorer(place_list=place_list)

path = explore.get_path(source_city=1, num_path=True)
print(path) # 1 >> 2 >> 3 >> 4 >> 1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dora_explorer-0.2.2.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dora_explorer-0.2.2-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file dora_explorer-0.2.2.tar.gz.

File metadata

  • Download URL: dora_explorer-0.2.2.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.7.5

File hashes

Hashes for dora_explorer-0.2.2.tar.gz
Algorithm Hash digest
SHA256 e580b8e95eef5fb0a3c95f7b4241cfc8ed97eec0f6003dbbe2ba0853c4024e8d
MD5 2d3c0b571634a3c3ae60f054db341b2f
BLAKE2b-256 cf765bf8ba5669a08cffb387f56ece61cb4c558afd72ad82b553cb67fb3e39f1

See more details on using hashes here.

File details

Details for the file dora_explorer-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: dora_explorer-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.7.5

File hashes

Hashes for dora_explorer-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4383d2f36d914946f9cf7cb634ea1ce5babbf5b670b44b8c5078172e06a81381
MD5 fa1c4cfe11f955b11143eedc2f6ec31c
BLAKE2b-256 167a004488905d0d5d9efa77b180029a6cae165df14908243ed08f6f9136f96c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page