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
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kartverkets_api-0.1.0.tar.gz.
File metadata
- Download URL: kartverkets_api-0.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.13.5 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15b57e618ff027d0f035a8b8998607dd760ce0fd5327b5b1d22c5e2766f3f58e
|
|
| MD5 |
867902403c941056cc68e006658493f6
|
|
| BLAKE2b-256 |
8428168a97c8dc861550de7511b2ae93531d5cfcf03ff63c8abc715f9c6af693
|
File details
Details for the file kartverkets_api-0.1.0-py3-none-any.whl.
File metadata
- Download URL: kartverkets_api-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8decb0df9ac992d4cd8cc5bdc18a6b9b99e241941a622d1ca63d753b8f7a61e
|
|
| MD5 |
3a1a4addbf70c4eda7ea3fa6e03ffccf
|
|
| BLAKE2b-256 |
a8f2b5a050b36e288b1a691dc0ccd02a79c1daf92d801151c02955439ee576d5
|