Client for the SSB datahub platform
Project description
Getting started
Prerequisites
Development environment
-
Clone the repository
-
Install the poetry environment
poetry install
Usage
pip install ssb-datahub
from ssb_datahub import Client
dh = Client()
# Collect variables
kjonn = dh.get_variable("FREG", "BEFOLKNING_KJONN", "1.0.0")
fornavn = dh.get_variable("FREG", "BEFOLKNING_FORNAVN", "1.0.0")
fodt_aar = dh.get_variable("FREG", "BEFOLKNING_FODT_AAR", "1.0.0")
# Get the most popular names of men born in 1993
navnestatistikken_menn = (
kjonn
.left_join(fornavn, "IDENTIFIER")
.filter("BEFOLKNING_KJONN", "1")
.left_join(fodt_aar, "IDENTIFIER")
.filter("BEFOLKNING_FODT_AAR", 1993)
.count_values("BEFOLKNING_FORNAVN")
.sort("BEFOLKNING_FORNAVN")
)
navnestatistikken_menn.sources
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
ssb_datahub-0.1.2.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for ssb_datahub-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7547d605499f7cdb4db6acaccdddd0fce7c6969b01c80b2e63dfd6b641232903 |
|
MD5 | addf99402b897ad4faee9b3a6477c7d9 |
|
BLAKE2b-256 | f7444d0f2133166c29e85b3e6ab07bc74b7645e28f9ed74c4c6c2c46873f6f62 |