CERL library
Python bindings for the Consortium of European Research Library's API.
See /docs/docs.ipynb for a Jupyter notebook with additional documentation
Basic example
from cerl import ample_query, ample_record, ids_from_result, by_dot, the
# Connect to any AMPLE instance
ct = 'data.cerl.org/thesaurus'
# Run a search query
result = ample_query(ct, 'Purslowe, Elizabeth')
for idx in ids_from_result(result):
# Download the record as a Python dict
record = ample_record(ct, idx)
# Access the record by dot notation
cid = the(by_dot(record, '_id'))
assert cid == idx
Installation
pip3 install cerl
Features
- Access to any AMPLE instance by specifying the
hoststring (e.g. "data.cerl.org/thesaurus")- Some databases hardcoded as syntactic sugar:
CTISTCHOLDINSTMEI
- Some databases hardcoded as syntactic sugar:
- Use the standard search syntax with
ample_query- The same databases hardcoded as syntactic sugar:
ct_queryetc.
- The same databases hardcoded as syntactic sugar:
- Download records as Python
dictobjects withample_record- Again,
ct_recordetc.
- Again,
- Download records in other formats with
ample_record_export- Again,
ct_record_exportetc. - Export formats supported (but not all for each database):
- rdf/ttl
- rdf/xml
- rdf/jsonld
- json
- yaml
- unimarc
- Again,
- Access to record fields using the dot notation from search syntax via
by_dot(NOTE: always returns alistof results)- If you know there is only one object/value being returned, wrap in
the - Syntactic sugar around some fields:
- Resolve CT record types with
ct_record_type - Get the CID (CERL ID) with
cid
- Resolve CT record types with
- If you know there is only one object/value being returned, wrap in
- Add a timestamp to a record after modifying it with
add_timestamp
Metadata
Release files for cerl 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cerl-0.0.5.tar.gz | 5.3 kB | Without provenance | Details for cerl-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cerl-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for cerl-0.0.5-py3-none-any.whl |
Total release size: 11.0 kB
Release files / cerl-0.0.5.tar.gz
| Download URL | cerl-0.0.5.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e41d2e92ea9bac621c2e1c0aceb86920aa065ebbcc0b3ba166a8a6806c489c8c
|
|
BLAKE2b-256 checksum How to use checksums |
b028d6f6682febec2436ad65a8f32467aef160b7edf416f39d1a8c8760e82aa2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
|
Release files / cerl-0.0.5-py3-none-any.whl
| Download URL | cerl-0.0.5-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4efb63eaf1ff1e0903a6749a26f6725a3d04c0cd94e0aac81920a67ccc99e6dd
|
|
BLAKE2b-256 checksum How to use checksums |
b1aadb7d2503eebae186860a9115911933b09e15ef3977c3ebe901837295e5de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
|
Security for cerl 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.