Skip to main content

ZDB Hydra API Client

Project description

zdbpydra is a Python package and command line utility that allows to access JSON-LD data (with PICA+ data embedded) from the German Union Catalogue of Serials (ZDB) via its Hydra-based API (beta).

Installation

… via PyPI

pip install zdbpydra

Usage Examples

Command Line

# fetch metadata of serial title
zdbpydra --id "2736054-4"

# fetch metadata of serial title (pica only)
zdbpydra --id "2736054-4" --pica

# query metadata of serial titles (cql-based)
zdbpydra --query "psg=ZDB-1-CPO"
# print help message
zdbpydra --help

Help Message

usage: zdbpydra [-h] [--id ID] [--query QUERY] [--scroll [SCROLL]]
                [--stream [STREAM]] [--pica [PICA]] [--pretty [PRETTY]]

Fetch JSON-LD data (with PICA+ data embedded) from the German Union Catalogue
of Serials (ZDB)

optional arguments:
  -h, --help         show this help message and exit
  --id ID            id of serial title (default: None)
  --query QUERY      cql-based search query (default: None)
  --scroll [SCROLL]  scroll result set (default: False)
  --stream [STREAM]  stream result set (default: False)
  --pica [PICA]      fetch pica data only (default: False)
  --pretty [PRETTY]  pretty print output (default: False)

Interpreter

import zdbpydra
# fetch metadata of serial title
serial = zdbpydra.title("2736054-4")
# fetch metadata of serial title (pica only)
serial_pica = zdbpydra.title("2736054-4", pica=True)
# fetch result page for given query
result_page = zdbpydra.search("psg=ZDB-1-CPO")
# fetch all result pages for given query
result_page_set = zdbpydra.scroll("psg=ZDB-1-CPO")
# iterate serial titles found for given query
for serial in zdbpydra.stream("psg=ZDB-1-CPO"):
    print(serial.title)

Background

See Hydra: Hypermedia-Driven Web APIs by Markus Lanthaler for more information on Hydra APIs in general.

Have a look at the API documentation and CQL documentation (both in german) for more information on using the ZDB JSON interface. For details regarding the LD schema, see the local context file.

Information on the PICA-based ZDB-Format can be found in the corresponding cataloguing documentation or in the PICA+/PICA3 concordance (both in german).

Usage Terms

ZDB metadata

All metadata in the German Union Catalogue of Serials is available free of charge for general use under the Creative Commons Zero 1.0 (CC0 1.0) license. Most of the holding data in the ZDB is also freely available. A corresponding tag is incorporated into the data record itself. (Source)

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

zdbpydra-0.3.2.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

zdbpydra-0.3.2-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file zdbpydra-0.3.2.tar.gz.

File metadata

  • Download URL: zdbpydra-0.3.2.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.5.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.12

File hashes

Hashes for zdbpydra-0.3.2.tar.gz
Algorithm Hash digest
SHA256 38f1dffb6458edeb88b61640206ba5364224ea2ea9104b2862548fc9ee95e544
MD5 c9f2174246f1fc56bef9d0a7f9bf3d20
BLAKE2b-256 aa45be050da8700e173aad4dc0d2b92aa2cb7f45417189c2ae21b529ccbf5027

See more details on using hashes here.

File details

Details for the file zdbpydra-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: zdbpydra-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.5.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.12

File hashes

Hashes for zdbpydra-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 428b2113b86346c7ac66ca028fdc0849d5b59c7ba8675e70d6c014817fba3358
MD5 10c4915a2d16f29b96b4b8f6a68466cb
BLAKE2b-256 e0fdc7def0340c2014d6e445eb8278ba30d713ab7d59be07912b4beea2de156b

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