Skip to main content

A client library for interfacing with a Provena instance.

Project description

Provena Python Client

Welcome to the Provena Python Client repository! This client library is a programmatic interface designed to interact seamlessly with your Provena instance. The client uses the same Pydantic models as the Provena API, ensuring a one-to-one typed interface with the API. This means that the models used in the client library directly correspond to those used by the API, providing consistency and ease of use. It allows you to replicate most functionalities of the Provena Web app through Python code, including fetching or minting datasets, creating items within the registry, and launching provenance workflows. With the Provena Python Client, you can achieve comprehensive interactions with only a few lines of code.

Getting Started

To install the Provena Python Client, simply use pip:

pip install provenaclient

Once you have successfully installed provenaclient, refer to the following notebook for examples on how to use the client. Example Notebook here at: Example Notebook.

To find more examples on how to use the client, refer to these collection of notebooks: Provena Notebook Repository

Testing

If you are interested in running any tests, please make sure to first clone this repository and then follow the below steps:

Unit Tests

The Provena Python Client includes unit tests that check functionality using real server interactions and mocked components using httpx_mock. Tests cover HTTP methods, error handling, and JSON parsing.

To run unit tests:

  1. Install dependencies from pyproject.toml.
  2. Run pytest test_unit.py in the test directory.

Integration Tests

The Provena Python Client includes integration tests that validate and assess the functioning of the client library and its interaction with Provena API's, focusing on dataset operations, entity searching, item fetching, and provenance lifecycle.

To run integration tests:

  1. Install dependencies from pyproject.toml.
  2. Set up necessary credentials in .env (contact Provena Development Team for setup).
  3. Run pytest test_integration.py in the test directory.

For detailed testing procedures, see the Testing Guide.

Documentation:

Find Provena Python Client documentation and API Reference at: (Provena Client Documentation)

Pydantic V2 Compatility

Due to delays in migration from Pydantic v1 to v2 in upstream repositories (provena-interfaces and provena, this client library uses a specialised version of the interfaces which is a slightly stripped down view of the main interfaces packaged, migrated to v2.

This repo is available here - provena/pydantic-v2-interfaces.

We will ensure that when Provena updates effect the interfaces, that this mirror repository reflect those changes, and prompt an updated version of this repo to target them.

Contact Information

Contact Provena Developers via https://www.csiro.au/en/contact

Contributing:

Refer to the following doc Contributing Guidelines

Citation

Cite as:

Baker, Peter; Kulkarni, Parth; Petridis, Ross; & Yu, Jonathan (2024): Provena Python Client v0.13.0. CSIRO. v1. Software. https://doi.org/10.25919/j8s8-tf97

Refer to this link for details of the software collection and other versions: https://data.csiro.au/collection/csiro%3A63257v1

License

provenaclient was created by Provena Development Team (CSIRO). Provena Development Team (CSIRO) retains all rights to the source and it may not be reproduced, distributed, or used to create derivative works.

Acknowledgements

The development of Provena Python Client was funded by Reef Restoration and Adaptation Program (RRAP), which is a partnership between the Australian Government’s Reef Trust and the Great Barrier Reef Foundation. Provena Python Client has been developed to support the Modelling and Decision Support (MDS) Subprogram (https://gbrrestoration.org/program/modelling-and-decision-support/).

People who contributed and developed Provena Python Client (ordered alphabetically):

  • Jonathan Yu
  • Parth Kulkarni
  • Peter Baker
  • Ross Petridis

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

provenaclient-0.29.1.tar.gz (63.6 kB view details)

Uploaded Source

Built Distribution

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

provenaclient-0.29.1-py3-none-any.whl (86.4 kB view details)

Uploaded Python 3

File details

Details for the file provenaclient-0.29.1.tar.gz.

File metadata

  • Download URL: provenaclient-0.29.1.tar.gz
  • Upload date:
  • Size: 63.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.11

File hashes

Hashes for provenaclient-0.29.1.tar.gz
Algorithm Hash digest
SHA256 61e1270398dd1aba394a81107c2c10c7fcfa8e3f738ec106281cbfc22d9fdb92
MD5 9612efae47c4a9dad5556ff04f32de51
BLAKE2b-256 c592339c7aa4f2ccd0f72f1c8d5df4c828edf6b8c28dbd4131b54e6ac314e5f6

See more details on using hashes here.

File details

Details for the file provenaclient-0.29.1-py3-none-any.whl.

File metadata

  • Download URL: provenaclient-0.29.1-py3-none-any.whl
  • Upload date:
  • Size: 86.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.11

File hashes

Hashes for provenaclient-0.29.1-py3-none-any.whl
Algorithm Hash digest
SHA256 07e11a3adb1e0170720e1baae15febaa3b749ac15f0ef307b8990039660e3e98
MD5 2fc40f1650b027842541972e72c6d32f
BLAKE2b-256 0db93b93a4ce01c4baff01c707030360187c7ebfd40843c750f65d49c667a78a

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