Skip to main content

pygouv

pygouv is a non official Python API wrapper for data.gouv.fr, the French Official Open Data Portal.

Installation

You can install pygouv with:

pip install pygouv

Usage

import pygouv as gv

gv.home( ) and gv.home_compact()

Displays the datasets that are currently exhibited within the home page of the data.gouv.fr portal.

gv.home() returns all the columns that are provided by the data.gouv API and can be overwhelming. In this context, there is the gv.home_compact() that as its name implies much more compact and contains only the most important columns: id, title, last_update

gv.site_metrics( )

Provides global metrics related to the data.gouv.fr portal:

gv.search( ) and gv.search_compact()

Searches for specific data sets through the data.gouv API according to the pattern provided into the query parameter. It takes three arguments query, page and page_size:

gv.search(query='cafés à paris',
          page = 0, # look at page 0 (the default)
          page_size = 20) # pull 20 results

gv.search() returns all the columns provided by the API. gv.search_compact() returns only three columns: id, description, last_update

gv.explain( )

Provides in French a detailed description of a data set. It takes one mandatory argument which is the dataset_id that you can get from output of the search() function.

print(gv.explain('5f9b902d3784843c84d5f959'))
**Ce jeu de données recense les déclarations de terrasse éphémère.**

La Ville de Paris a pris la décision d'autoriser l'extension gratuite des terrasses pour les cafés, bars et restaurants.

Habituellement soumises à une autorisation, les extensions provisoires sont exceptionnellement enregistrées à titre gratuit, et sont valables jusqu'en juin 2021.

La déclaration est effectuée via un téléservice sur Paris.fr. Chaque commerçant doit signer et afficher une charte d'engagement.

[Plus d'informations: sur Paris.fr](https://www.paris.fr/pages/reouverture-des-bars-et-restaurants-agrandir-ou-creer-sa-terrasse-7847)

Description des données :

· \- Reference Déclaration (Numéro de la déclaration)

· \- Nom Commerce

· \- Adresse Commerce et coordonnées géographiques (X ; Y)

gv.resources( ) and gv.resources_compact():

gv.resources() lists all the available resources within a specific data set. gv.resources_compact() is its equivalent except that it returns only two columns: format, url

gv.resources('5f9b902d3784843c84d5f959')

suggest_territory( )

Returns suggested territory pages according to the query provided by the user:

gv.suggest_territory(query = 'paris', result_size=10)

Code of Conduct

Please note that the pygouv project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Release files for pygouv 0.1.0

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

Built distribution (wheel)

Table of built distributions (wheels) for pygouv 0.1.0
File Interpreter ABI Platform
pygouv-0.1.0-py3-none-any.whl Python 3 none any Details

Release files / pygouv-0.1.0-py3-none-any.whl

Download URL pygouv-0.1.0-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecfeb2fe30f5284af7ccea55c8226ad129f68d069a9050c55f5204c143045070
BLAKE2b-256 checksum
How to use checksums
905a3c196a8e644fdf9263a25735db75e9a627f708d312265dc22fc0ff6e8a4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.2 CPython/3.9.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

2 release files

0.0.1

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