Skip to main content

AI4OS Hub applications metadata utilities

Project description

AI4 Metadata utilities

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.1.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

ai4_metadata-2.1.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ai4_metadata-2.1.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Linux/6.5.0-1025-azure

File hashes

Hashes for ai4_metadata-2.1.0.tar.gz
Algorithm Hash digest
SHA256 ab921b84d5f1185fda4fa218458332e1a66c9e3ce3c8d8fad60728bec4755153
MD5 fff03c6b060463b00790dd1ea55675c5
BLAKE2b-256 17036ccf7e4f186f1c0b79e997a1605ce38cf0683d50e2dab0d74f8d7770ce60

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ai4_metadata-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83f584384367e472738ebed660fa81234c735e647b18972d7e99e4523ff4f670
MD5 2e82b684fb315895474f5d354627f062
BLAKE2b-256 0e9e28fae66d8613f8c4674763b2151a84355ff56edaf043a63c4d1887e0ff5e

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