Skip to main content

A Python package built on top of KLASS's API for retrieving classifications, codes, correspondances etc.

Project description

ssb-klass-python

A Python package built on top of Statistics Norway's code- and classification-system "KLASS".
The package aims to make Klass's API for retrieving data easier to use by re-representing Klass's internal hierarchy as python-classes. Containing methods for easier traversal down, search classes and widgets, reasonable defaults to parameters etc. Where data is possible to fit into pandas DataFrames, this will be preferred, but hirerachical data will be kept as json / dict structure.

Example usages

from klass import search_classification
# Opens a ipywidget in notebooks for searching for classifications and copying code, to get started
search_classification(no_dupes=True)
from klass import get_classification # Import the utility-function
nus = get_classification(36)
# Does the same as the code above, but does not shy away from using the class directly
from klass import KlassClassification # Import the class for KlassClassifications
nus = KlassClassification(36)  # Use ID for classification
codes = nus.get_codes() # codes from current date
print(codes)
codes.data  # Pandas dataframe available under the .data attribute

Technical notes

Documentation for the endpoints we are using can be found on Statistics Norways pages.

Technical architecture of the API we are interacting with is detailed in Statistics Norway's internal wiki.


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_klass_python-0.0.3.tar.gz (11.2 kB view hashes)

Uploaded Source

Built Distribution

ssb_klass_python-0.0.3-py3-none-any.whl (15.7 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