A short script to download all OVH bills
Go to file
Dryusdan b806680498
continuous-integration/drone/push Build is passing Details
Improve drone and create README.md
2022-04-09 00:31:00 +02:00
src Write it pylama friendly 2022-04-09 00:16:58 +02:00
.drone.yml Improve drone and create README.md 2022-04-09 00:31:00 +02:00
.gitignore Make ovh-bill 2022-04-08 18:36:01 +02:00
README.md Improve drone and create README.md 2022-04-09 00:31:00 +02:00
poetry.lock Make ovh-bill 2022-04-08 18:36:01 +02:00
pyproject.toml Make ovh-bill 2022-04-08 18:36:01 +02:00
secrets.yaml.sample Make ovh-bill 2022-04-08 18:36:01 +02:00



A simple way to download you're bills automaticaly

Build Status

Install it

This project use poetry

git clone https://git.dryusdan.fr/Dryusdan/ovh-bills-pdf.git
cd ovh-bills-pdf
pip3 install poetry
poetry install --no-dev

If you don't want a virtualenv, run command bellow before poetry install

poetry config virtualenvs.create false --local

Copy secrets.yaml.sample into ~/.config/ovh-bills-pdf/secrets.yaml and update it. You can add as many accounts as you want.

Configure it

To configure your application, you need before your app key. More information (different region so different API) : https://github.com/ovh/python-ovh#1-create-an-application You can allow all endpoint (*) but I recommand this two endpoints :

  • /me/bill
  • /me/bill/*

After this, you need to get you're ovh client endpoint name (here call region) : https://github.com/ovh/python-ovh#2-configure-your-application

name: Paperless #You're app name
  - name: "OVHcloud XXX" #You're account name, only for log
    app_key: #Application key
    app_secret: You're application secret
    consumer_key: You're consummer key
    region: ovh-eu # Region (endpoint name)
  - name: "Kimsufi XXX" # A second account. You can create many accounts
    region: kimsufi-eu
download_path: /var/opt/paperless/consume #Path to save file (for me in paperless)
timezone: Europe/Paris #You're timezone

Run it

To run this tool the first time, go to program folder and enter this command :

poetry run python3 src/main.py download-all

And periodicaly (the saturday for exemple) :

3 16 * * 6 cd  path/to/ovh-bills-pdf/ && /var/opt/paperless/.local/bin/poetry run python3 src/main.py

Replace /var/opt/paperless by your own home repository