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 details)
Built Distribution
File details
Details for the file sruthi-0.0.1.tar.gz
.
File metadata
- Download URL: sruthi-0.0.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afccd977f35838c67cfbf8872b6db4048b9203a8c91e7bec63018165e6dcf51e |
|
MD5 | 96942ead96575ba3b61b7fccf54f1680 |
|
BLAKE2b-256 | 660b66493d52f1217a2b35d8b048fc30592350f85803876e23af4f8a954dfe4b |
File details
Details for the file sruthi-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: sruthi-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75ad62f161481082c4531a405952c09bc1da4051eb7c67d494ce25551e2ce284 |
|
MD5 | 5ec3fe531e631dc03cd9a3086cfae592 |
|
BLAKE2b-256 | acd32cf22ea925c5be29836c2ba254eba4b5c33bc2aee15ee172f58fea70fae5 |