Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

storebrand/tap-ssb-klass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ This repository is no longer being maintained

Storebrand have moved on from Meltano, and we're therefore no longer maintaining this repository.

tap-klass

tap-klass is a Singer tap for Statistics Norway's Klass API for codes and classifications: https://www.ssb.no/en/klass/

Built with the Meltano Tap SDK for Singer Taps.

Installation

Install from GitHub:

pipx install git+https://github.com/radbrt/tap-klass.git

Configuration

Accepted Config Options

Capabilities

  • catalog
  • state
  • discover
  • about
  • stream-maps
  • schema-flattening

Settings

Setting Required Default Description
classifications False None List of classifications with options
correspondences False None List of correspondences with options
stream_maps False None Config object for stream maps capability. For more information check out Stream Maps.
stream_map_config False None User-defined config values to be used within map expressions.
flattening_enabled False None 'True' to enable schema flattening and automatically expand nested properties.
flattening_max_depth False None The max depth to flatten schemas.
Classifications

The classifications setting list items contains the following elements:

Setting Required Default Description
name True None User-defined name of the classification
id True None The classification ID, found in the URL. ex "131" for municipalities
valid_at False None Date string for retreiving codes valid at given date
valid_from False None Date string for retrieving codes valid on or after given date
valid_to False 2099-12-31 Date string for retrieving codes valid on or before given date
language False nb The language to be returned. Either nb (Norwegian Bokmål), nn (Norwegian Nynorsk) or en (English)

Either valid_at or valid_to must be specified. If valid_at is specified, valid_to will be ignored.

Correspondences

The correspondences setting list items contains the following elements:

Setting Required Default Description
name True None User-defined name of the classification
source_id True None The source classification ID, found in the URL. ex "131" for municipalities
target_id True None The target classification ID, found in the URL. ex "103" for sub-municipalities
valid_from True None Date string for retrieving codes valid on or after given date
valid_to False 2099-12-31 Date string for retrieving codes valid on or before given date
language False nb The language to be returned. Either nb (Norwegian Bokmål), nn (Norwegian Nynorsk) or en (English)

A full list of supported settings and capabilities is available by running: tap-klass --about

Supported Python Versions

  • 3.8
  • 3.9
  • 3.10
  • 3.11

A full list of supported settings and capabilities for this tap is available by running:

tap-klass --about

Configure using environment variables

This Singer tap will automatically import any environment variables within the working directory's .env if the --config=ENV is provided, such that config values will be considered if a matching environment variable is set either in the terminal context or in the .env file.

Source Authentication and Authorization

This API does not require authentication.

Usage

You can easily run tap-klass by itself or in a pipeline using Meltano.

Executing the Tap Directly

tap-klass --version
tap-klass --help
tap-klass --config CONFIG --discover > ./catalog.json

Developer Resources

Follow these instructions to contribute to this project.

Initialize your Development Environment

pipx install poetry
poetry install

Create and Run Tests

Create tests within the tests subfolder and then run:

poetry run pytest

You can also test the tap-klass CLI interface directly using poetry run:

poetry run tap-klass --help

Testing with Meltano

Note: This tap will work in any Singer environment and does not require Meltano. Examples here are for convenience and to streamline end-to-end orchestration scenarios.

Next, install Meltano (if you haven't already) and any needed plugins:

# Install meltano
pipx install meltano
# Initialize meltano within this directory
cd tap-klass
meltano install

Now you can test and orchestrate using Meltano:

# Test invocation:
meltano invoke tap-klass --version
# OR run a test `elt` pipeline:
meltano elt tap-klass target-jsonl

SDK Dev Guide

See the dev guide for more instructions on how to use the SDK to develop your own taps and targets.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages