Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nonsignificantp/ecobici-api
Scrapping script for Buenos Aires' bike-sharing system. By listening to an API, it gathers current status of each docking station in the system.
https://github.com/nonsignificantp/ecobici-api
Last synced: 1 day ago
JSON representation
Scrapping script for Buenos Aires' bike-sharing system. By listening to an API, it gathers current status of each docking station in the system.
- Host: GitHub
- URL: https://github.com/nonsignificantp/ecobici-api
- Owner: nonsignificantp
- License: mit
- Created: 2019-02-06T20:50:07.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-07T15:31:04.000Z (almost 6 years ago)
- Last Synced: 2024-11-09T09:44:11.660Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ecobici data listening
### Summary
`stations.py` send API requests for every docking station that is part of Buenos Aires' bicycle sharing system. It's purpose is to collect data on how many docked bicycles and available positions are in each of the 198 stations. A comprehensive list of all docking stations to present can found in `data/stations.json`
`weather.py`: gets the HTML of two weather stations sites, parses it with the use of BeautifulSoup and returns weather variables as temperature, wind, rain, etc.
Data collected by both scripts is ment to be use for docking stations usage prediction using machine learning in a latter proyect.
### How to use
Both scripts should be use with cron so they can be executed at time intervals. We suggest running `stations.py` every 5 minutes and `weather.py` every 30 minutes. For the `stations.py` add a 1 minute buffer after the 5 minute interval mark to make sure that server side data is updated since the server updates its data every five minutes. `crontab -e` file should look like this:
```
# m h dom mon dow command
1-59/5 * * * * python /path/to/script/stations.py
*/5 * * * * python /path/to/script/weather.py
```Don't forget to set the appropiate permissions for both scripts.
```
sudo chmod +x script.py
```