Skip to main content

SRU client for Python

Project description

sruthi is a client for python to make SRU requests (Search/Retrieve via URL).

Contents

Usage

import sruthi

records = sruthi.searchretrieve('https://suche.staatsarchiv.djiktzh.ch/SRU/', query='Zurich')

for record in records:
    # print fields from schema
    print(record['reference'])
    print(record['title'])
    print(record['date'])
    print(record['extra']['link']) # extra record data is available at the 'extra' key
# you can get more information at each step
import sruthi

# note: records is an iterator
records = sruthi.searchretrieve'https://suche.staatsarchiv.djiktzh.ch/SRU/', query='Human')
print(records.cql)
print(records.sru_version)
print(records.count)

for record in records:
    print(record)
    print(record['schema'])
import sruthi

info = sruthi.explain('https://suche.staatsarchiv.djiktzh.ch/SRU/')
print(info.server)
print(info.database)
print(info.index)
print(info.schema)

Schemas

sruthi does not make any assumptions about the record data schema. The data is provided as-is (as a flattend dict). sruthi has been tested with the following schemas:

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

sruthi-0.0.1.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

sruthi-0.0.1-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

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