{"id":21721365,"url":"https://github.com/informaticsmatters/squonk2-data-manager-job-decoder","last_synced_at":"2025-04-23T23:09:26.685Z","repository":{"id":37495356,"uuid":"446790367","full_name":"InformaticsMatters/squonk2-data-manager-job-decoder","owner":"InformaticsMatters","description":"Provides decoding capabilities for Job definitions","archived":false,"fork":false,"pushed_at":"2025-03-14T18:08:39.000Z","size":86,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-23T23:08:45.718Z","etag":null,"topics":["squonk2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InformaticsMatters.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-01-11T11:17:18.000Z","updated_at":"2025-03-14T18:08:43.000Z","dependencies_parsed_at":"2024-04-10T11:31:07.395Z","dependency_job_id":"4dba3846-7560-4415-bc83-9ba8f8a5862e","html_url":"https://github.com/InformaticsMatters/squonk2-data-manager-job-decoder","commit_stats":{"total_commits":66,"total_committers":1,"mean_commits":66.0,"dds":0.0,"last_synced_commit":"1e0731f0f4b6a2fa13688fcb2189441d753c3671"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fsquonk2-data-manager-job-decoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fsquonk2-data-manager-job-decoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fsquonk2-data-manager-job-decoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fsquonk2-data-manager-job-decoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InformaticsMatters","download_url":"https://codeload.github.com/InformaticsMatters/squonk2-data-manager-job-decoder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250528728,"owners_count":21445516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["squonk2"],"created_at":"2024-11-26T02:16:03.478Z","updated_at":"2025-04-23T23:09:26.671Z","avatar_url":"https://github.com/InformaticsMatters.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Informatics Matters Data Manager Job Decoder\n============================================\n\n.. image:: https://badge.fury.io/py/im-data-manager-job-decoder.svg\n   :target: https://badge.fury.io/py/im-data-manager-job-decoder\n   :alt: PyPI package (latest)\n\n.. image:: https://github.com/InformaticsMatters/squonk2-data-manager-job-decoder/actions/workflows/build.yaml/badge.svg\n   :target: https://github.com/InformaticsMatters/squonk2-data-manager-job-decoder/actions/workflows/build.yaml\n   :alt: Build\n\n.. image:: https://github.com/InformaticsMatters/squonk2-data-manager-job-decoder/actions/workflows/publish.yaml/badge.svg\n   :target: https://github.com/InformaticsMatters/squonk2-data-manager-job-decoder/actions/workflows/publish.yaml\n   :alt: Publish\n\nA package that simplifies the decoding of encoded text strings.\nGiven an encoded string the ``decode()`` method\nreturns the decoded value or an error.\n\nFor example, given the following `jinja2`_ encoded string\n``'{{ foo }}, bar={{ bar }}, baz={{ baz }}'`` and variable map\n``{'foo': 1, 'bar': 2, 'baz': 3}`` the decoder returns\nthe string ``'foo=1, bar=2, baz=3'``.\n\nThe following encoding/decoding formats are supported: -\n\n- jinja2 (3.0)\n\nThe package also provides ``validate_job_schema()`` and\n``validate_manifest_schema()`` functions, which can (should) be used to\nvalidate the Manifests and Job definitions against the\nbuilt-in schemas.\n\n.. _jinja2: https://jinja.palletsprojects.com/en/3.0.x/\n\nInstallation (Python)\n=====================\n\nThe Job decoder is published on `PyPI`_ and can be installed from\nthere::\n\n    pip install im-data-manager-job-decoder\n\nOnce installed you can validate the definition (expected to be a dictionary\nformed from the definition YAML file) with::\n\n    \u003e\u003e\u003e from decoder import decoder\n    \u003e\u003e\u003e error: Optional[str] = decoder.validate_manifest_schema(manifest)\n    \u003e\u003e\u003e error: Optional[str] = decoder.validate_job_schema(job_definition)\n\nAnd you can decode encoded fields within the job definition.\nHere we're decoding the job's 'command' using a map of variables and their\nvalues::\n\n    \u003e\u003e\u003e decoded, success = decoder.decode(definition['command'],\n                                          variables,\n                                          'command',\n                                          decoder.TextEncoding.JINJA2_3_0)\n\nA method also exists to generate a Data Manger Job documentation URL\nfor the supported repository types. For example, to get the\nauto-generated documentation URL for a job definition hosted in a GitHub\nrepository you can do this::\n\n    \u003e\u003e\u003e doc_url: str = decoder.get_job_doc_url(\"github\",\n                                               collection\n                                               job_id,\n                                               job_definition,\n                                               manifest_url)\n\nWe support ``github`` and ``gitlab`` as repository types.\n\n.. _PyPI: https://pypi.org/project/im-data-manager-job-decoder\n\nGet in touch\n============\n\n- Report bugs, suggest features or view the source code `on GitHub`_.\n\n.. _on GitHub: https://github.com/informaticsmatters/squonk2-data-manager-job-decoder\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finformaticsmatters%2Fsquonk2-data-manager-job-decoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finformaticsmatters%2Fsquonk2-data-manager-job-decoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finformaticsmatters%2Fsquonk2-data-manager-job-decoder/lists"}