openMINDS


NameopenMINDS JSON
Version 0.2.2 PyPI version JSON
download
home_pageNone
SummaryPython library for interacting with openMINDS metadata schemas
upload_time2024-03-29 15:35:24
maintainerNone
docs_urlNone
authorLouisa Köhnen
requires_python>=3.8
licenseMIT
keywords openminds open metadata initiative metadata
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # openMINDS Python library

openMINDS Python is a small library to support the creation and use of openMINDS metadata models and schemas in your Python application, with import and export in JSON-LD format.

## Installation

```
pip install openMINDS
```

## Usage

``` python
from datetime import date
from openminds import Collection, IRI
import openminds.latest.core as omcore

# Create an empty metadata collection

collection = Collection()

# Create some metadata

mgm = omcore.Organization(
    full_name="Metro-Goldwyn-Mayer Studios, Inc.",
    short_name="MGM",
    homepage=IRI("https://www.mgm.com")
)

stan = omcore.Person(
    given_name="Stan",
    family_name="Laurel",
    affiliations=omcore.Affiliation(member_of=mgm, start_date=date(1942, 1, 1))
)

ollie = omcore.Person(
    given_name="Oliver",
    family_name="Hardy",
    affiliations=omcore.Affiliation(member_of=mgm, start_date=date(1942, 1, 1))
)

# Add the metadata to the collection

collection.add(stan, ollie, mgm)

# Check the metadata are valid

failures = collection.validate()

# Save the collection in a single JSON-LD file

collection.save("my_collection.jsonld")

# Save each node in the collection to a separate file

collection.save("my_collection", individual_files=True)  # creates files within the 'my_collection' directory

# Load a collection from file
new_collection = Collection()
new_collection.load("my_collection.jsonld")
```

## License

This work is licensed under the MIT License.

## Getting help

