pydatagovgr
A Pythonic client for the official data.gov.gr API. Aims to be an easy, intuitive and out-of-the-box way to:
- find data published by central government, local authorities and public bodies of Greece
- build related products and services.
while being robust, following best-practices and eliminating developer-induced bugs.
The aspiration for this library is to enable users of different backgrounds (academia, industry, students etc.) with an interest to programmatically explore and utilize the open data of data.gov.gr, to do so without having to write-debug-maintain trivial code or worry about that.
Install
The recommended installation is via pip:
pip install pydatagovgr
Quick Usage
from pydatagovgr import DataGovClient
gov = DataGovClient()
# fetch public administration evaluation data
evaluation_data = gov.query('public-administration-evaluation')
# fetch the COVID-19 vaccination data
covid_data = gov.query('mdg_emvolio', date_from='2021-10-01', date_to='2021-12-31')
# fetch data on Greece's internet traffic
traffic_data = gov.query('internet_traffic', date_from='2025-06-15', date_to='2025-07-18')
# fetch a list of the forest fires
fire_data = gov.query('mcp_forest_fires', date_from='2017-01-01', date_to='2018-12-31')
Features
The pydatagovgr client supports out-of-the-box all the things you know (and love), such as:
- persistent session: making several requests to data.gov.gr reuses the same underlying connection.
- timeout policy: informs data.gov.gr that it will await at most x seconds for a response for a given request. Defaults to 60 sec.
- retry policy: to account for potential server failures of lossy network connections, client automatically retries with an exponential-backoff, to avoid harming the data.gov.gr. Defaults to a maximum of 3 retries.
Not-So-Quick Usage
The data.gov.gr API exposes, through its api/v1/query GET endpoint, various datasets from different topics.
The pydatagovgr client thus provides a corresponding query method, through which every available dataset can be obtained.
- You can also pass additional arguments to filter the results accordingly.
- Some endpoint have required params while others do not.
- If you want to directly download the results as JSON or CSV, add the keyword
download/before the dataset name e.g.download/mdg_emvolioand pass the paramtype='json'ortype='csv'respectively.
from pydatagovgr import DataGovClient
gov = DataGovClient()
# fetch the sailing data
sailing_data = gov.query('sailing_traffic', date_from='2025-01-01', date_to='2025-07-18')
You can also use Python objects as arguments:
import datetime
data = gov.query(
'sailing_traffic',
date_from=datetime.date(2025, 1, 1),
date_to=datetime.date(2025, 7, 18)
)
# you can also download them as CSV
download = gov.query('download/public-administration-evaluation', type='csv')
decoded_content = download.content.decode('utf-8')
cr = csv.reader(decoded_content.splitlines(), delimiter=',')
dataset = list(cr)
for row in dataset:
print(row)
# or in JSON
download = gov.query('download/ekt-expenses-source', type='csv')
You can also configure the timeout and retry policies of your client. For example:
# this client will stop waiting for a response after 7 seconds
gov = DataGovClient(timeout=7)
# this client will retry at most 3 times, with an exponential-backoff
# (i.e. each retry waits exponentially longer before occurs: 1, 2, 4, 8, ...sec)
gov = DataGovClient(max_retries=3)
# this client will respect both a timeout policy and a retry policy
gov = DataGovClient(timeout=7, max_retries=3)
Related Projects
- go-data-gov-gr-sdk: An SDK - written in Go - to access the data.gov.gr API.
- datagovgR: An R Wrapper Package for the data.gov.gr API.
How to contribute
If you wish to contribute, this is a great place to start!
License
Distributed under the MIT License.
Acknowledgements
All rights are reserved by the official https://data.gov.gr site, its developers, its maintainers and the Hellenic Government.
Metadata
Release files for pydatagovgr 1.0.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 | |
|---|---|---|---|---|
| pydatagovgr-1.0.1.tar.gz | 6.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pydatagovgr-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.5 kB
Release files / pydatagovgr-1.0.1.tar.gz
| Download URL | pydatagovgr-1.0.1.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8958f9638c8a79dd13563497894e7c34d52d7839f90ff3166a2bb818853c24f
|
|
BLAKE2b-256 checksum How to use checksums |
8740abee9070800383966e447c64ebbc79b440be5b184a075539beb85a55cc02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.12.11 Linux/6.11.0-1018-azure
|
Release files / pydatagovgr-1.0.1-py3-none-any.whl
| Download URL | pydatagovgr-1.0.1-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
30ca4094d0f8e6b743ef9066d27bb07c62cc417454f7af6a743cc9a6d072fbcb
|
|
BLAKE2b-256 checksum How to use checksums |
e346c09f56d55094bf61388bacd7041f5d53a4a1539e032d6ebb40d95a738562
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.12.11 Linux/6.11.0-1018-azure
|
Security for pydatagovgr 1.0.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.