Skip to main content

Norske Kommuner

pre-commit pre-commit.ci status PyPI - Status Download Stats

Pydantic models on Norwegian municipalities (Norske kommuner).

from norske_kommuner import kommuner, get_kommune_by_nr

#  Loop over all kommuner:
for kommune in kommuner.values():
    print(kommune)

#  Get kommunenummer
print (kommuner['Stavanger'].kommunenummer) # 1103

# Can also get kommune by kommunenr
print(get_kommune_by_nr('1103')) #  Stavanger

# Each kommune is a pydantic model and have pydantic functionality like exporting to json
print(kommuner['Stavanger'].json())

Last line will output

{
    "avgrensningsboks": {
        "coordinates":   [[[5.49903313381, 58.884658939559], [5.49903313381, 59.312103554166], [6.131310442607, 59.312103554166], [6.131310442607, 58.884658939559], [5.49903313381, 58.884658939559]]],
        "crs": {
            "properties": {
                "name": "EPSG:4258"
            },
            "type": "name"
        },
        "type": "Polygon"
    },
    "fylkesnavn": "Rogaland",
    "fylkesnummer": "11",
    "gyldigeNavn": [
        {
            "navn": "Stavanger",
            "prioritet": 1,
            "sprak": "Norwegian"
        },
        {
            "navn": null,
            "prioritet": 2,
            "sprak": null
        },
        {
            "navn": null,
            "prioritet": 3,
            "sprak": null
        }
    ],
    "kommunenavn": "Stavanger",
    "kommunenavnNorsk": "Stavanger",
    "kommunenummer": "1103",
    "punktIOmrade": {
        "coordinates": [
            5.712610778068,
            59.10201328799
        ],
        "crs": {
            "properties": {
                "name": "EPSG:4258"
            },
            "type": "name"
        },
        "type": "Point"
    },
    "samiskForvaltningsomrade": false
}

Uses data and models from "Åpent API fra Kartverket for administrative enheter"

Metadata

Release files for norske-kommuner 0.4.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 norske-kommuner 0.4.0
File Size Uploaded
norske_kommuner-0.4.0.tar.gz 52.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for norske-kommuner 0.4.0
File Interpreter ABI Platform
norske_kommuner-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 109.1 kB

Release files / norske_kommuner-0.4.0.tar.gz

Download URL norske_kommuner-0.4.0.tar.gz
Size 52.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bdb06d7ce3d0d0b10e090426c9db6a45bbd0da48b825aac803a0710934528fd7
BLAKE2b-256 checksum
How to use checksums
6b79bf7731ab6ae8ccbfc54ec948682a2ee65bacb5f46fabc6b2258ca7f55ea8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.1 Linux/5.15.133.1-microsoft-standard-WSL2

Release files / norske_kommuner-0.4.0-py3-none-any.whl

Download URL norske_kommuner-0.4.0-py3-none-any.whl
Size 56.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
716112c7dc63cc699f3b68501eb01425f7edcf19e7188e9b139f77e326be5df7
BLAKE2b-256 checksum
How to use checksums
9a03f9ad75013ec743828f83ed87ff20527642d2aab01ef5fd24e52b37062a96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.1 Linux/5.15.133.1-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

1 release file

0.1.2

2 release files

0.1.1

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