@@ -18,28 +18,15 @@ metadata about research data repositories in a convenient and Pythonic way.
1818``` pycon
1919>>> import re3data
2020>>> response = re3data.repositories.list()
21- >>> print (response)
22- <?xml version="1.0" encoding="UTF-8"?>
23- <list>
24- <repository>
25- <id>r3d100010468</id>
26- <doi>https://doi.org/10.17616/R3QP53</doi>
27- <name>Zenodo</name>
28- <link href="https://www.re3data.org/api/beta/repository/r3d100010468" rel="self" />
29- </repository>
21+ >>> response
22+ [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'))]
3023... (remaining repositories truncated)
3124```
3225
3326``` pycon
3427>>> response = re3data.repositories.get(" r3d100010468" )
35- >>> print (response)
36- <?xml version="1.0" encoding="utf-8"?>
37- <!--re3data.org Schema for the Description of Research Data Repositories. Version 2.2, December 2014. doi:10.2312/re3.006-->
38- <r3d:re3data xmlns:r3d="http://www.re3data.org/schema/2-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.re3data.org/schema/2-2 http://schema.re3data.org/2-2/re3dataV2-2.xsd">
39- <r3d:repository>
40- <r3d:re3data.orgIdentifier>r3d100010468</r3d:re3data.orgIdentifier>
41- <r3d:repositoryName language="eng">Zenodo</r3d:repositoryName>
42- <r3d:repositoryURL>https://zenodo.org/</r3d:repositoryURL>
28+ >>> response
29+ 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'])
4330... (remaining fields truncated)
4431```
4532
@@ -51,15 +38,27 @@ metadata about research data repositories in a convenient and Pythonic way.
5138 ` re3data.repositories.list() ` .
5239- Repository details retrieval: Get detailed information about a specific repository using
5340 ` re3data.repositories.get(repository_id) ` .
41+ - XML response parsers: API XML responses are parsed into Python dataclasses, providing convenient access to the
42+ elements of the [ re3data.org Schema] ( https://www.re3data.org/schema/2-2 ) . This makes it easy to work with the rich
43+ metadata provided by the API.
44+ - Flexible response options: The response type can be switched between:
45+ - dataclass (default): Returns a Python dataclass object, allowing convenient access to the element of the re3data
46+ schema
47+ - response: Returns a Python object representing the API response
48+ - original XML: Returns the raw XML response from the API
5449
5550## Requirements
5651
5752[ Python] ( https://www.python.org/downloads/ ) >= 3.10
5853
5954` python-re3data ` is built with:
6055
61- - [ httpx] ( https://github.com/encode/httpx ) for issuing HTTP requests
62- - [ typer] ( https://github.com/tiangolo/typer ) for its CLI
56+ - ** HTTP Requests** : [ httpx] ( https://github.com/encode/httpx ) , a modern and efficient HTTP client library, handles all
57+ API interactions.
58+ - ** XML Parsing** : [ xsdata] ( https://github.com/tefra/xsdata ) , a powerful tool for generating Python dataclasses from XML
59+ schemas, simplifies processing of API responses.
60+ - ** Optional CLI** : [ typer] ( https://github.com/tiangolo/typer ) , a popular library for building command-line interfaces,
61+ powers the user-friendly command-line interface (CLI).
6362
6463## Installation
6564
0 commit comments