Skip to main content

Informatics Matters Data Manager Job Decoder

PyPI package (latest) Build Publish

A package that simplifies the decoding of encoded text strings and validation of Job Definitions and Manifests.

Given an encoded string the decode() method returns the decoded value or an error.

For example, given the following jinja2 encoded string '{{ foo }}, bar={{ bar }}, baz={{ baz }}' and variable map {'foo': 1, 'bar': 2, 'baz': 3} the decoder returns the string 'foo=1, bar=2, baz=3'.

The following encoding/decoding formats are supported: -

  • jinja2 (3.0)

The package also provides validate_job_schema() and validate_manifest_schema() functions, which can (should) be used to validate the Manifests and Job definitions against the built-in schemas.

If you have a Job Definition or Manifest file you can add a reference to the corresponding schema in this package to your file to help you identify schema violations prior to deployment. To do this you just need to add a line starting # yaml-language-server: at the top of your file. For example, you can link to the v2.3.0 Job Definition schema by adding the following line:

# yaml-language-server: $schema=https://raw.githubusercontent.com/InformaticsMatters/squonk2-data-manager-job-decoder/refs/tags/2.3.0/decoder/job-definition-schema.yaml

Installation (Python)

The Job decoder is published on PyPI and can be installed from there:

pip install im-data-manager-job-decoder

Once installed you can validate the definition (expected to be a dictionary formed from the definition YAML file) with:

>>> from decoder import decoder
>>> error: Optional[str] = decoder.validate_manifest_schema(manifest)
>>> error: Optional[str] = decoder.validate_job_schema(job_definition)

And you can decode encoded fields within the job definition. Here we’re decoding the job’s ‘command’ using a map of variables and their values:

>>> decoded, success = decoder.decode(definition['command'],
                                      variables,
                                      'command',
                                      decoder.TextEncoding.JINJA2_3_0)

A method also exists to generate a Data Manger Job documentation URL for the supported repository types. For example, to get the auto-generated documentation URL for a job definition hosted in a GitHub repository you can do this:

>>> doc_url: str = decoder.get_job_doc_url("github",
                                           collection
                                           job_id,
                                           job_definition,
                                           manifest_url)

We support github and gitlab as repository types.

Get in touch

  • Report bugs, suggest features or view the source code on GitHub.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

im_data_manager_job_decoder-2.8.0.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

im_data_manager_job_decoder-2.8.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file im_data_manager_job_decoder-2.8.0.tar.gz.

File metadata

File hashes

Hashes for im_data_manager_job_decoder-2.8.0.tar.gz
Algorithm Hash digest
SHA256 82bbc1aaed140b9e3e96e8cbd9f7a277456500c399a0d866d6864432b74afdbe
MD5 3dfabdfdf0a9dfa154daa697aaaad2ee
BLAKE2b-256 df3b6bb69d8ce5cddadee6323943d19732a1880a6744ec2ac8d59d74423bd7de

See more details on using hashes here.

Provenance

The following attestation bundles were made for im_data_manager_job_decoder-2.8.0.tar.gz:

Publisher: publish.yaml on InformaticsMatters/squonk2-data-manager-job-decoder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file im_data_manager_job_decoder-2.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for im_data_manager_job_decoder-2.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4157e49f01694849f6cfc14ba0e53f7edea254cd816bd8f33966f7ab75bc8607
MD5 53fd19a5b7d0792d894894574987003f
BLAKE2b-256 5f0cc3f6e30ea576d6410aa9fbffe71429b1574d6bfb003d8e98d24ffc7a5769

See more details on using hashes here.

Provenance

The following attestation bundles were made for im_data_manager_job_decoder-2.8.0-py3-none-any.whl:

Publisher: publish.yaml on InformaticsMatters/squonk2-data-manager-job-decoder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.8.0 This release

2 files

2.7.0

2 files

2.6.1

2 files

2.6.0

2 files

2.5.0

2 files

2.4.0

2 files

2.3.0

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.17.2

2 files

1.17.1

2 files

1.17.0

2 files

1.16.0

2 files

1.15.2

2 files

1.15.1

2 files

1.15.0

2 files

1.14.0

2 files

1.13.0

2 files

1.12.3

2 files

1.12.2

2 files

1.12.1

2 files

1.12.0

2 files

1.11.6

2 files

1.11.5

2 files

1.11.4

2 files

1.11.3

2 files

1.11.2

2 files

1.11.1

2 files

1.11.0

2 files

1.10.3

2 files

1.10.2

2 files

1.10.1

2 files

1.10.0

2 files

1.9.0

2 files

1.8.1

2 files

1.8.0

2 files

1.7.0

2 files

1.6.4

1 file

1.6.3

1 file

1.6.2

1 file

1.6.1

1 file

1.6.0

1 file

1.5.1

1 file

1.5.0

1 file

1.4.1

1 file

1.4.0

1 file

1.3.0

1 file

1.2.0

1 file

1.1.2

1 file

1.1.1

1 file

1.1.0

1 file

1.0.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page