diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 34e153f..a8cebeb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -94,6 +94,7 @@ repos: additional_dependencies: - orjson # Ref: https://github.com/python/mypy/blob/v1.13.0/CHANGELOG.md#improved-performance - httpx>=0.27 + - pandas-stubs>=2.2 - pytest>=8.2 - respx>=0.21 - typer>=0.12 diff --git a/README.md b/README.md index 94eebc8..fab9325 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,11 @@ Repository(re3data_org_identifier='r3d100010468', repository_name=RepositoryName - 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 + - 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 @@ -61,6 +63,8 @@ Repository(re3data_org_identifier='r3d100010468', repository_name=RepositoryName 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 diff --git a/docs/src/install.md b/docs/src/install.md index 9d6d8cb..b0666b3 100644 --- a/docs/src/install.md +++ b/docs/src/install.md @@ -129,6 +129,14 @@ Install with `python -m pip install "python-re3data[cli]"`. | ------------------------------------------ | ------- | ------------------------------------------------------------------------------------------- | | [typer](https://github.com/tiangolo/typer) | >= 0.12 | A popular library for building command-line interfaces, powers the user-friendly interface. | +#### CSV + +Install with `python -m pip install "python-re3data[csv]"`. + +| Package | Version | Description | +| ---------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------ | +| [pandas](https://github.com/pandas-dev/pandas) | >= 2.0 | A powerful and flexible data analysis library, enables generation of DataFrames and CSV files from parsed XML responses. | +