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 0.1.0

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 0.1.0
File Size Uploaded
ssb_altinn_form_tools-0.1.0.tar.gz 25.4 kB Details

Built distribution (wheel)

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

Total release size: 56.6 kB

Release files / ssb_altinn_form_tools-0.1.0.tar.gz

Download URL ssb_altinn_form_tools-0.1.0.tar.gz
Size 25.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4e1af23e16cc076c49683153ee3eaebb0fc686fb5deefce11f49452465ada081
BLAKE2b-256 checksum
How to use checksums
04ef935c35977e7da143c00f2fdb014b95ba72c7043bb967a59e18c6e86ce7be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Sep 4, 2026.

Transparency log

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

Download URL ssb_altinn_form_tools-0.1.0-py3-none-any.whl
Size 31.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1250364a261489fd739728a6d0d9e05c607e1a533e6395719874b75b9afcff62
BLAKE2b-256 checksum
How to use checksums
b392d210a0b6c625346b221b77f72ba4670f58b6f85ae5eb447595db2767061b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Sep 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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