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 commandline interface
  • MINOR: Backwards compatible updates to commandline interface
  • PATCH: Backwards compatible bug fixes

The fileformat is versioned directly, and the version is exported in the file itself.

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.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

ra_flatfile_importer-0.1.2-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file ra-flatfile-importer-0.1.2.tar.gz.

File metadata

  • Download URL: ra-flatfile-importer-0.1.2.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.8.12 Linux/5.4.0-1049-gcp

File hashes

Hashes for ra-flatfile-importer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 567d1c77d08ad3dcc877345b5a7860dd79977b9487d81c9a6d0e330c51881f26
MD5 572c7ba603859ee0aea9b78e2a5d2727
BLAKE2b-256 b8fcc8511729568b011e0a7abdd907f76e3baf95aef56b4694cb19e4d1a615c2

See more details on using hashes here.

File details

Details for the file ra_flatfile_importer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ra_flatfile_importer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 42df0c8806ad5db57e18e405f51038a1007cf1a819fc6ed1fcb1cb055ddae746
MD5 4a2bc6fa5a7e1de41a0316f4f91ed5a4
BLAKE2b-256 91a550aad7109e79eb7f7e118b3074a6b3066dd598746d9f899c80a779e79013

See more details on using hashes here.

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