Asynchronous Python client for the open datasets of Stockholm (Sweden).
About
A python package with which you can retrieve data from the Open Data Platform of Stockholm 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 odp-stockholm
Datasets
You can read the following datasets with this package:
To use the data you need an API key, which you can request via this link.
Click here to get more details
Disabled parking regulations
You can use the following parameters in your request:
- limit (default: 10) - How many results you want to retrieve.
| Variable | Type | Description |
|---|---|---|
location_id |
string | The id of the location |
location_type |
string | The type of the location |
number |
integer or None | Source VF_PLATSER capacity when supplied; EXTENT_NO is not capacity |
street |
string | The street name of the location |
address |
string | The address of the location |
district |
string | The district name where the location is |
parking_rate |
string | The parking rate of the location |
parking_rules |
string | URL to the parking regulations of Stockholm |
valid_from |
datetime | The date from when the parking is valid |
valid_to |
datetime (or None) | The date until when the parking is valid |
coordinates |
list[float] | The coordinates of the location |
Example
Use parking_collection(parking_type=ParkingType.DISABLED, max_records=10000) for complete retrieval; import ParkingType from odp_stockholm. See the collection API for source geometry, result fields and limitations.
import asyncio
from odp_stockholm import ParkingStockholm
async def main() -> None:
"""Show example on using this package."""
async with ParkingStockholm(api_key="YOUR_API_KEY") as client:
locations = await client.disabled_parkings(
limit=10,
)
print(locations)
if __name__ == "__main__":
asyncio.run(main())
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) 2023-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 odp-stockholm 2.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 | |
|---|---|---|---|
| odp_stockholm-2.0.1.tar.gz | 9.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| odp_stockholm-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.2 kB
Release files / odp_stockholm-2.0.1.tar.gz
| Download URL | odp_stockholm-2.0.1.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db47b41b6c1a0bbb09c467edf2ebbcf72c2f2203a2b400e014082eaf45788145
|
|
BLAKE2b-256 checksum How to use checksums |
646ed7a0d634454c61dfcc8f42a66fe60bcc912ca85c12236b2d75caf221c1cf
|
| 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 14, 2026.
Transparency logRelease files / odp_stockholm-2.0.1-py3-none-any.whl
| Download URL | odp_stockholm-2.0.1-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a31587b1d83cab091b776441e945888976b873e7f806d973c4d290b9ce2f2840
|
|
BLAKE2b-256 checksum How to use checksums |
053259f1150c1f955d481ab54fb379c2750c43cbe76129a1454e7a47afe19220
|
| 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 14, 2026.
Transparency log