Skip to main content

A Python wrapper around Europeana APIs

Project description

Python interface for Europeana's APIs

This package is a Python client library for several APIs from Europeana:

With this tool you can access in python the data and metadata from our collections. Learn more about the Europeana Data Model here

Installation

Using pip

pip install pyeuropeana

From source

(.venv) $ git clone https://github.com/europeana/rd-europeana-python-api.git
(.venv) $ cd rd-europeana-python-api
(.venv) $ pip install .

Authentication

Get your API key here

Set EUROPEANA_API_KEY as an environment variable running export EUROPEANA_API_KEY=yourapikey in the terminal.

If running in Google Colab use os.environ['EUROPEANA_API_KEY'] = 'yourapikey'

Usage

Search API

import pyeuropeana.apis as apis
import pyeuropeana.utils as utils

# use this function to search our collections
result = apis.search(
    query = '*',
    qf = '(skos_concept:"http://data.europeana.eu/concept/base/48" AND TYPE:IMAGE)',
    reusability = 'open AND permission',
    media = True,
    thumbnail = True,
    landingpage = True,
    colourpalette = '#0000FF',
    theme = 'photography',
    sort = 'europeana_id',
    profile = 'rich',
    rows = 1000,
    ) # this gives you full response metadata along with cultural heritage object metadata

    # use this utility function to transform a subset of the cultural heritage object metadata
    # into a readable Pandas DataFrame
dataframe = utils.edm_utils.resp2df(result)

Record API

import pyeuropeana.apis as apis

# gets the metadata from an object using its europeana id
data = apis.record('/79/resource_document_museumboerhaave_V35167')

Entity API

import pyeuropeana.apis as apis

# suggests an entity based on a text query
data = apis.entity.suggest(
  text = 'leonardo',
  TYPE = 'agent',
  language = 'es'
)

# retrieves the data from an entity using the identifier
data = apis.entity.retrieve(
  TYPE = 'agent',
  IDENTIFIER = 3
)

# resolves entities from an input URI
data = apis.entity.resolve('http://dbpedia.org/resource/Leonardo_da_Vinci')

IIIF API

import pyeuropeana.apis as apis

# The IIIF API is mostly used to access newspapers collections at Europeana

# returns a minimal set of metadata for an object
data = apis.iiif.manifest('/9200356/BibliographicResource_3000118390149')

# returns text and annotations for a given page of an object
data = apis.iiif.annopage(
  RECORD_ID = '/9200356/BibliographicResource_3000118390149',
  PAGE_ID = 1
)

# returns the transciption of a single page of a newspaper
data = apis.iiif.fulltext(
  RECORD_ID = '/9200396/BibliographicResource_3000118435063',
  FULLTEXT_ID = '8ebb67ccf9f8a1dcc2ea119c60954111'
)

Documentation

The documentation is available at Read the Docs

You can also build the docs

Tutorials

Colab tutorial

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

pyeuropeana-0.1.5.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

pyeuropeana-0.1.5-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file pyeuropeana-0.1.5.tar.gz.

File metadata

  • Download URL: pyeuropeana-0.1.5.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for pyeuropeana-0.1.5.tar.gz
Algorithm Hash digest
SHA256 5453c5d35211ce06af233f46955fcc3bed6bf82c1ad485f5ffc5672d306b9569
MD5 b3db3615ee48d9b26ad78c71d823e77d
BLAKE2b-256 873993d59aa19b65621ddcc8764b178baaf3b4eace2f2400ca8938e71ccfcbfa

See more details on using hashes here.

File details

Details for the file pyeuropeana-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pyeuropeana-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for pyeuropeana-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 74e9cd453461308f278bc8c8c2da691495dfd07a007aee01d7af082ca50eb028
MD5 7a374359e84fb4f78016b43fd9c6036f
BLAKE2b-256 877653797f9a78c3c9403b29bbbf6b5ed8afd72f275b7cec68eb9fc66fb928df

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