python-re3data


Namepython-re3data JSON
Version 0.10.0 PyPI version JSON
download
home_pageNone
SummaryThe Pythonic client for the re3data API.
upload_time2024-12-11 12:40:59
maintainerNone
docs_urlNone
authorHeinz-Alexander Fütterer
requires_python>=3.10
licenseMIT
keywords api api-client metadata re3data repositories research data
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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][pre-commit-ci-badge]][pre-commit-ci-status] [![ci][ci-badge]][ci-workflow] [![coverage][coverage-badge]][ci-workflow] [![codeql][codeql-badge]][codeql-workflow]                                                                                      |
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| __Docs__    | [![docs][docs-badge]][docs-workflow]                                                                                                                                                                                                                                           |
| __Package__ | [![pypi-status][status-badge]][pypi-url] [![pypi-version][pypi-version-badge]][pypi-url] [![pypi-python-versions][pypi-python-versions-badge]][pypi-url] [![all-downloads][all-downloads-badge]][pepy-tech-url] [![monthly-downloads][monthly-downloads-badge]][pepy-tech-url] |
| __Meta__    | [![doi][doi-badge]][doi-url] [![OpenSSF Scorecard][scorecard-badge]][scorecard-url] [![hatch][hatch-badge]][hatch] [![ruff][ruff-badge]][ruff] [![mypy][mypy-badge]][mypy] [![License][license-badge]][license-url]                                                            |

