Skip to main content

SSB Tbmd Apis Python

Project description

SSB Tbmd Apis Python

PyPI Status Python Version License

Documentation Tests Coverage Quality Gate Status

pre-commit Black Ruff Poetry

Tjenestebibliotek for metadata

Is an API built on top of Oracle in SSBs ON-prem environment for getting at metadata.
This package is written for extracting the information where possible.

Lenker ssb onprem:

Installation

You can install SSB Tbmd Apis Python via pip from PyPI:

poetry add ssb-tbmd-apis-python

Usage examples

Open a flatfile as a pandas dataframe with only the path to the datafile.

from ssb_tbmd_apis.imports.datadok_open_flatfile import datadok_open_flatfile_from_path

df = datadok_open_flatfile_from_path(
    "/ssb/stam/utdanning/vgogjen/mappe/g2023"
)

Store a json of the "filbeskrivelse" - the metadata to interpret a "fixed-width-file" / "flatfile". This stores the json next to the datafile, with the suffix "__MIGRERDOK.json"

from ssb_tbmd_apis.exports.migrerdok import save_migrerdok_for_flatfile
migrer_path = save_migrerdok_for_flatfile(
    "$DOLLAR/team/archive/folder/g2001", overwrite=True
)

Get metadata from the old "vardok".

from ssb_tbmd_apis.operations.operations_vardok import (
    vardok_concept_variables_by_name_def,
    vardok_concept_variables_by_owner
)

len(vardok_concept_variables_by_owner("360"))

print(vardok_concept_variables_by_owner("360"))

print(vardok_concept_variables_by_name_def("nus2000"))

Please see the Reference Guide for further details.

License

Distributed under the terms of the MIT license, SSB Tbmd Apis Python is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This project was generated from Statistics Norway's SSB PyPI Template.

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_tbmd_apis_python-0.0.2.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ssb_tbmd_apis_python-0.0.2-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file ssb_tbmd_apis_python-0.0.2.tar.gz.

File metadata

  • Download URL: ssb_tbmd_apis_python-0.0.2.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ssb_tbmd_apis_python-0.0.2.tar.gz
Algorithm Hash digest
SHA256 820a040ad22e7757ce3afc187d26d489af837af3025a3de35630f6b5dc95e9c7
MD5 496a3b8f6535740c470bcecaf2085c8d
BLAKE2b-256 c99ab01a6d2d96a174b51d974944d27b4e2c450efa023180beb30235dbd725e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssb_tbmd_apis_python-0.0.2.tar.gz:

Publisher: release.yml on statisticsnorway/ssb-tbmd-apis-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssb_tbmd_apis_python-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ssb_tbmd_apis_python-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 900635ad6de31e90eb3fae39bf77713e5c429ccb96ddb210a26f65460383fd8e
MD5 2f8b96ed51d2b453df4727fab8b5cbe8
BLAKE2b-256 c3e053527adadf9d1353f0687427af426632c9ba30e984a85cc8dfd612d473a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssb_tbmd_apis_python-0.0.2-py3-none-any.whl:

Publisher: release.yml on statisticsnorway/ssb-tbmd-apis-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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