Skip to main content

datagouv-toolkit

Outils génériques pour explorer, télécharger, inspecter et analyser des jeux de données publiés sur data.gouv.fr.

Architecture

  • datagouv.py : exploration et résolution de datasets data.gouv.fr.
  • download_resources.py : téléchargement générique de ressources.
  • dataset_workflow.py : enchaînement résolution → téléchargement → audit CSV.
  • inspect_csv.py : audit structurel générique d'un CSV.
  • catalog_stats.py : statistiques reproductibles à partir d'un snapshot du catalogue.
  • normalize.py : normalisation des métadonnées.
  • tests/ : tests unitaires.
  • datasets/ : pipelines spécifiques à certains jeux de données.
  • datasets/baac/ : premier cas d'usage, données BAAC.

Exemples

Rechercher un dataset

python datagouv.py search "accidents corporels"

Inspecter ses ressources

python datagouv.py resources \
  "accidents corporels" \
  --producer "Ministère de l'intérieur"

Télécharger une ressource

python download_resources.py \
  "accidents corporels" \
  --producer "Ministère de l'intérieur" \
  --format csv \
  --resource-title "Caract_2024" \
  --output data

Télécharger et auditer automatiquement

python dataset_workflow.py \
  "accidents corporels" \
  --producer "Ministère de l'intérieur" \
  --format csv \
  --resource-title "Caract_2024" \
  --output data

Auditer un CSV local

python inspect_csv.py fichier.csv

Pour rediriger un audit volumineux :

python inspect_csv.py fichier.csv > audit.txt

Analyser un snapshot du catalogue

python catalog_stats.py "transport" \
  --snapshot snapshot/2026-08-25

Filtres disponibles notamment :

python catalog_stats.py "énergie" \
  --snapshot snapshot/2026-08-25 \
  --license fr-lo-2.0 \
  --frequency annual

Qualité

ruff check .
mypy .
pytest -q
bandit -q *.py

Metadata

Release files for datagouv-toolkit 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datagouv-toolkit 0.1.1
File Size Uploaded
datagouv_toolkit-0.1.1.tar.gz 39.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for datagouv-toolkit 0.1.1
File Interpreter ABI Platform
datagouv_toolkit-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 71.0 kB

Release files / datagouv_toolkit-0.1.1.tar.gz

Download URL datagouv_toolkit-0.1.1.tar.gz
Size 39.7 kB
Tags Source
SHA-256 checksum
How to use checksums
be8c5fcc3cab07a58136049a07e70f23c6361c9b3be653f8cbedba9d888e5c58
BLAKE2b-256 checksum
How to use checksums
aa1556872a063a5749148c07d23003b13241c879ed3a39d3f27c3fc535b3f494
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / datagouv_toolkit-0.1.1-py3-none-any.whl

Download URL datagouv_toolkit-0.1.1-py3-none-any.whl
Size 31.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cb6917836e98da1aed30a4f51ccc0898408df2e08e5066aec15b705d2045a4b
BLAKE2b-256 checksum
How to use checksums
3d124619581b9520ad3513f8804bb22e0911fa90b85af721d852b0319edb5a25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page