Skip to main content

A Library to interact with the Impresso API

Project description

Impresso Python Library

PyPI version PyPI - License

Impresso is a library to interact with the Impresso dataset. It provides a set of classes to interact with the API and a set of tools that make working with the data easier.

Installation

With pip:

pip install impresso

Usage

See sample notebooks in the examples/notebooks directory or examples available in the Impresso Datalab.

Extending the library

We use Poetry for dependency management. To install the package in development mode, run the following command in the root directory of the project:

poetry install

This will create and activate a virtual environment with all the dependencies installed.

Testing

poetry run pytest

Linting

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:

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 project. The python code is generated using the protoc compiler (must be installed separately). The following command generates the python code for the protobuf message:

poetry run generate-protobuf

About Impresso

Impresso project

Impresso - Media Monitoring of the Past 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 and the second project (2023-2027) by the SNSF under grant No. CRSII5_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 v3 or later.


Impresso Project Logo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

impresso-0.9.6.tar.gz (84.8 kB view details)

Uploaded Source

Built Distribution

impresso-0.9.6-py3-none-any.whl (198.6 kB view details)

Uploaded Python 3

File details

Details for the file impresso-0.9.6.tar.gz.

File metadata

  • Download URL: impresso-0.9.6.tar.gz
  • Upload date:
  • Size: 84.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for impresso-0.9.6.tar.gz
Algorithm Hash digest
SHA256 53d4eb640e0b33984e7c39171b6fc6a96a05eed84b2aa624c86c7e2b745d3bdf
MD5 049bcd45842623e6a5e0088ccb71b3a9
BLAKE2b-256 c15bf3ab5ad66eea4252c34589a8c1e29af750500d50fa28b958102925d1dba5

See more details on using hashes here.

File details

Details for the file impresso-0.9.6-py3-none-any.whl.

File metadata

  • Download URL: impresso-0.9.6-py3-none-any.whl
  • Upload date:
  • Size: 198.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for impresso-0.9.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4de59f5b3d0122e38329b220637a0d52f129ea5c941c817010886138e73a1160
MD5 2e1f386f4cf04df85a72c2cc8a3d8149
BLAKE2b-256 b40e37cb168f70844390df1f6c0b90503e5d5f26924070eaffc92874f54ebeb4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page