Skip to main content

SSB Altinn Form Tools

PyPI Status Python Version License

Documentation Tests Coverage Quality Gate Status

pre-commit Black Ruff Poetry

Features

  • Tools for automatically handling forms from Altinn3
    • Transforms the data to the standard schema for SSBs editing framework
    • Ingests the data using SQLAlchemy og Parquedit.

Requirements

  • TODO

Installation

You can install SSB Altinn Form Tools via pip from PyPI:

pip install ssb-altinn-form-tools

Example

See docs/documentation for further information. Walkthrough provides a deeper guide through the example and how everything works.

import logging

logging.basicConfig(
    level=logging.DEBUG,  # Set minimum log level
    format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
    force=True,
)

from sqlalchemy import create_engine
from ssb_altinn_form_tools.default_form_processor import DefaultFormProcessor
from ssb_altinn_form_tools.default_form_extractor import DefaultFormExtractor
from ssb_altinn_form_tools.sqlalchemy_storage_connector import (
    SqlAlchemyStorageConnector,
)

extractor = DefaultFormExtractor()

engine = engine = create_engine("sqlite:///./db.db", echo=False)
connector = SqlAlchemyStorageConnector(engine)
for form_number in ["RA0187", "RA0297", "RA0307", "RA0366", "RA0479", "RA0481", "RA0530", "RA0536", "RA0689", "RA0745", "RA0825"]:
    processor = DefaultFormProcessor(
        form_name=form_number,
        form_base_path=f"/home/onyxia/work/ssb-altinn-form-tools/tests/testdata/{form_number}",
        extractor=extractor,
        connector=connector,
        alias_mapping={"omsVirksomhetPerioden": "omsetning"},
    )
    processor.process_new_forms()

from sqlalchemy import text

with engine.connect() as conn:
    tables = conn.execute(text("SELECT name FROM sqlite_master WHERE type='table';")).fetchall()
    print("Tables:", tables)

with engine.connect() as conn:
    rows = conn.execute(text("SELECT * FROM enheter LIMIT 10;")).mappings().all()
    for row in rows:
        print(dict(row))

Usage

Please see the Reference Guide for details.

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the MIT license, SSB Altinn Form Tools 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.

Metadata

Release files for ssb-altinn-form-tools 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ssb-altinn-form-tools 1.0.1
File Size Uploaded Provenance Actions
ssb_altinn_form_tools-1.0.1.tar.gz 25.8 kB With provenance Details for ssb_altinn_form_tools-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ssb-altinn-form-tools 1.0.1
File Interpreter ABI Platform Actions
ssb_altinn_form_tools-1.0.1-py3-none-any.whl Python 3 none any Details for ssb_altinn_form_tools-1.0.1-py3-none-any.whl

Total release size: 57.1 kB

Release files / ssb_altinn_form_tools-1.0.1.tar.gz

Download URL ssb_altinn_form_tools-1.0.1.tar.gz
Size 25.8 kB
Tags Source
SHA-256 checksum
How to use checksums
68d81d3b5d5b74ab4b4a41cd04a8a84b5297abd4961b692a4e8719f445b101e3
BLAKE2b-256 checksum
How to use checksums
44f8519a095da73da9edf981b0a1122f04533a01b905cffae4b5061e7b648f0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / ssb_altinn_form_tools-1.0.1-py3-none-any.whl

Download URL ssb_altinn_form_tools-1.0.1-py3-none-any.whl
Size 31.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ac33136f025df64c86b03f42ea8c4cac9dde3da06443884fd6c3c2e4b8c7be2
BLAKE2b-256 checksum
How to use checksums
a769c555eb7c318ca804acd70757715a9cfb748eb6704be48227819b95d79637
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for ssb-altinn-form-tools 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ssb_altinn_form_tools-1.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page