Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doreapp/prix-carburants
Fetches french fuel prices
https://github.com/doreapp/prix-carburants
github-pages jekyll python
Last synced: 19 days ago
JSON representation
Fetches french fuel prices
- Host: GitHub
- URL: https://github.com/doreapp/prix-carburants
- Owner: Doreapp
- License: mit
- Created: 2022-05-17T16:26:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-01T14:56:52.000Z (over 1 year ago)
- Last Synced: 2024-10-28T17:12:44.070Z (2 months ago)
- Topics: github-pages, jekyll, python
- Language: Python
- Homepage: https://doreapp.github.io/prix-carburants/
- Size: 187 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Prix carburants
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.
## Installation
### Python module
The python module is in [`prixcarburants`](prixcarburants/) directory.
1. **(Optional) Virtual environment**
We recommend using a python virtual environment. Here are instructions for Linux users:
```bash
virtualenv venv
source venv/bin/activate
```2. **Download dependencies**
```bash
pip install -r requirements.txt
```3. **Help on usage**
```bash
# Global help
python3 -m prixcarburants -h
# Command-specific help
python3 -m prixcarburants -h
```4. **Usage example**
1. Download today's data about fuel prices, into `data` directory
```bash
$ python3 -m prixcarburants download day -o data
data/PrixCarburants_quotidien_20220525.xml
```2. Transform it in a `json` file
```bash
$ python3 -m prixcarburants transform data/PrixCarburants_quotidien_20220525.xml
data/PrixCarburants_quotidien_20220525.json
```3. *Result* : `cat data/PrixCarburants_quotidien_20220525.json`
### Jekyll website (Github pages)
1. Follow [installation guide in dedicated README](docs/Github_pages.md#installation).
2. **Serve the website locally**:
```
make serve
```## Github-pages website
The sources about GitHub-pages website are under [`gh-pages`](gh-pages/) directory.
The actual sources used are in `gh-pages` branch.
## Data
The data displayed by [Github-pages website](#github-pages-website) is stored under `assets/data/` directory in `gh-pages` branch.