Simple project that collect data about Velo'v station (from JCDecaux API) and push them to InfluxDB.
You can simply run this script after installing requirements (pipenv install
) and creating a configuration file with pipenv run python main.py
. But the recommended way is to use Docker (see below).
This bot use a JSON file to get some different configuration variables it needs. An example of this file is provided under config/config_example.json
and need to be copy (and modified) as config/config.json
. This file contains InfluxDB connection information and configuration needed for JCDecaux API :
influxdb.url
: complete URL to connect to InfluxDB (eg.https://my.influxinstance.tld
)influxdb.user
: A user with write access to InfluxDBinfluxdb.password
: Password for the userinfluxdb.database
: Database to useapi.key
: API key
A simple Docker image is provided in order to run this bot on a regular basis. It is a simple Python 3 (Alpine based) Docker image with all the requirements. The entrypoint is quite simple : a while loop that call the main.py
script and sleep for some times. The interval to sleep between each calls can be configured with the environment variable INTERVAL_SECONDS
(default to 10
).
Also, don't forget to mount your configuration file on /code/config/config.json
Following metrics are exported by this bot :
bike_stands
: Number of existing bike stands (with station'sid
andname
tags)available_bike_stands
: Number of available bike stands (with station'sid
andname
tags)available_bikes
: Number of available bikes (with station'sid
andname
tags)