Skip to main content

Async adapters for free/open government and public data APIs

Project description

gov-data-api-suite

Async Python adapters for free/open government and public data APIs.

Built on async-rest-adapter — every adapter handles retry, rate-limit, attribution injection, and typed error responses automatically.

Installation

pip install gov-data-api-suite

Quick start

from backend import KoladaAdapter, KoladaConfig, SMHIAdapter, SMHIConfig

# Swedish municipality KPIs (Kolada)
async with KoladaAdapter(config=KoladaConfig()) as adapter:
    result = await adapter.search_kpis("befolkning")
    print(result.data)

# Weather forecasts (SMHI)
async with SMHIAdapter(config=SMHIConfig()) as adapter:
    forecast = await adapter.get_point_forecast(59.33, 18.07)
    print(forecast.data)

Providers

Swedish government

Adapter Description
ArbetsformedlingenAdapter Swedish Public Employment Service
BolagsverketAdapter Swedish Companies Registration Office
BoverketAdapter Swedish National Board of Housing
HavochvattenAdapter Swedish Agency for Marine and Water Management
KoladaAdapter Municipal KPI database
NaturvardsverketAdapter Swedish Environmental Protection Agency
PolisenAdapter Swedish Police — public events
RiksbankenAdapter Swedish central bank — interest rates, exchange rates
RiksdagAdapter Swedish Parliament — members, votes, documents
SCBAdapter Statistics Sweden
SGUAdapter Geological Survey of Sweden
SkatteverketAdapter Swedish Tax Agency
SkolverketAdapter Swedish National Agency for Education
SMHIAdapter Swedish weather and hydrology institute
ValmyndighetenAdapter Swedish Election Authority

International

Adapter Description
ECBAdapter European Central Bank
EurostatAdapter EU statistics
IMFAdapter International Monetary Fund
WorldBankAdapter World Bank open data

Search / Geo

Adapter Description
DuckDuckGoAdapter DuckDuckGo Instant Answer API
OpenStreetMapAdapter Nominatim geocoding

Attribution

All adapters inject metadata["attribution"] into every successful response with the correct license, source text, and URL for the provider.

Requirements

  • Python 3.12+
  • async-rest-adapter ≥ 0.1.0
  • httpx ≥ 0.27
  • pydantic ≥ 2.0

License

MIT

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

gov_data_api_suite-0.2.0.tar.gz (181.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gov_data_api_suite-0.2.0-py3-none-any.whl (284.0 kB view details)

Uploaded Python 3

File details

Details for the file gov_data_api_suite-0.2.0.tar.gz.

File metadata

  • Download URL: gov_data_api_suite-0.2.0.tar.gz
  • Upload date:
  • Size: 181.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for gov_data_api_suite-0.2.0.tar.gz
Algorithm Hash digest
SHA256 97c594418eb4e9d4314d558fe58aaa950c8d8f00a3e354e8c3d9bca88f413a9e
MD5 f7a691aab4974f90ca16519c13a0f3d2
BLAKE2b-256 07749ee9c0df181b921ecda08adbca99e7d5fd82d9c10b310ade55846849e75a

See more details on using hashes here.

File details

Details for the file gov_data_api_suite-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gov_data_api_suite-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c240e84050c39f74cb7c1015eed4f1099d79ec9c5f263671501caf9970a7552
MD5 5936eb0521925c6d4f721b6cf6a9e99a
BLAKE2b-256 040b1f1bef6969f2fe42d2f18f5908c3fd35e32a9b66228e049f3bd634b39256

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page