Skip to main content

Flatfile importer for OS2mo/LoRa

Project description

RA Flatfile importer

OS2mo/LoRa flatfile importer.

Build

docker build . -t ra-flatfile-importer

Which yields:

...
Successfully built ...
Successfully tagged ra-flatfile-importer:latest

After which you can run:

docker run --rm ra-flatfile-importer

Which yields:

Usage: flatfile_importer.py [OPTIONS] COMMAND [ARGS]...

  Flatfile importer.

    Used to validate and load flatfile data (JSON) into OS2mo/LoRa.

  Options:
    --help  Show this message and exit.

  Commands:
    lora  Lora Flatfile importer.
    mo    OS2mo Flatfile importer.

Usage

The primary usage of the tool is to upload flat-files to LoRa / OS2mo.

docker run --rm ra-flatfile-importer lora upload < lora.json
docker run --rm ra-flatfile-importer mo upload < mo.json

The tool can generate dummy files to test out this functionality:

docker run --rm ra-flatfile-importer lora generate --name "Aarhus Kommune" > lora.json
docker run --rm ra-flatfile-importer mo generate --name "Aarhus Kommune" > mo.json

These test files should be uploadable to Lora/MO and produce a valid MO instance.

The tool has various other commands too, such as producing the validation schema for the flat file format:

docker run --rm ra-flatfile-importer lora schema --indent 4

Which yields:

{
    "title": "LoraFlatFileFormatModel",
    "description": "Flatfile format for LoRa.\n\nMinimal valid example is {}.",
    "type": "object",
    "properties": {
        "facetter": {
           ...
        },
        ...
    }
}

Or for validating whether a file is invalid:

docker run --rm ra-flatfile-importer lora validate < lora.json

Versioning

This project uses Semantic Versioning with the following strategy:

  • MAJOR: Incompatible changes to existing data models
  • MINOR: Backwards compatible updates to existing data models OR new models added
  • PATCH: Backwards compatible bug fixes

License

  • This project: MPL-2.0
  • Dependencies:
    • pydantic: MIT

This project uses REUSE for licensing. All licenses can be found in the LICENSES folder of the project.

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

ra-flatfile-importer-0.1.1.tar.gz (9.6 kB view hashes)

Uploaded Source

Built Distribution

ra_flatfile_importer-0.1.1-py3-none-any.whl (19.0 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