# Impresso Python Library
[](https://badge.fury.io/py/impresso)

Impresso is a library designed to facilitate interaction with the [Impresso](https://impresso-project.ch/app) dataset. It offers a comprehensive set of classes for API interaction and a variety of tools to streamline data manipulation and analysis.
You can find the full documentation at [https://impresso.github.io/impresso-py/](https://impresso.github.io/impresso-py/).
## Installation
With `pip`:
```bash
pip install impresso
```
## Usage
See sample notebooks in the [examples/notebooks](https://github.com/impresso/impresso-py/tree/main/examples/notebooks) directory or examples available in the [Impresso Datalab](https://impresso-project.ch/datalab/).
## Extending the library
We use [Poetry](https://python-poetry.org/) for dependency management. To install the package in development mode, run the following command in the root directory of the project:
```shell
poetry install
```
This will create and activate a virtual environment with all the dependencies installed.
### Testing
```shell
poetry run pytest
```
### Linting
```shell
poetry run pytest
poetry run flake8 impresso tests
poetry run mypy impresso tests
```
### OpenAPI client generation
The OpenAPI client is generated using the OpenAPI Generator. Pydantic models from the OpenAPI spec are generated too. The following command generates both the client code and the pydantic models:
```shell
poetry run generate-client
```
Whenever the OpenAPI spec of the Impresso Public API changes, the client code and the pydantic models must be regenerated.
### Protobuf
Filters used in some endpoints are serialized as a protobuf message. The protobuf message is defined in the [impresso-jscommons](https://github.com/impresso/impresso-jscommons) project. The python code is generated using the `protoc` compiler (must be [installed](https://google.github.io/proto-lens/installing-protoc.html) separately). The following command generates the python code for the protobuf message:
```shell
poetry run generate-protobuf
```
## About Impresso
### Impresso project
[Impresso - Media Monitoring of the Past](https://impresso-project.ch) is an interdisciplinary research project that aims to develop and consolidate tools for processing and exploring large collections of media archives across modalities, time, languages and national borders. The first project (2017-2021) was funded by the Swiss National Science Foundation under grant No. [CRSII5_173719](http://p3.snf.ch/project-173719) and the second project (2023-2027) by the SNSF under grant No. [CRSII5_213585](https://data.snf.ch/grants/grant/213585) and the Luxembourg National Research Fund under grant No. 17498891.
### Copyright
Copyright (C) 2024 The Impresso team.
### License
This program is provided as open source under the [GNU Affero General Public License](https://github.com/impresso/impresso-pyindexation/blob/master/LICENSE) v3 or later.
---
<p align="center">
<img src="https://github.com/impresso/impresso.github.io/blob/master/assets/images/3x1--Yellow-Impresso-Black-on-White--transparent.png?raw=true" width="350" alt="Impresso Project Logo"/>
</p>
Raw data
{
"_id": null,
"home_page": "https://github.com/impresso/impresso-py",
"name": "impresso",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0.0,>=3.10.0",
"maintainer_email": null,
"keywords": null,
"author": "Daniele Guido",
"author_email": "daniele.guido@uni.lu",
"download_url": "https://files.pythonhosted.org/packages/86/53/67e76c2d773c3aa1d1f58b0784854be6408a19316b2c084193222a392e6f/impresso-0.9.10.tar.gz",
"platform": null,
"description": "# Impresso Python Library\n\n[](https://badge.fury.io/py/impresso)\n\n\n\nImpresso is a library designed to facilitate interaction with the [Impresso](https://impresso-project.ch/app) dataset. It offers a comprehensive set of classes for API interaction and a variety of tools to streamline data manipulation and analysis.\n\nYou can find the full documentation at [https://impresso.github.io/impresso-py/](https://impresso.github.io/impresso-py/).\n\n## Installation\n\nWith `pip`:\n\n```bash\npip install impresso\n```\n\n## Usage\n\nSee sample notebooks in the [examples/notebooks](https://github.com/impresso/impresso-py/tree/main/examples/notebooks) directory or examples available in the [Impresso Datalab](https://impresso-project.ch/datalab/).\n\n## Extending the library\n\nWe use [Poetry](https://python-poetry.org/) for dependency management. To install the package in development mode, run the following command in the root directory of the project:\n\n```shell\npoetry install\n```\n\nThis will create and activate a virtual environment with all the dependencies installed.\n\n### Testing\n\n```shell\npoetry run pytest\n```\n\n### Linting\n\n```shell\npoetry run pytest\npoetry run flake8 impresso tests\npoetry run mypy impresso tests\n```\n\n### OpenAPI client generation\n\nThe OpenAPI client is generated using the OpenAPI Generator. Pydantic models from the OpenAPI spec are generated too. The following command generates both the client code and the pydantic models:\n\n```shell\npoetry run generate-client\n```\n\nWhenever the OpenAPI spec of the Impresso Public API changes, the client code and the pydantic models must be regenerated.\n\n### Protobuf\n\nFilters used in some endpoints are serialized as a protobuf message. The protobuf message is defined in the [impresso-jscommons](https://github.com/impresso/impresso-jscommons) project. The python code is generated using the `protoc` compiler (must be [installed](https://google.github.io/proto-lens/installing-protoc.html) separately). The following command generates the python code for the protobuf message:\n\n```shell\npoetry run generate-protobuf\n```\n\n## About Impresso\n\n### Impresso project\n\n[Impresso - Media Monitoring of the Past](https://impresso-project.ch) is an interdisciplinary research project that aims to develop and consolidate tools for processing and exploring large collections of media archives across modalities, time, languages and national borders. The first project (2017-2021) was funded by the Swiss National Science Foundation under grant No. [CRSII5_173719](http://p3.snf.ch/project-173719) and the second project (2023-2027) by the SNSF under grant No. [CRSII5_213585](https://data.snf.ch/grants/grant/213585) and the Luxembourg National Research Fund under grant No. 17498891.\n\n### Copyright\n\nCopyright (C) 2024 The Impresso team.\n\n### License\n\nThis program is provided as open source under the [GNU Affero General Public License](https://github.com/impresso/impresso-pyindexation/blob/master/LICENSE) v3 or later.\n\n---\n\n<p align=\"center\">\n <img src=\"https://github.com/impresso/impresso.github.io/blob/master/assets/images/3x1--Yellow-Impresso-Black-on-White--transparent.png?raw=true\" width=\"350\" alt=\"Impresso Project Logo\"/>\n</p>\n\n",
"bugtrack_url": null,
"license": "AGPL-3.0-or-later",
"summary": "A Library to interact with the Impresso API",
"version": "0.9.10",
"project_urls": {
"Endpoint": "https://impresso-project.ch/public-api/v1",
"Homepage": "https://github.com/impresso/impresso-py",
"Issues": "https://github.com/impresso/impresso-py/issues",
"Repository": "https://github.com/impresso/impresso-py"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "86ae6605a405743928ae8f3824e68f1a4d9592da7e222ec9949139c4f9b9957c",
"md5": "be1baa4325fc00aedcc30c95b01583a5",
"sha256": "512a52d823a00137e596c39593e168640ffad88b62ca0fe10ec837606f0348c4"
},
"downloads": -1,
"filename": "impresso-0.9.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "be1baa4325fc00aedcc30c95b01583a5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0.0,>=3.10.0",
"size": 151337,
"upload_time": "2025-02-26T08:33:45",
"upload_time_iso_8601": "2025-02-26T08:33:45.202174Z",
"url": "https://files.pythonhosted.org/packages/86/ae/6605a405743928ae8f3824e68f1a4d9592da7e222ec9949139c4f9b9957c/impresso-0.9.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "865367e76c2d773c3aa1d1f58b0784854be6408a19316b2c084193222a392e6f",
"md5": "db59bdba3cdd00a4d2073e921aee762c",
"sha256": "cf416b6677a7068318fbdefd4cd3fc6af561cbbb93dd428f5858b46846c0f0ec"
},
"downloads": -1,
"filename": "impresso-0.9.10.tar.gz",
"has_sig": false,
"md5_digest": "db59bdba3cdd00a4d2073e921aee762c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0.0,>=3.10.0",
"size": 69876,
"upload_time": "2025-02-26T08:33:47",
"upload_time_iso_8601": "2025-02-26T08:33:47.091424Z",
"url": "https://files.pythonhosted.org/packages/86/53/67e76c2d773c3aa1d1f58b0784854be6408a19316b2c084193222a392e6f/impresso-0.9.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-26 08:33:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "impresso",
"github_project": "impresso-py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "impresso"
}