Skip to main content

Flatfile Fixture generator for OS2mo/LoRa

Project description

RA Fixture Generator

OS2mo/LoRa Flatfile Fixture Generator.

Usage

docker build . -t ra-fixture-generator

Which yields:

...
Successfully built ...
Successfully tagged ra-fixture-generator:latest

After which you can run:

docker run --rm ra-fixture-generator --help

Which yields:

Usage: fixture_generator.py [OPTIONS]

  Flatfile Fixture Generator.

  Used to generate flatfile fixture data (JSON) for OS2mo/LoRa.

Options:
  --name TEXT           Name of the root organization  [required]
  --indent INTEGER      Pass 'indent' to json serializer
  --lora-file FILENAME  Output Lora Flatfile  [required]
  --mo-file FILENAME    Output OS2mo Flatfile  [required]
  --help                Show this message and exit.

At this point two flat files can be generated with:

docker run --rm -v $PWD:/srv/ ra-fixture-generator \
    --name "Aarhus Kommune" --lora-file /srv/lora.json --mo-file /srv/mo.json

At which point two files lora.json and mo.json will be available in the current work-dir. These files can then be uploaded using the ra-flatfile-importer.

For instance using:

docker run -i --rm ra-flatfile-importer lora upload --mox-url http://MOXURL:8080 < lora.json
docker run -i --rm ra-flatfile-importer mo upload --mo-url http://MOURL:5000 < mo.json

Alternatively the two can be combined:

docker run -i --rm ra-fixture-generator \
    --name "Aarhus Kommune" --lora-file - --mo-file /dev/null | \
docker run -i --rm ra-flatfile-importer lora upload --mox-url http://MOXURL:8080

And similarily for MO:

docker run -i --rm ra-fixture-generator \
   --name "Aarhus Kommune" --lora-file /dev/null --mo-file - | \
docker run -i --rm ra-flatfile-importer mo upload --mo-url http://MOURL:5000

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-fixture-generator-0.2.0.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

ra_fixture_generator-0.2.0-py3-none-any.whl (14.7 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