Skip to main content

Flatfile importer for OS2mo

Project description

RA Flatfile importer

Usage

The primary usage of this tool is to validate and load flatfile data (JSON) into OS2mo, for example fixtures generated using ra-flatfile-importer.

Usage: python -m ra_flatfile_importer [OPTIONS] COMMAND [ARGS]...

  OS2mo Flatfile importer.

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

Options:
  --help  Show this message and exit.

Commands:
  schema    Generate JSON schema for valid files.
  upload    Validate the provided JSON file and upload its contents.
  validate  Validate the provided JSON file.

On a development machine with the OS2mo stack running, the following will upload a previously-generated flatfile:

python -m ra_flatfile_importer upload \
  --mo-url=http://localhost:5000 \
  --client-secret=603f1c82-d012-4d04-9382-dbe659c533fb \
  --auth-server=http://localhost:8081/auth \
  --json-file=mo.json

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

python -m ra_flatfile_importer schema --indent=4

Which yields:

{
    "title": "MOFlatFileFormatImport",
    "description": "Flatfile format for OS2mo.\n\nEach chunk in the list is send as bulk / in parallel, and as such 
                    entries\nwithin a single chunk should not depend on other entries within the same chunk.\n\nMinimal 
                    valid example is [].",
    "type": "object",
    "properties": {
        "chunks": {
            ...
        },
        ...
    }
}

Or for validating whether a file is invalid:

python -m ra_flatfile_importer validate < mo.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-2.0.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

ra_flatfile_importer-2.0.1-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ra-flatfile-importer-2.0.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.10 Linux/5.4.0-1062-gcp

File hashes

Hashes for ra-flatfile-importer-2.0.1.tar.gz
Algorithm Hash digest
SHA256 5cbe59819a4315ecc02a01536246afbea1d4e71f1379037a1c62d1233c561eae
MD5 79f2b8daafc8b5c16ffce46f1eef317b
BLAKE2b-256 37a028af9a71d616ec3a3470b67e8a47111ca1e26f908da96e1e5cf7fb67180e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ra_flatfile_importer-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e68f40875bbdccc57b325dc04f13dc9aa9e1ad89507a60e93f5555a1bd99d088
MD5 44d2015b80a12c34b8f45af758435f53
BLAKE2b-256 f95d7a6db49c42d39aeb85aea319007a529f7748e3269586383a6427c779c4b0

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