Skip to main content

alt Banner of the ODP Stockholm package

GitHub Release Python Versions Project Stage Project Maintenance License

GitHub Activity PyPi Downloads GitHub Last Commit Open in Dev Containers

Build Status Typing Status Code Coverage OpenSSF Scorecard

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

For complete retrieval use await client.parking_collection(parking_type=ParkingType.DISABLED, max_records=10000). Import ParkingType from odp_stockholm. This returns ParkingCollection(records, total_count, pages_fetched, source_version, complete=True) after verifying source counts, the safety ceiling, WGS84 CRS and unique original feature IDs. Each ParkingSpot retains spot_id, the complete LineString or MultiLineString geometry, nullable street, and the original feature including all properties in source_attributes. A malformed, truncated or inconsistent response raises ODPStockholmError; it never returns a partial collection. An explicitly counted empty selection may be complete.

The API represents interpreted local traffic regulations, not individually surveyed bays. IDs were unchanged across full/repeated/street requests on 2026-10-12; continuity after a source rebuild is not guaranteed. source_version remains None: response timeStamp is retrieval time, and VALID_FROM/VALID_TO describe validity rather than maintenance time. Preserve these fields and the original geometry when publishing derived information. disabled_parkings(limit=...) remains a capped inspection method, without completeness evidence. Its number now reads nullable VF_PLATSER, correcting the old interpretation of EXTENT_NO; consumers must accept unknown capacity.

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.

Open in Dev Containers

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.0

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

Source distribution (sdist)

Source distribution for odp-stockholm 2.0.0
File Size Uploaded
odp_stockholm-2.0.0.tar.gz 9.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for odp-stockholm 2.0.0
File Interpreter ABI Platform
odp_stockholm-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.4 kB

Release files / odp_stockholm-2.0.0.tar.gz

Download URL odp_stockholm-2.0.0.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2e7930d0f31454a904d8b6658c83db425f09084f614b8702003bdec0313b5a5a
BLAKE2b-256 checksum
How to use checksums
8f12f4e3c5fc25a208f5bfec7b01002c4ac810da9661022c369212dc2b3dfde8
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 12, 2026.

Transparency log

Release files / odp_stockholm-2.0.0-py3-none-any.whl

Download URL odp_stockholm-2.0.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45bcc4b66743594242585744898e22d5096eab8d5b90646fc22b9b9651f03d2d
BLAKE2b-256 checksum
How to use checksums
1c558c071f6a2bfd003d39313a7b011097c948c698bc49422550de9aec36db54
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 12, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.1

2 release files

This release

2.0.0 This release

2 release files

1.0.0

2 release files

0.1.0

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