Skip to main content

Python library for interacting with openMINDS metadata schemas

Project description

openMINDS Python

openMINDS Python is a small library that allows you the dynamic usage of openMINDS metadata models and schemas in your Python application for generating your own collection of openMINDS conform metadata representations (instances) as JSON-LDs.

Please note that openMINDS Python only helps you to generate correctly formatted JSON-LD metadata instances - the preparation on how you want to describe your research product with openMINDS is still up to you. If you need support in designing your own openMINDS metadata collection, check out the openMINDS Collab Tutorials which might give you hints on how to tackle your individual case or, of course, get in touch with us directly via our support-email (openminds@ebrains.eu).

Installation

The official versions are available at the Python Package Index and can be installed using pip install in your console:

pip install openMINDS

The latest unstable version is available on this GitHub.

Usage

As stated above, the openMINDS Python allows you the dynamic usage of openMINDS metadata models and schemas in your Python application for generating your own collection of openMINDS conform metadata representations (instances) as JSON-LDs. Here a small example:

import openMINDS
import openMINDS.version_manager

# Initialise the local copy of openMINDS
openMINDS.version_manager.init()

# Select which version of openMINDS to use
openMINDS.version_manager.version_selection('v2.0.0')

# initiate the helper class for the dynamic usage of a specific openMINDS version
helper = openMINDS.Helper()

# initiate the collection into which you will store all metadata instances
mycollection = helper.create_collection()

# create a metadata instance for (e.g.) the openMINDS Person schema
person_open = mycollection.add_core_person(givenName="open")

# add more metadata to a created instance
mycollection.get(person_open).familyName = "MINDS"

# add connections to other metadata instances
email_openminds = mycollection.add_core_contactInformation(email="openminds@ebrains.eu")
mycollection.get(person_open).contactInformation = email_openminds

# save your collection
mycollection.save("./myFirstOpenMINDSMetadataCollection/")

# Getting help for properties
mycollection.help_core_actors_person()

This example generates two linked JSON-LDs, one conform with the openMINDS (v3) Person schema and the other conform with the openMINDS (v3) ContactInformation schema.

To learn in general about the available openMINDS metadata models, schemas and their required or optional metadata properties, check out the openMINDS HTML views which are deployed as GitHub pages on the main openMINDS repository. You can also have a look at the full openMINDS documentation on the EBRAINS Collaboratory.

Within the openMINDS Python you can also get an overview of the requirements of a schema and all its properties by using the 'help_X' function. Here an example:

mycollection.help_core_person()

License

This work is licensed under the MIT License.

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

openMINDS-0.0.9.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

openMINDS-0.0.9-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file openMINDS-0.0.9.tar.gz.

File metadata

  • Download URL: openMINDS-0.0.9.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for openMINDS-0.0.9.tar.gz
Algorithm Hash digest
SHA256 ceb4cdbc31061b0a775596a7e9217b6626e2f175c6158c5b838d222b10034b70
MD5 84c1289ed5b579d92d433e22116292cb
BLAKE2b-256 f5802d037cd64ee584588d8b605bad5228c451e1a6a4d63d5310316a623176f7

See more details on using hashes here.

Provenance

File details

Details for the file openMINDS-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: openMINDS-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for openMINDS-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9d24411d25f31ee1e8ae5379f5be443c00958b99768d01e1a47dd655eee03739
MD5 1d1c863b690831a7b762152e1367281e
BLAKE2b-256 086de4c948079242651b300f655165cab18669f128bd813038b0510ff96ae4a9

See more details on using hashes here.

Provenance

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