Skip to main content

AI4OS Hub applications metadata utilities

Project description

AI4 Metadata utilities

GitHub license GitHub release PyPI Python versions

DOI

Metadata utilities for the AI4OS hub data science applications.

The AI4OS hub data science applications use metadata to describe the data sources, models, and other resources. The metadata is used to validate the resources and to provide information to the users.

Installation

The metadata utilities can be installed using pip:

$ pip install ai4-metadata

Usage

The AI4 metadata utilities can be invoked from the command line. The utilities provide commands to validate and migrate the metadata files.

$ ai4-metadata --help

Metadata validation

The metadata utilities provide a command-line interface (CLI) tool ai4-metadata-validate that can be used to validate the metadata files. The CLI tool accepts the metadata files as input parameters.

$ ai4-metadata validate instances/sample-v2.mods.json
╭─ Success ──────────────────────────────────────────────────────────────────╮
│ 'instances/sample-v2.mods.json' is valid for version 2.0.0                 │
╰────────────────────────────────────────────────────────────────────────────╯

Different metadata versions can be specified, either by using the --metadata-version or by providing the metadata schema file. The following two executions are equivalent:

$ ai4-metadata validate --metadata-version 2.0.0 instances/sample-v2.mods.json
╭─ Success ──────────────────────────────────────────────────────────────────╮
│ 'instances/sample-v2.mods.json' is valid for version 2.0.0                 │
╰────────────────────────────────────────────────────────────────────────────╯
$ ai4-metadata validate --schema schemata/ai4-apps-v2.0.0.json instances/sample-v2.mods.json
╭─ Success ──────────────────────────────────────────────────────────────────╮
│ 'instances/sample-v2.mods.json' is valid for version 2.0.0                 │
╰────────────────────────────────────────────────────────────────────────────╯
$ ai4-metadata validate --metadata-version 1.0.0 instances/sample-v2.mods.json
╭─ Error ────────────────────────────────────────────────────────────────────╮
│ Error validating instance 'instances/sample-v2.mods.json': 'date_creation' │
│ is a required property                                                     │
╰────────────────────────────────────────────────────────────────────────────╯

Metadata files can be present in either JSON or YAML format. The metadata utilities will automatically detect the format.

$ ai4-metadata validate instances/sample-v2.mods.yaml
╭─ Success ──────────────────────────────────────────────────────────────────╮
│ 'instances/sample-v2.mods.yaml' is valid for version 2.0.0                 │
╰────────────────────────────────────────────────────────────────────────────╯
$ ai4-metadata validate instances/sample-v2.mods.json
╭─ Success ──────────────────────────────────────────────────────────────────╮
│ 'instances/sample-v2.mods.json' is valid for version 2.0.0                 │
╰────────────────────────────────────────────────────────────────────────────╯

Metadata migration

The metadata utilities provide a command-line interface (CLI) tool ai4-metadata-migrate that can be used to migrate the metadata files from V1 to latest V2. To save the output, use the --output option.

$ ai4-metadata migrate --output sample-v2.mods.json instances/sample-v1.mods.json
╭─ Success ──────────────────────────────────────────────────────────────────╮
│ V1 metadata 'instances/sample-v1.mods.json' migrated to version            │
│ MetadataVersions.V2 and stored in 'sample-v2.mods.json'                    │
╰────────────────────────────────────────────────────────────────────────────╯

Please review the changes, as the metadata migration is not complete, and manual steps are needed.

Acknowledgements

Funded by the European Union

This project has received funding from the European Union’s Horizon Research and Innovation programme under Grant agreement No. 101058593

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

ai4_metadata-2.2.1.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

ai4_metadata-2.2.1-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file ai4_metadata-2.2.1.tar.gz.

File metadata

  • Download URL: ai4_metadata-2.2.1.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for ai4_metadata-2.2.1.tar.gz
Algorithm Hash digest
SHA256 0ee37573fd237c3bd38b585f07bda54c015e17ef5631efa65d6bd5908bf18e4d
MD5 80a4e4d1f9af94742d94cd58766324bd
BLAKE2b-256 3e7bc382c74d8616e90110f2a2510e8280954a37d64e49ce3b53ea4954b4b00d

See more details on using hashes here.

File details

Details for the file ai4_metadata-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: ai4_metadata-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for ai4_metadata-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16809d281fb104321a97a728693598db7df41f09171c70eff69194f5934ed7eb
MD5 e4511c741ab3ce2360ceb36e3c100b9a
BLAKE2b-256 6a7f280b936c27bd81ddad78248a7b6fe8f2d07a9a9876349ab59122a78fc67c

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