This project aims to estimate Uber prices using Uber's API and store the data in a MySQL database. The code fetches price estimates for a specific route and stores various metrics like distance, duration, low and high estimates, and more into a MySQL database.
- Python 3.x
- MySQL
- Uber API Token
- Clone the repository
git clone https://github.com/your-repo/uber-estimate.git
- Install the required Python packages
pip install -r requirements.txt
- Set up MySQL database and replace the credentials in the code.
Run the main script to start fetching and storing Uber price estimates.
python main.py
- main.py: The main script that runs the price estimation and database storage.
- config.py: Contains configuration variables like MySQL credentials and Uber API token.
- get_uber_estimate(): Fetches the Uber price estimates
- convert_to_dataframe(): Converts the JSON response to a Pandas DataFrame.
- calculate_metrics(): Calculates various metrics like average price, duration, etc.
- insert_into_db(): Inserts the calculated metrics into the MySQL database.
- Coordenadas GPS: https://www.coordenadas-gps.com/
- Uber API Documentation: https://developer.uber.com/docs/riders/ride-requests/tutorials/api/python