Skip to main content

Python Distance Calculator Bing Api facilitator

Project description

Python Bing API Facilitator

Python Bing API Facilitator is a Python library created to simplify the usage of the bing api for distance between two geographic coordination. The project is on current development and future methods may be implemented

Installation

Import the package from Pypi

pip install pybaf

Usage

Import the class pybaf from the package

from pybaf import pybaf

Define the bing_api with your Bing key

pybaf = pybaf(key = 'key')

You need to define two dataframes that contain latitude and longitude and their IDs to calculate a Distance Matrix

df_origin = 'Insert the origin dataframe here'
df_destination = 'Insert the origin dataframe here'

The distance_matrix method returns a pd.DataFrame with all cross IDs (origin and destination) with their relative distance(KM) and time(minutes).

Note that you will need to pass the destination_id and origin_id to identify the returning pd.DataFrame

df_matrix = pybaf.distance_matrix(df_destination='', df_origin='', destination_id='', origin_id='',)

The n_smallest method returns the n_smallest value between id_origin the id_destinations

n_smallest_df = pybaf.n_smallest(df_final, n=1,origin_id='', destination_id='',value='')

# default n=1

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Authors

developed by joaovitorncn

Project details


Download files

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

Files for pybaf, version 0.0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size pybaf-0.0.1.3-py3-none-any.whl (4.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pybaf-0.0.1.3.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page