Skip to main content

A Python library for working with the pivmeta ontology.

Project description

pivmetalib

Tests DOCS pyvers

A Python library and high-level interface to work with the pivmeta ontology. It allows to describe PIV recordings, software, hardware and other related entities in a state-of-the-art and good scientific practice compliant way.

The library depends on ontolutils, which provides the object-oriented interface to the ontology and the JSON-LD serialization.

Usage

Installation

The package is available on PyPI and can be installed via pip:

pip install pivmetalib

Example of describing a PIV software:

It is very helpful to provide a description of the used PIV software together with the PIV recording. This can be done using the PIVSoftware class from the pivmeta module. The following example shows how to describe the OpenPIV software. Put the resulting JSON-LD to your website, data repository or other places to make your data FAIR. Other users or software can then easily understand and use your data.

from pivmetalib import pivmeta, prov

software = pivmeta.PIVSoftware(
    author=prov.Organization(
        name='OpenPIV',
        url='https://github.com/OpenPIV/openpiv-python',
    ),
    description='OpenPIV is an open source Particle Image Velocimetry analysis software written in Python and Cython',
    software_version="0.26.0a0",
    has_documentation='https://openpiv.readthedocs.io/en/latest/',
)

from pprint import pprint

pprint(software.model_dump(exclude_none=True)

This will result in the following JSON-LD representation:

{
    "@context": {
        "@import": "https://raw.githubusercontent.com/matthiasprobst/pivmeta/main/pivmeta_context.jsonld"
    },
    "@graph": [
        {
            "@id": "https://local-domain.org/9c0696ff-7b0f-43a5-9d36-afca62f0f374",
            "@type": "prov:Organization",
            "foaf:name": "OpenPIV",
            "schema:url": "https://github.com/OpenPIV/openpiv-python"
        },
        {
            "@id": "https://local-domain.org/82675f3e-8887-4a76-a62c-cc1119857735",
            "@type": "Piv Software",
            "schema:author": {
                "@id": "https://local-domain.org/9c0696ff-7b0f-43a5-9d36-afca62f0f374"
            },
            "schema:description": "OpenPIV is an open source Particle Image Velocimetry analysis software written in Python and Cython",
            "schema:softwareVersion": "0.26.0a0",
            "sd:hasDocumentation": "https://openpiv.readthedocs.io/en/latest/"
        }
    ]
}

Documentation and Usage

This library mainly implements the ontology in form of pydantic model classes. The pivmeta ontology uses other ontologies and builds on top of them. Thus, some central classes from ontologies like schema.org, prov, dcat and m4i are implemented, too.

Practical examples on how to use the library can be found in docs-folder ( e.g. Describe a PIV recording).

Contribution

Contributions are welcome. Please open an issue or a pull request.

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

pivmetalib-0.1.0rc8.tar.gz (40.2 kB view details)

Uploaded Source

Built Distribution

pivmetalib-0.1.0rc8-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file pivmetalib-0.1.0rc8.tar.gz.

File metadata

  • Download URL: pivmetalib-0.1.0rc8.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.20

File hashes

Hashes for pivmetalib-0.1.0rc8.tar.gz
Algorithm Hash digest
SHA256 aeef224e1553a06745d9597426f7bb03905f20a01be7f526d231fd53004e27b6
MD5 5d86ed97be02e91f9e8a32fca245d4b0
BLAKE2b-256 adba96d4a99015c151fd1fb275eb57aeeabdc31546946f93d6ed2afb3bc18102

See more details on using hashes here.

File details

Details for the file pivmetalib-0.1.0rc8-py3-none-any.whl.

File metadata

File hashes

Hashes for pivmetalib-0.1.0rc8-py3-none-any.whl
Algorithm Hash digest
SHA256 2b3a431acc639689b033a3b80dcd8c75641ed2eede36dbf2620ac1d4b8c74f33
MD5 a1686b2d034d6d27f299771f0682bb85
BLAKE2b-256 7efdc8a1af64b6833502419d94961b88fcffdaecae7fefedde130e166d8e1909

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