Skip to main content

Unofficial client for Kartverket's API for property data (Grunnboken and Matrikkelen).

Project description

Kartverket API Client

This Python module provides a simple, asynchronous client for interacting with the Kartverket (Norwegian Mapping Authority) API. It allows you to search for place names (stedsnavn) and retrieve location data.

Features

  • Asynchronous API client using aiohttp.
  • Search for place names with various filtering options.
  • Pydantic models for type-safe data handling.

Installation

  1. Install package:
    pip install kartverkets-api
    

Usage

Here's a basic example of how to use the KartverketAPI client to search for a place name.

import asyncio
from kartverket.api import KartverketAPI

async def main():
    """
    Example usage of the KartverketAPI client.
    """
    # The client is an async context manager
    properties_eier = [{"kommuenummer" : "0301",
                   "gardsnummer" : 240,
                   "bruksnummer" : 12,
                   "festenummer" : 0,
                   "seksjonsnummer" : 0}]
    
    properties_andel = [{"borettslagnummer" : 903456235,
                         "andelsnummer" : 72 }]
    async with KartverketAPI() as client:
        try:
            #Search for a specific property with eier ownership
            result_eier = await client.get_by_property(properties_eier,ownership_type="eier")
            
            #or with andel ownership type
            result_andel = await client.get_by_property(properties_andel,ownership_type="andel")

            print(f'Eier: {result_eier}\nAndel: {result_andel}')
        except Exception as e:
            print(f"An error occurred: {e}")

if __name__ == "__main__":
    asyncio.run(main())

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

kartverkets_api-0.1.9.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

kartverkets_api-0.1.9-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file kartverkets_api-0.1.9.tar.gz.

File metadata

  • Download URL: kartverkets_api-0.1.9.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.5 Darwin/24.6.0

File hashes

Hashes for kartverkets_api-0.1.9.tar.gz
Algorithm Hash digest
SHA256 6b8941efea5340d83d091247d6a0f51c2d332357351a88770d3f72a405e8c6e0
MD5 90b76fdfb18adec21927e6e8b4d577cd
BLAKE2b-256 f50ffe99527b1636dcec508240913edfc95bcf9d8792f1ca21ded257f34cc8cb

See more details on using hashes here.

File details

Details for the file kartverkets_api-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: kartverkets_api-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.5 Darwin/24.6.0

File hashes

Hashes for kartverkets_api-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 84ef01d9ced8da3a6446da63a7f2cdb6892fd9dbb1ac2404cad7f5c81513e971
MD5 37e9df48bb66312774bdc714c26b9adc
BLAKE2b-256 ff2090a6c4fd8a25de3e551c65f0ce937db24142a76bfb564da9cc6afa1bd10c

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