Contains:
- A python module to fetch fuel prices.
- A Github-pages website to display data about fuel prices.
It uses french open data. See https://www.prix-carburants.gouv.fr/rubrique/opendata/ for details.
The python module is in prixcarburants
directory.
- (Optional) Virtual environment
We recommend using a python virtual environment. Here are instructions for Linux users:
virtualenv venv
source venv/bin/activate
- Download dependencies
pip install -r requirements.txt
- Help on usage
# Global help
python3 -m prixcarburants -h
# Command-specific help
python3 -m prixcarburants <command> -h
-
Usage example
-
Download today's data about fuel prices, into
data
directory$ python3 -m prixcarburants download day -o data data/PrixCarburants_quotidien_20220525.xml
-
Transform it in a
json
file$ python3 -m prixcarburants transform data/PrixCarburants_quotidien_20220525.xml data/PrixCarburants_quotidien_20220525.json
-
Result :
cat data/PrixCarburants_quotidien_20220525.json
-
-
Serve the website locally:
make serve
The sources about GitHub-pages website are under gh-pages
directory.
The actual sources used are in gh-pages
branch.
The data displayed by Github-pages website is stored under assets/data/
directory in gh-pages
branch.