Skip to main content

Client for the SSB datahub platform

Project description


Logo

DATAHUB PYTHON CLIENT


Poetry Black PyPI Python Version License

Client library for DataHub, a data platform developed at Statistics Norway


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


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.3.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

ssb_datahub-0.1.3-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

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