Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/burnzz/uberfare
Conveniently collects Uber fare prices from a given origin and destination.
https://github.com/burnzz/uberfare
extraction-api python-library uber
Last synced: about 2 months ago
JSON representation
Conveniently collects Uber fare prices from a given origin and destination.
- Host: GitHub
- URL: https://github.com/burnzz/uberfare
- Owner: BurnzZ
- License: mit
- Created: 2018-02-18T09:05:37.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-16T15:43:54.000Z (over 1 year ago)
- Last Synced: 2024-10-11T22:13:55.460Z (3 months ago)
- Topics: extraction-api, python-library, uber
- Language: Python
- Homepage:
- Size: 609 KB
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Uberfare
========.. image:: https://img.shields.io/pypi/v/uberfare.svg
:target: https://pypi.python.org/pypi/uberfare.. image:: https://img.shields.io/pypi/l/uberfare.svg
:target: https://pypi.python.org/pypi/uberfare.. image:: https://img.shields.io/pypi/pyversions/uberfare.svg
:target: https://pypi.python.org/pypi/uberfare.. image:: https://travis-ci.org/BurnzZ/uberfare.svg?branch=master
:target: https://travis-ci.org/BurnzZ/uberfare.. image:: https://codecov.io/gh/BurnzZ/uberfare/branch/master/graph/badge.svg
:target: https://codecov.io/gh/BurnzZ/uberfareThis is a simple wrapper to the official Uber Python SDK intended to
collect data from a given **origin** and **destination** at a specified
time interval.The current implementation only handles the price estimate feature since
it doesn’t need OAuth 2.0 access.Motivation
~~~~~~~~~~I’m using this tool in order to gather data and then evaluate when’s the
best time to leave the house and book an Uber ride to work, and
vice-versa.Requirements
~~~~~~~~~~~~* Python 3.4+
Installation
~~~~~~~~~~~~I'd recommend installing it via `pipenv `_:
.. code-block:: bash
$ pipenv install uberfare
$ # or via the usual pip
$ pip3 install uberfareAPI Key
~~~~~~~Get your ``Server Token`` API Key by creating an app at:
`developer.uber.com/dashboard `__,
and then:* Create or Select an app
* Copy the **Server Token** value in the **Auth** pageBefore using this package, export your ``Server Token`` as:
``export UBER_SERVER_TOKEN=``. You can however, override
this when using the CLI (see below).Usage
~~~~~You have to determine the ``(latitude,longitude)`` of your location,
since the types of rides available will depend on it.The best way to get the coordinates is going to
`maps.google.com `__ and then clicking
any point in the map. A small box will then appear at the bottom-center
of your screen containing the Longitude and Latitude. Take note of the
coordinates for both your origin and destination:.. figure:: docs/img/google-maps-coordinate-lookup.gif
:alt: Google Maps Coordinates LookupCLI
^^^.. code:: bash
>>> # To get the fare estimate, provide the arguments: ,
>>> # (Where origin and destination are in the format)
>>> uberfare estimate 14.55,121.05 14.52,121.01>>> # To save all the RAW data in a CSV file, you can do:
>>> uberfare estimate 14.55,121.05 14.52,121.01 --output-file output.csv.. figure:: docs/img/demo-1.gif
:alt: CLI demo.. code:: bash
>>> # You can also periodically fetch the Uber fares by using the
>>> # --check-interval>>> # To safely save the data in long periods of time, do:
>>> uberfare --check-interval 120 estimate 14.55,121.05 14.52,121.01 --output-file output.csv>>> # You can override the '$UBER_SERVER_TOKEN' env variable right in the CLI via:
>>> uberfare --server_token estimate 14.55,121.05 14.52,121.01
>>> uberfare -st estimate 14.55,121.05 14.52,121.01Notes
~~~~~Be careful when specifying a very short time interval for checking the
price since you might be rate limited.Future Releases
~~~~~~~~~~~~~~~* Better interface for importing as a package
* Option to use address instead of coordinates (use
`Google Maps Geocoding API `_)
* Support the Upfront Fare data collection by enabling the OAUTH2.