dgfip-fetcher
dgfip-fetcher is a CLI tool to automatically download all your tax documents (income tax notices, declarations, property taxes, etc.) from your personal space on impots.gouv.fr.
Note: This tool is specifically designed for the French tax administration website.
Key Features
- Time-saving: No more manual clicking through each year.
- Clear Organization: One folder per year, with the income tax notices (avis d'impôt) at its root and the other documents in sub-folders (
Déclarations,Taxes locales,Factures,Autres). Files are named after the year and the document title (e.g.,2022_avis_de_taxes_foncieres_2022_c4e1a9.pdf). The short suffix is derived from the document identifier, so two documents with the same title (e.g. local invoices) never collide. - Incremental: Documents already present in the output folder are skipped, so you can run it every year in the same folder.
- Secure: Your credentials are stored in your system's secure vault (Keyring).
- Simple: One command to fetch everything.
Installation
pip install dgfip-fetcher
After installation, you must download the browser used by Playwright:
python -m playwright install chromium
(Note: If you use uv, run: uv run playwright install chromium)
Usage
Once installed, simply run:
dgfip-fetcher
Options
--years N: Number of previous years to scan (default: 10).--output DIR: Destination folder for PDFs.--flat: Saves all files directly in the destination folder instead of year folders.--debug: Shows the browser during login (useful for troubleshooting). When asked for the 2FA code, you can also type it in the browser and just press Enter in the terminal.--reset: Clears saved credentials and session.
Example:
dgfip-fetcher --years 5 --output my_tax_archives
How It Works
- Authentication: Uses Playwright to handle login and 2FA (SMS/Email) from the official French tax portal. The session is saved and reused, so the 2FA code is only asked when it has expired.
If the login fails, a screenshot of the page is saved in the config folder (
login_failure.png) to help troubleshooting. - Secret Storage:
- Your French tax ID (SPI) and the session cookies are stored in a standard config folder, readable only by your user.
- Your password is encrypted and stored in your OS keychain.
- Retrieval: All documents (tax notices, returns, acknowledgements, local invoices...) are listed from the "Documents" page and downloaded with plain HTTP requests.
Development
To contribute:
- Clone the repository.
- Install dependencies:
uv sync. - Run in dev mode:
uv run dgfip-fetcher.
Disclaimer
This project is an independent tool and is NOT affiliated with the Direction générale des Finances publiques (DGFiP) or impots.gouv.fr. Use it at your own risk.
Metadata
Release files for dgfip-fetcher 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dgfip_fetcher-0.2.1.tar.gz | 42.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dgfip_fetcher-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.0 kB
Release files / dgfip_fetcher-0.2.1.tar.gz
| Download URL | dgfip_fetcher-0.2.1.tar.gz |
|---|---|
| Size | 42.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77267cc096dd53b383fd3170971464896664aafa2c03462aba965d656610d585
|
|
BLAKE2b-256 checksum How to use checksums |
abc1f5da238f99d94e2c9ddebd1471ec5439f000d4e0820d392d62ec5c675e08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / dgfip_fetcher-0.2.1-py3-none-any.whl
| Download URL | dgfip_fetcher-0.2.1-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f3be6c4c17744f3da4a9d3f3a73b01639039722dab5076a0c8983f1b58d4ef36
|
|
BLAKE2b-256 checksum How to use checksums |
91a5301691dabc4910a26e58b0f14821d0d2ca92bb787d7172dcbae2a00530dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for dgfip-fetcher 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.