`python-re3data` is a Python library that simplifies interacting with the [re3data](https://www.re3data.org) (Registry
of Research Data Repositories) [REST API](https://www.re3data.org/api/doc), allowing you to easily retrieve and process
metadata about research data repositories in a convenient and Pythonic way.

```pycon
>>> 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)
```

```pycon
>>> 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](https://www.re3data.org/schema/2-2). 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](https://www.python.org/downloads/) >= 3.10

`python-re3data` is built with:

- **HTTP Requests**: [httpx](https://github.com/encode/httpx), a modern and efficient HTTP client library, handles all
    API interactions.
- **XML Parsing**: [xsdata](https://github.com/tefra/xsdata), a powerful tool for generating Python dataclasses from XML
    schemas, simplifies processing of API responses.
- **Optional CLI**: [typer](https://github.com/tiangolo/typer), a popular library for building command-line interfaces,
    powers the user-friendly interface.
- **Optional DataFrame/CSV**: [pandas](https://github.com/pandas-dev/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][pypi-url]:

```console
python -m pip install python-re3data
```

or pull the Docker image from [GHCR](https://github.com/afuetterer/python-re3data/pkgs/container/python-re3data):

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

For a more detailed guide, see [Installation](https://afuetterer.github.io/python-re3data/latest/install/).

## Documentation

The [documentation][docs-url] is made with [Material for MkDocs](https://github.com/squidfunk/mkdocs-material) and is
hosted by [GitHub Pages](https://docs.github.com/en/pages).

## Similar Projects

There are a couple of similar projects available on GitHub, e.g. via the topic
[re3data](https://github.com/topics/re3data). Among them are these implementations in Python:

| Project                                        | Description                                                                          | Last commit                                                                |
| ---------------------------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
| [py3data](https://github.com/J535D165/py3data) | `py3data` is a lightweight and thin Python interface to the beta version of the API. | ![last-commit](https://img.shields.io/github/last-commit/J535D165/py3data) |

## License

`python-re3data` is distributed under the terms of the [MIT License][license-url].

<!-- Refs -->

[all-downloads-badge]: https://static.pepy.tech/badge/python-re3data
[ci-badge]: https://github.com/afuetterer/python-re3data/actions/workflows/main.yml/badge.svg
[ci-workflow]: https://github.com/afuetterer/python-re3data/actions/workflows/main.yml
[codeql-badge]: https://github.com/afuetterer/python-re3data/actions/workflows/codeql.yml/badge.svg
[codeql-workflow]: https://github.com/afuetterer/python-re3data/actions/workflows/codeql.yml
[coverage-badge]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/afuetterer/adc66df152c473c1aa136557ee8181ca/raw/coverage-badge.json
[docs-badge]: https://github.com/afuetterer/python-re3data/actions/workflows/docs.yml/badge.svg
[docs-url]: https://afuetterer.github.io/python-re3data
[docs-workflow]: https://github.com/afuetterer/python-re3data/actions/workflows/docs.yml
[doi-badge]: https://zenodo.org/badge/DOI/10.5281/zenodo.11264510.svg
[doi-url]: https://doi.org/10.5281/zenodo.11264510
[hatch]: https://github.com/pypa/hatch
[hatch-badge]: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg
[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg
[license-url]: https://spdx.org/licenses/MIT.html
[monthly-downloads-badge]: https://static.pepy.tech/badge/python-re3data/month
[mypy]: https://mypy-lang.org
[mypy-badge]: https://img.shields.io/badge/types-mypy-blue.svg
[pepy-tech-url]: https://pepy.tech/project/python-re3data
[pre-commit-ci-badge]: https://results.pre-commit.ci/badge/github/afuetterer/python-re3data/main.svg
[pre-commit-ci-status]: https://results.pre-commit.ci/latest/github/afuetterer/python-re3data/main
[pypi-python-versions-badge]: https://img.shields.io/pypi/pyversions/python-re3data.svg?logo=python&label=Python
[pypi-url]: https://pypi.org/project/python-re3data/
[pypi-version-badge]: https://img.shields.io/pypi/v/python-re3data.svg?logo=pypi&label=PyPI
[ruff]: https://github.com/astral-sh/ruff
[ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
[scorecard-badge]: https://api.securityscorecards.dev/projects/github.com/afuetterer/python-re3data/badge
[scorecard-url]: https://securityscorecards.dev/viewer/?uri=github.com/afuetterer/python-re3data
[status-badge]: https://img.shields.io/pypi/status/python-re3data?logo=pypi

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "python-re3data",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "api, api-client, metadata, re3data, repositories, research data",
    "author": "Heinz-Alexander F\u00fctterer",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/f5/71/ddd3ee4336a420a1b728f5fd3fd86e1acdd58e9fc3f98c7864a05b42d531/python_re3data-0.10.0.tar.gz",
    "platform": null,
    "description": "# python-re3data: The Pythonic client for the re3data API.\n\n> \u26a0\ufe0f Please note that this project is currently under active development. As such, it is considered a work in progress,\n> and breaking changes may be introduced at any time. We encourage users to frequently check back for updates and to\n> exercise caution when using this project in production environments. Contributions and feedback are welcome to help\n> move the project towards a more stable release (v1.0.0).\n\n| __CI__      | [![pre-commit.ci status][pre-commit-ci-badge]][pre-commit-ci-status] [![ci][ci-badge]][ci-workflow] [![coverage][coverage-badge]][ci-workflow] [![codeql][codeql-badge]][codeql-workflow]                                                                                      |\n| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| __Docs__    | [![docs][docs-badge]][docs-workflow]                                                                                                                                                                                                                                           |\n| __Package__ | [![pypi-status][status-badge]][pypi-url] [![pypi-version][pypi-version-badge]][pypi-url] [![pypi-python-versions][pypi-python-versions-badge]][pypi-url] [![all-downloads][all-downloads-badge]][pepy-tech-url] [![monthly-downloads][monthly-downloads-badge]][pepy-tech-url] |\n| __Meta__    | [![doi][doi-badge]][doi-url] [![OpenSSF Scorecard][scorecard-badge]][scorecard-url] [![hatch][hatch-badge]][hatch] [![ruff][ruff-badge]][ruff] [![mypy][mypy-badge]][mypy] [![License][license-badge]][license-url]                                                            |\n\n`python-re3data` is a Python library that simplifies interacting with the [re3data](https://www.re3data.org) (Registry\nof Research Data Repositories) [REST API](https://www.re3data.org/api/doc), allowing you to easily retrieve and process\nmetadata about research data repositories in a convenient and Pythonic way.\n\n```pycon\n>>> import re3data\n>>> response = re3data.repositories.list()\n>>> response\n[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'))]\n... (remaining repositories truncated)\n```\n\n```pycon\n>>> response = re3data.repositories.get(\"r3d100010468\")\n>>> response\nRepository(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'])\n... (remaining fields truncated)\n```\n\n## Features\n\n- Pythonic API interactions: Interact with the re3data API in a Pythonic way, without having to worry about low-level\n    HTTP requests or XML parsing.\n- Repository metadata retrieval: Easily fetch and process metadata about research data repositories using\n    `re3data.repositories.list()`.\n- Repository details retrieval: Get detailed information about a specific repository using\n    `re3data.repositories.get(repository_id)`.\n- XML response parsers: API XML responses are parsed into Python dataclasses, providing convenient access to the\n    elements of the [re3data.org Schema 2.2 XML Schema](https://www.re3data.org/schema/2-2). This makes it easy to work\n    with the rich metadata provided by the API.\n- Flexible response options: The response type can be switched between:\n    - dataclass (default): Returns a Python dataclass object, allowing convenient access to the element of the re3data\n        schema\n    - response: Returns a Python object representing the API response\n    - original XML (str): Returns the raw XML response from the API\n    - JSON (str): Returns a JSON representation of the API response\n    - dictionary: Returns a dictionary representation of the API response\n    - csv (str): Returns a CSV representation of the API response\n    - dataframe: Returns a pandas.DataFrame representation of the API response\n\n## Requirements\n\n[Python](https://www.python.org/downloads/) >= 3.10\n\n`python-re3data` is built with:\n\n- **HTTP Requests**: [httpx](https://github.com/encode/httpx), a modern and efficient HTTP client library, handles all\n    API interactions.\n- **XML Parsing**: [xsdata](https://github.com/tefra/xsdata), a powerful tool for generating Python dataclasses from XML\n    schemas, simplifies processing of API responses.\n- **Optional CLI**: [typer](https://github.com/tiangolo/typer), a popular library for building command-line interfaces,\n    powers the user-friendly interface.\n- **Optional DataFrame/CSV**: [pandas](https://github.com/pandas-dev/pandas), a powerful and flexible data analysis\n    library, enables generation of DataFrames and CSV files from parsed XML responses.\n\n## Installation\n\nYou can install `python-re3data` via pip from [PyPI][pypi-url]:\n\n```console\npython -m pip install python-re3data\n```\n\nor pull the Docker image from [GHCR](https://github.com/afuetterer/python-re3data/pkgs/container/python-re3data):\n\n```console\ndocker pull ghcr.io/afuetterer/python-re3data:latest\n```\n\nFor a more detailed guide, see [Installation](https://afuetterer.github.io/python-re3data/latest/install/).\n\n## Documentation\n\nThe [documentation][docs-url] is made with [Material for MkDocs](https://github.com/squidfunk/mkdocs-material) and is\nhosted by [GitHub Pages](https://docs.github.com/en/pages).\n\n## Similar Projects\n\nThere are a couple of similar projects available on GitHub, e.g. via the topic\n[re3data](https://github.com/topics/re3data). Among them are these implementations in Python:\n\n| Project                                        | Description                                                                          | Last commit                                                                |\n| ---------------------------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |\n| [py3data](https://github.com/J535D165/py3data) | `py3data` is a lightweight and thin Python interface to the beta version of the API. | ![last-commit](https://img.shields.io/github/last-commit/J535D165/py3data) |\n\n## License\n\n`python-re3data` is distributed under the terms of the [MIT License][license-url].\n\n<!-- Refs -->\n\n[all-downloads-badge]: https://static.pepy.tech/badge/python-re3data\n[ci-badge]: https://github.com/afuetterer/python-re3data/actions/workflows/main.yml/badge.svg\n[ci-workflow]: https://github.com/afuetterer/python-re3data/actions/workflows/main.yml\n[codeql-badge]: https://github.com/afuetterer/python-re3data/actions/workflows/codeql.yml/badge.svg\n[codeql-workflow]: https://github.com/afuetterer/python-re3data/actions/workflows/codeql.yml\n[coverage-badge]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/afuetterer/adc66df152c473c1aa136557ee8181ca/raw/coverage-badge.json\n[docs-badge]: https://github.com/afuetterer/python-re3data/actions/workflows/docs.yml/badge.svg\n[docs-url]: https://afuetterer.github.io/python-re3data\n[docs-workflow]: https://github.com/afuetterer/python-re3data/actions/workflows/docs.yml\n[doi-badge]: https://zenodo.org/badge/DOI/10.5281/zenodo.11264510.svg\n[doi-url]: https://doi.org/10.5281/zenodo.11264510\n[hatch]: https://github.com/pypa/hatch\n[hatch-badge]: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg\n[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg\n[license-url]: https://spdx.org/licenses/MIT.html\n[monthly-downloads-badge]: https://static.pepy.tech/badge/python-re3data/month\n[mypy]: https://mypy-lang.org\n[mypy-badge]: https://img.shields.io/badge/types-mypy-blue.svg\n[pepy-tech-url]: https://pepy.tech/project/python-re3data\n[pre-commit-ci-badge]: https://results.pre-commit.ci/badge/github/afuetterer/python-re3data/main.svg\n[pre-commit-ci-status]: https://results.pre-commit.ci/latest/github/afuetterer/python-re3data/main\n[pypi-python-versions-badge]: https://img.shields.io/pypi/pyversions/python-re3data.svg?logo=python&label=Python\n[pypi-url]: https://pypi.org/project/python-re3data/\n[pypi-version-badge]: https://img.shields.io/pypi/v/python-re3data.svg?logo=pypi&label=PyPI\n[ruff]: https://github.com/astral-sh/ruff\n[ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json\n[scorecard-badge]: https://api.securityscorecards.dev/projects/github.com/afuetterer/python-re3data/badge\n[scorecard-url]: https://securityscorecards.dev/viewer/?uri=github.com/afuetterer/python-re3data\n[status-badge]: https://img.shields.io/pypi/status/python-re3data?logo=pypi\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "The Pythonic client for the re3data API.",
    "version": "0.10.0",
    "project_urls": {
        "Changelog": "https://github.com/afuetterer/python-re3data/blob/main/CHANGELOG.md",
        "Documentation": "https://afuetterer.github.io/python-re3data",
        "Issues": "https://github.com/afuetterer/python-re3data/issues",
        "Repository": "https://github.com/afuetterer/python-re3data.git"
    },
    "split_keywords": [
        "api",
        " api-client",
        " metadata",
        " re3data",
        " repositories",
        " research data"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f6ff4db21996e3a24a54820413510e7e515cfcad7f38fb05b9605fc68fb013b1",
                "md5": "ff7be623cb0489f079c2575750b43cce",
                "sha256": "196d2e1e4d91dd17cf84a80161228b1a981f107e39f4510318a5968bf93aaf89"
            },
            "downloads": -1,
            "filename": "python_re3data-0.10.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ff7be623cb0489f079c2575750b43cce",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 41728,
            "upload_time": "2024-12-11T12:40:56",
            "upload_time_iso_8601": "2024-12-11T12:40:56.679433Z",
            "url": "https://files.pythonhosted.org/packages/f6/ff/4db21996e3a24a54820413510e7e515cfcad7f38fb05b9605fc68fb013b1/python_re3data-0.10.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f571ddd3ee4336a420a1b728f5fd3fd86e1acdd58e9fc3f98c7864a05b42d531",
                "md5": "2de25f490e6fd2ce7bf7c85fe38c358d",
                "sha256": "93fc093c7dc48307122447fbf3cda78871f9b1d967db8237b66d16c15f703c32"
            },
            "downloads": -1,
            "filename": "python_re3data-0.10.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2de25f490e6fd2ce7bf7c85fe38c358d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 36841,
            "upload_time": "2024-12-11T12:40:59",
            "upload_time_iso_8601": "2024-12-11T12:40:59.293671Z",
            "url": "https://files.pythonhosted.org/packages/f5/71/ddd3ee4336a420a1b728f5fd3fd86e1acdd58e9fc3f98c7864a05b42d531/python_re3data-0.10.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-11 12:40:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "afuetterer",
    "github_project": "python-re3data",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "python-re3data"
}
        
Elapsed time: 0.85694s