No project description provided
Project description
datagouv-python
Unofficial python client for data.gouv.fr
.
Official documentation is here: https://guides.data.gouv.fr/guide-data.gouv.fr/api/reference.
Current API version supported = "1".
Getting Started
from datagouv import DatagouvClient
client = DatagouvClient(MY_API_KEY)
# Get a dataset
dataset = client.datasets.get(my_dataset_id)
dataset_resources = dataset.get('resources')
# Upload a new resource from a file
client.datasets.post_resource_file(my_dataset_id, filename)
# Update a resource file
client.datasets.put_resource_file(my_dataset_id, filename, resource_id)
# Update a resource
client.datasets.put_resource(my_dataset_id, resource)
Download all resources
from datagouv import ResourcesDownloader
# Get a dataset: https://meteo.data.gouv.fr/datasets/656dab84db1bdf627a40eaae
dataset_id = "656dab84db1bdf627a40eaae"
# Instanciate ResourcesDownloader
downloader = ResourcesDownloader(dataset_id)
# Download to current directory
downloader.download()
Development
poetry run start
poetry run black datagouv/
poetry run flake8
Build
Process
poetry version [patch, minor, major]
poetry install
poetry build
# Update CHANGELOG
git commit -m "vX.X.X"
git tag vX.X.X
poetry deploy
git push --tags
git push
Details
poetry version
poetry version -s
poetry version [patch, minor, major]
poetry build
https://pypi.org/project/datagouv-python/
Publish
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config pypi-token.test-pypi MY_TOKEN
poetry config pypi-token.pypi MY_TOKEN
poetry publish -r test-pypi
poetry publish
Roadmap
- Handle /datasets routes
- Handle other routes
- /site
- /reuses
- /discussions
- /organizations
- /spatial
- /users
- /me
- /workers
- /tags
- /topics
- /posts
- /transfer
- /notifications
- /avatars
- /harvest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
datagouv_python-0.1.1.tar.gz
(15.8 kB
view hashes)
Built Distribution
Close
Hashes for datagouv_python-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85dfe88074184644fe39cd8ae520f5480c25e674fe5233a5437fdca80041a0ab |
|
MD5 | c79fec119e413964319b18a4a90e9d90 |
|
BLAKE2b-256 | d3811d326b2b09cd81adec8223cd4df7f5076d07884c8507c570f3c8c0779501 |