Skip to main content

The Pythonic client for the re3data API.

Project description

python-re3data: The Pythonic client for the re3data API.

⚠️ Please note that this project is currently under active development. As such, it is considered a work in progress, and breaking changes may be introduced at any time. We encourage users to frequently check back for updates and to exercise caution when using this project in production environments. Contributions and feedback are welcome to help move the project towards a more stable release (v1.0.0).

CI pre-commit.ci status ci coverage codeql
Docs docs
Package pypi-status pypi-version pypi-python-versions all-downloads monthly-downloads
Meta doi OpenSSF Scorecard hatch ruff mypy License

python-re3data is a Python library that simplifies interacting with the re3data (Registry of Research Data Repositories) REST API, allowing you to easily retrieve and process metadata about research data repositories in a convenient and Pythonic way.

>>> import re3data
>>> response = re3data.repositories.list()
>>> response
[RepositorySummary(id='r3d100010468', doi='https://doi.org/10.17616/R3QP53', name='Zenodo', link=Link(href='https://www.re3data.org/api/beta/repository/r3d100010468', rel='self'))]
... (remaining repositories truncated)
>>> response = re3data.repositories.get("r3d100010468")
>>> response
Repository(re3data_org_identifier='r3d100010468', repository_name=RepositoryName(value='Zenodo', language=<Languages.ENG: 'eng'>), additional_name=[], repository_url='https://zenodo.org/', repository_identifier=['FAIRsharing_doi:10.25504/FAIRsharing.wy4egf', 'RRID:SCR_004129', 'RRID:nlx_158614'])
... (remaining fields truncated)

Features

  • Pythonic API interactions: Interact with the re3data API in a Pythonic way, without having to worry about low-level HTTP requests or XML parsing.
  • Repository metadata retrieval: Easily fetch and process metadata about research data repositories using re3data.repositories.list().
  • Repository details retrieval: Get detailed information about a specific repository using re3data.repositories.get(repository_id).
  • XML response parsers: API XML responses are parsed into Python dataclasses, providing convenient access to the elements of the re3data.org Schema 2.2 XML Schema. This makes it easy to work with the rich metadata provided by the API.
  • Flexible response options: The response type can be switched between:
    • dataclass (default): Returns a Python dataclass object, allowing convenient access to the element of the re3data schema
    • response: Returns a Python object representing the API response
    • original XML: Returns the raw XML response from the API
    • JSON: Returns a JSON representation of the API response
    • dictionary: Returns a dictionary representation of the API response

Requirements

Python >= 3.10

python-re3data is built with:

  • HTTP Requests: httpx, a modern and efficient HTTP client library, handles all API interactions.
  • XML Parsing: xsdata, a powerful tool for generating Python dataclasses from XML schemas, simplifies processing of API responses.
  • Optional CLI: typer, a popular library for building command-line interfaces, powers the user-friendly interface.

Installation

You can install python-re3data via pip from PyPI:

python -m pip install python-re3data

or pull the Docker image from GHCR:

docker pull ghcr.io/afuetterer/python-re3data:latest

For a more detailed guide, see Installation.

Documentation

The documentation is made with Material for MkDocs and is hosted by GitHub Pages.

Similar Projects

There are a couple of similar projects available on GitHub, e.g. via the topic re3data. Among them are these implementations in Python:

Project Description Last commit
py3data py3data is a lightweight and thin Python interface to the beta version of the API. last-commit

License

python-re3data is distributed under the terms of 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

python_re3data-0.9.0.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

python_re3data-0.9.0-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

Details for the file python_re3data-0.9.0.tar.gz.

File metadata

  • Download URL: python_re3data-0.9.0.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for python_re3data-0.9.0.tar.gz
Algorithm Hash digest
SHA256 4cfaba0d916c8c93658e8054d0ddf0d5f16b663c0f92aa679e1c70a6d44bd581
MD5 66c5062e7dde0523d237d73d08db700c
BLAKE2b-256 e4b806ab3db0cb20017edd514110a6ec36e651ce95ffe74474fb0a33660e9a85

See more details on using hashes here.

File details

Details for the file python_re3data-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_re3data-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2ad270b8e7a51f6de001c3a771d26ef1eccb24822495eb32659ca71e76c6046
MD5 a8e63aa287a037028889b0c46b19746e
BLAKE2b-256 14571d17e2766bb9082ad3e38e963c77d8941d6318fe7105c1f72b8335dbd31d

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