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 | |
|---|---|
| Docs | |
| Package | |
| Meta |
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 (str): Returns the raw XML response from the API
- JSON (str): Returns a JSON representation of the API response
- dictionary: Returns a dictionary representation of the API response
- csv (str): Returns a CSV representation of the API response
- dataframe: Returns a pandas.DataFrame 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.
- Optional DataFrame/CSV: pandas, a powerful and flexible data analysis library, enables generation of DataFrames and CSV files from parsed XML responses.
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. |
License
python-re3data is distributed under the terms of the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_re3data-0.10.0.tar.gz.
File metadata
- Download URL: python_re3data-0.10.0.tar.gz
- Upload date:
- Size: 36.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93fc093c7dc48307122447fbf3cda78871f9b1d967db8237b66d16c15f703c32
|
|
| MD5 |
2de25f490e6fd2ce7bf7c85fe38c358d
|
|
| BLAKE2b-256 |
f571ddd3ee4336a420a1b728f5fd3fd86e1acdd58e9fc3f98c7864a05b42d531
|
Provenance
The following attestation bundles were made for python_re3data-0.10.0.tar.gz:
Publisher:
publish.yml on afuetterer/python-re3data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_re3data-0.10.0.tar.gz -
Subject digest:
93fc093c7dc48307122447fbf3cda78871f9b1d967db8237b66d16c15f703c32 - Sigstore transparency entry: 154713281
- Sigstore integration time:
-
Permalink:
afuetterer/python-re3data@0dd956009a10022e783d72e064b28ed1d92ff83d -
Branch / Tag:
refs/tags/0.10.0 - Owner: https://github.com/afuetterer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0dd956009a10022e783d72e064b28ed1d92ff83d -
Trigger Event:
release
-
Statement type:
File details
Details for the file python_re3data-0.10.0-py3-none-any.whl.
File metadata
- Download URL: python_re3data-0.10.0-py3-none-any.whl
- Upload date:
- Size: 41.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
196d2e1e4d91dd17cf84a80161228b1a981f107e39f4510318a5968bf93aaf89
|
|
| MD5 |
ff7be623cb0489f079c2575750b43cce
|
|
| BLAKE2b-256 |
f6ff4db21996e3a24a54820413510e7e515cfcad7f38fb05b9605fc68fb013b1
|
Provenance
The following attestation bundles were made for python_re3data-0.10.0-py3-none-any.whl:
Publisher:
publish.yml on afuetterer/python-re3data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_re3data-0.10.0-py3-none-any.whl -
Subject digest:
196d2e1e4d91dd17cf84a80161228b1a981f107e39f4510318a5968bf93aaf89 - Sigstore transparency entry: 154713286
- Sigstore integration time:
-
Permalink:
afuetterer/python-re3data@0dd956009a10022e783d72e064b28ed1d92ff83d -
Branch / Tag:
refs/tags/0.10.0 - Owner: https://github.com/afuetterer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0dd956009a10022e783d72e064b28ed1d92ff83d -
Trigger Event:
release
-
Statement type: