Asynchronous Python client for the open datasets of Eindhoven (The Netherlands).
About
A python package with which you can retrieve data from the Open Data Platform of Eindhoven via their API. This package was initially created to only retrieve parking data from the API, but the code base is made in such a way that it is easy to extend for other datasets from the same platform.
Installation
pip install eindhoven
Datasets
You can read the following datasets with this package:
Click here to get more details
Parkings spots
You can use the following parameters in your request:
- limit (default: 10) - How many results you want to retrieve.
- parking_type (default: ParkingType.PARKING) - See the list below to find the corresponding enum value.
ParkingType |
Enum |
|---|---|
| Parkeerplaats | PARKING |
| Parkeerplaats Vergunning | PERMIT_PARKING |
| Parkeerplaats Gehandicapten | DISABLED_PARKING |
| Parkeerplaats Afgekruist | CROSSED_OUT_PARKING |
| Parkeerplaats laden/lossen | LOADING_UNLOADING_PARKING |
| Parkeerplaats Electrisch opladen | ELECTRIC_CHARGING_PARKING |
Both locations() and parking_collection() return the same ParkingSpot model from the ODSv2.1 endpoint. The client validates source IDs, categories and coordinates before mapping the source row through Mashumaro ParkingSpot.from_dict(). ParkingSpot and ParkingCollection support typed from_dict() / from_json() and to_dict() / to_json() round trips, including nested records and explicit null values.
| Attribute | Type | Description |
|---|---|---|
spot_id |
string | Original positive integer objectid as a decimal string |
source_attributes |
dict | All original ODSv2 fields, including null values |
data |
ParkingData | Typed parking_type, nullable street and nullable number (integer or float) |
geometry |
Geometry | Typed WGS84 Point with type, coordinates, latitude and longitude |
Example
import asyncio
from eindhoven import ODPEindhoven, ParkingType
async def main() -> None:
"""Show example on using the Open Data Platform API of Eindhoven."""
async with ODPEindhoven() as client:
locations = await client.locations(
limit=100,
parking_type=ParkingType.PARKING,
)
print(locations)
if __name__ == "__main__":
asyncio.run(main())
Complete collection contract
Use await client.parking_collection(parking_type=ParkingType.DISABLED_PARKING, max_records=9900) for a complete selection. locations(limit=..., parking_type=...) is a limited convenience API using the same endpoint and record parser. It only fetches the requested prefix and does not assert a full, version-checked collection.
All parking collection clients share this envelope:
| Field | Meaning |
|---|---|
records |
Source-specific records, retaining original source IDs and raw fields |
total_count |
Source-declared count for the selected category; equals len(records) |
pages_fetched |
Actual record pages requested, including an empty first page |
source_version |
Opaque source revision token, or None where unavailable; never a record modification date |
complete |
Always True on success; failures raise an exception rather than returning a partial collection |
Eindhoven returns ParkingSpot with spot_id (original positive integer objectid rendered as a decimal string), source_attributes (all original ODSv2 fields, including null values), data (typed original parking fields), and geometry (typed WGS84 Point). The exact original geometry, including additional source fields, remains in source_attributes["geo_shape"]["geometry"]. Consumer-specific mapping, access decisions, and publication remain outside this package.
The client requests pages of 100 ordered by objectid, validates totals, page lengths and unique IDs, and compares the portal's data_processed token before and after collection. Empty selections return a complete empty collection. The default safety bound is 9900 records and may be lowered; exceeding it raises ODPEindhovenResultsError. The revision comparison is an observation of portal metadata, not a transaction guarantee by the provider.
Migration to ODSv2.1
This release changes the source endpoint and ParkingSpot shape. All requests now use /api/explore/v2.1/catalog/datasets/parkeerplaatsen; the ODSv1 path and response models are removed.
- Replace hashed ODSv1
recordididentities with the originalobjectidexposed asspot_id. Do not treat these different IDs as equivalent. spot.data.parking_type,.streetand.numberremain available through typedParkingData. Street and number can beNone; a fractional source number is retained as a float without rounding. All raw fields are additionally preserved inspot.source_attributes.spot.geometry.latitude,.longitudeand.coordinatesremain available through typedGeometry; itstypeisPoint. Exact additional geometry fields remain in the rawsource_attributes.updated_at,BaseResponseandParkingResponseare removed. ODSv2 does not provide the old per-record portal timestamp;source_versionis an observed dataset revision token and must not be substituted for a record modification date.locations()retains its limited-list behavior and no-results exception. For a confirmed empty or complete selection, useparking_collection().
Use cases
A website that provides insight into where disabled parking spaces are, based on data from users and municipalities. Operates mainly in the Netherlands, but also has plans to process data from abroad.
Contributing
This is an active open-source project. We are always open to people who want to use the code or contribute to it.
We've set up a separate document for our contribution guidelines.
Thank you for being involved! 😍
Setting up development environment
The simplest way to begin is by utilizing the Dev Container feature of Visual Studio Code or by opening a CodeSpace directly on GitHub. By clicking the button below you immediately start a Dev Container in Visual Studio Code.
This Python project relies on uv as its dependency manager, providing comprehensive management and control over project dependencies.
You need at least:
- Python 3.12+
- uv
Installation
Install all packages, including all development requirements:
uv sync --locked
uv creates a project virtual environment in .venv and installs the locked dependencies.
Prek
This repository uses the prek framework, all changes are linted and tested with each commit. To setup the prek check, run:
uv run prek install
And to run all checks and tests manually, use the following command:
uv run prek run --all-files
Testing
It uses pytest as the test framework. To run the tests:
uv run pytest
To update the syrupy snapshot tests:
uv run pytest --snapshot-update
License
MIT License
Copyright (c) 2021-2026 Klaas Schoute
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Metadata
Release files for eindhoven 6.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| eindhoven-6.0.0.tar.gz | 10.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| eindhoven-6.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.3 kB
Release files / eindhoven-6.0.0.tar.gz
| Download URL | eindhoven-6.0.0.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2b9a53f20bd96c566940727905c4b98d8f54b05dd873658d4d2a0b90a121612
|
|
BLAKE2b-256 checksum How to use checksums |
2d194e4ba9d3a76b25cf378513b9ee2669f97f05d6683fd40868ffc4ebdcc3db
|
| 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 Oct 7, 2026.
Transparency logRelease files / eindhoven-6.0.0-py3-none-any.whl
| Download URL | eindhoven-6.0.0-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68629fe7b8d44de13af0666162ca6e9b341b0328d924d58e4b0205bbef79508f
|
|
BLAKE2b-256 checksum How to use checksums |
482e95b3ba491b2c6fde6d52eda86ed52be4e728a67e50db82698f3d711a2010
|
| 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 Oct 7, 2026.
Transparency log