A python client for the Wilson Center Digital Archive API.
Project description
Digital Archive
A Python client for the Wilson Center's Digital Archive ("DA") of historical primary sources. This library provides an ORM for searching and accessing documents and other resources in the Digital Archive.
Installation
The client is available on pypi. It requires python 3.7+.
pip install digitalarchive
Usage
>>> import digitalarchive
# Search for documents:
>>> soviet_docs = digitalarchive.Document.match(title="soviet").all()
# Collections and other resource types are also searchable.
>> soviet_collections = digitalarchive.Collection.match(name="soviet")
# Grab a single, specific document:
>>> document = digitalarchive.Document.match(id="112566").first()
# Pull transcripts, translations, and original scans of documents:
>>> document.hydrate()
>>> document = test_doc.transcripts[0].html
# Pull the metadata and other assets for an entire resultset.
>>> chernobyl_docs = digitalarchive.Document.match(title="chernobyl")
>>> chernobyl_docs.hydrate()
>>> chernobyl_docs.all()
# Or just download all the documents!
>>> all_documents = digitalarchive.Document.match().all()
Complete documentation for the client and the Digital Archive's models are available here.
Disclaimers
- This is an unofficial library. I am not presently affiliated with the Wilson Center. I understandthat the API is unlikely to change in the near future, but I cannot guarantee that this library won't break without warning.
- If you plan to scrape the DA, please be respectful.
Planned Features
- Support for searching by date range.
- Asynchronous hydration of large result sets.
- For Collections, inlcude keyword hits in
short_description
for searches. (modify collection searches to use therecord.json
instead ofcollection.json
endpoint.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
digitalarchive-0.1.12.tar.gz
(15.5 kB
view details)
Built Distribution
File details
Details for the file digitalarchive-0.1.12.tar.gz
.
File metadata
- Download URL: digitalarchive-0.1.12.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a7190a575b1a881038a3917dc3d7fa24736016b28fe92bc2f8601c48bf9c7a3 |
|
MD5 | 95cd9f762502cf74cfd663f194969e56 |
|
BLAKE2b-256 | e09cac119c0b3e424dd9e798d91e63011fa789d089ffbef0262758eb26f26bb9 |
File details
Details for the file digitalarchive-0.1.12-py3-none-any.whl
.
File metadata
- Download URL: digitalarchive-0.1.12-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91507ad575e741bf0f49cee369f1bf857e63ed8592b5c8da14dc04aecd375c7b |
|
MD5 | b160ab5e8f2a316281cfec5fc1c0cff0 |
|
BLAKE2b-256 | b881013fadaa1c53495ffe44d9f7b3b563ae9857d9610dbc34dcf295e9aa1f9b |