In case of questions about **openMINDS**, please contact us at support@openmetadatainitiative.org.
If you find a bug in the Python library or would like to suggest an enhancement or new feature,
please open a ticket in the [openMINDS Python library issue tracker](https://github.com/openMetadataInitiative/openMINDS_Python/issues).

If you identify a problem or would like to suggest changes to the openMINDS specification itself,
please open a ticket in the [openMINDS issue tracker](https://github.com/openMetadataInitiative/openMINDS/issues).

## Development

Contributions are welcome, please see our [contribution guidelines](https://openminds-documentation.readthedocs.io/en/latest/shared/contribution_guidelines.html).

This repository has two main branches: `pipeline` and `main`.
The `pipeline` contains the code for building the Python package from the openMINDS schemas.
The build process is triggered by changes to the schemas, and runs as a GitHub action.
The resultant package is copied to the `main` branch, and at intervals is published on PyPI.

## Acknowledgements

<div><img src="https://www.braincouncil.eu/wp-content/uploads/2018/11/wsi-imageoptim-EU-Logo.jpg" alt="EU Logo" height="23%" width="15%" align="right" style="margin-left: 10px"></div>

This open source software code was developed in part or in whole in the Human Brain Project, funded from the European Union's Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreements No. 720270, No. 785907 and No. 945539 (Human Brain Project SGA1, SGA2 and SGA3).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "openMINDS",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "openMINDS, Open Metadata Initiative, metadata",
    "author": "Louisa K\u00f6hnen",
    "author_email": "\"Andrew P. Davison\" <andrew.davison@cnrs.fr>, Lyuba Zehl <l.zehl@fz-juelich.de>",
    "download_url": "https://files.pythonhosted.org/packages/a7/dc/9da3aeba9f4b4b516675270f47ba7abae0370fd83562d3f071996e575d7f/openMINDS-0.2.2.tar.gz",
    "platform": null,
    "description": "# openMINDS Python library\n\nopenMINDS Python is a small library to support the creation and use of openMINDS metadata models and schemas in your Python application, with import and export in JSON-LD format.\n\n## Installation\n\n```\npip install openMINDS\n```\n\n## Usage\n\n``` python\nfrom datetime import date\nfrom openminds import Collection, IRI\nimport openminds.latest.core as omcore\n\n# Create an empty metadata collection\n\ncollection = Collection()\n\n# Create some metadata\n\nmgm = omcore.Organization(\n    full_name=\"Metro-Goldwyn-Mayer Studios, Inc.\",\n    short_name=\"MGM\",\n    homepage=IRI(\"https://www.mgm.com\")\n)\n\nstan = omcore.Person(\n    given_name=\"Stan\",\n    family_name=\"Laurel\",\n    affiliations=omcore.Affiliation(member_of=mgm, start_date=date(1942, 1, 1))\n)\n\nollie = omcore.Person(\n    given_name=\"Oliver\",\n    family_name=\"Hardy\",\n    affiliations=omcore.Affiliation(member_of=mgm, start_date=date(1942, 1, 1))\n)\n\n# Add the metadata to the collection\n\ncollection.add(stan, ollie, mgm)\n\n# Check the metadata are valid\n\nfailures = collection.validate()\n\n# Save the collection in a single JSON-LD file\n\ncollection.save(\"my_collection.jsonld\")\n\n# Save each node in the collection to a separate file\n\ncollection.save(\"my_collection\", individual_files=True)  # creates files within the 'my_collection' directory\n\n# Load a collection from file\nnew_collection = Collection()\nnew_collection.load(\"my_collection.jsonld\")\n```\n\n## License\n\nThis work is licensed under the MIT License.\n\n## Getting help\n\nIn case of questions about **openMINDS**, please contact us at support@openmetadatainitiative.org.\nIf you find a bug in the Python library or would like to suggest an enhancement or new feature,\nplease open a ticket in the [openMINDS Python library issue tracker](https://github.com/openMetadataInitiative/openMINDS_Python/issues).\n\nIf you identify a problem or would like to suggest changes to the openMINDS specification itself,\nplease open a ticket in the [openMINDS issue tracker](https://github.com/openMetadataInitiative/openMINDS/issues).\n\n## Development\n\nContributions are welcome, please see our [contribution guidelines](https://openminds-documentation.readthedocs.io/en/latest/shared/contribution_guidelines.html).\n\nThis repository has two main branches: `pipeline` and `main`.\nThe `pipeline` contains the code for building the Python package from the openMINDS schemas.\nThe build process is triggered by changes to the schemas, and runs as a GitHub action.\nThe resultant package is copied to the `main` branch, and at intervals is published on PyPI.\n\n## Acknowledgements\n\n<div><img src=\"https://www.braincouncil.eu/wp-content/uploads/2018/11/wsi-imageoptim-EU-Logo.jpg\" alt=\"EU Logo\" height=\"23%\" width=\"15%\" align=\"right\" style=\"margin-left: 10px\"></div>\n\nThis open source software code was developed in part or in whole in the Human Brain Project, funded from the European Union's Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreements No. 720270, No. 785907 and No. 945539 (Human Brain Project SGA1, SGA2 and SGA3).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python library for interacting with openMINDS metadata schemas",
    "version": "0.2.2",
    "project_urls": {
        "Homepage": "https://github.com/openMetadataInitiative/openMINDS_Python"
    },
    "split_keywords": [
        "openminds",
        " open metadata initiative",
        " metadata"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "05311732adce14cbdae19b159451b0d9af4c28ec7d6cfb03f811b9bbd093ad31",
                "md5": "c3eb7f4145973925e060e66e2533a81b",
                "sha256": "ab10c626db2c6fb84c8d71547c4e234af8d8f8b2d2768460e5ee7ed040b33973"
            },
            "downloads": -1,
            "filename": "openMINDS-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c3eb7f4145973925e060e66e2533a81b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 1462965,
            "upload_time": "2024-03-29T15:35:21",
            "upload_time_iso_8601": "2024-03-29T15:35:21.827466Z",
            "url": "https://files.pythonhosted.org/packages/05/31/1732adce14cbdae19b159451b0d9af4c28ec7d6cfb03f811b9bbd093ad31/openMINDS-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7dc9da3aeba9f4b4b516675270f47ba7abae0370fd83562d3f071996e575d7f",
                "md5": "e9302cf469a488ec8f08fb7e20a72781",
                "sha256": "f48fd97adcff3ab5c812380858ec6779c02ed3c3fdd6a930d32e8b3bc0595288"
            },
            "downloads": -1,
            "filename": "openMINDS-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e9302cf469a488ec8f08fb7e20a72781",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 824889,
            "upload_time": "2024-03-29T15:35:24",
            "upload_time_iso_8601": "2024-03-29T15:35:24.022273Z",
            "url": "https://files.pythonhosted.org/packages/a7/dc/9da3aeba9f4b4b516675270f47ba7abae0370fd83562d3f071996e575d7f/openMINDS-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-29 15:35:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "openMetadataInitiative",
    "github_project": "openMINDS_Python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "openminds"
}
        
Elapsed time: 0.21289s