Skip to main content

Python API for interacting with openMINDS metadata schemas

Project description

This Python API helps you to interact with the EBRAINS openMINDS metadata models and schemas. It consists of two sub-modules:

The openMINDS.generator (coming soon) facilitates the translation of the openMINDS schema template syntax to other established formats, such as HTML and JSON-Schema.

The openMINDS.compiler 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.

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 version is available on GitHub.

Documentation

Please find in the following a basic documenation on how to use the two submodules (openMINDS.generator and openMINDS.compiler) of the openMINDS Python API. A full documentation can be found on the EBRAINS Collaboratory (coming soon).

openMINDS.compiler

As stated above, the openMINDS.compiler 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.compiler

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

# 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
lyuba = mycollection.add_core_person(givenName="Lyuba")

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

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

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

To learn in general about the available openMINDS metadata models, schemas and their required or optional metadata properties, please go the main openMINDS GitHub repository, or the full documentation on the EBRAINS Collaboratory (coming soon).

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

mycollection.help_core_person()

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

Uploaded Source

Built Distribution

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

openMINDS-0.0.3-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openMINDS-0.0.3.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.7

File hashes

Hashes for openMINDS-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1b1031248015fd4e59653b09c0d29ca75be17dcd83c07de8248fcd9134ce95b1
MD5 c9ed1db8b78121b447f3661c5432261b
BLAKE2b-256 de52e2106020af39b0b28760349d01b6482c4ce236b83dbc687baaa09060f56e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openMINDS-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.7

File hashes

Hashes for openMINDS-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1fea037ce0ca3a0eef4736e9074ba3223a9fca4971e1db776dc37ffd0b8f46ac
MD5 73f7f5e3f30dd0df4d2e42f2ecd06a77
BLAKE2b-256 c3ac386eaed96646727122e7bb29476982f0025dc98ce066e5d740a8229931ee

See more details on using hashes here.

Supported by

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