acdh-transkribus-utils
A python package providing some utility functions for interacting with the Transkribus-API
Installation
pip install acdh-transkribus-utils
Usage
Authentication
Set Transkribus-Credentials as environment variables:
export TRANSKRIBUS_USER=some@mail.com
export TRANSKRIBUS_PASSWORD=verysecret
(or create a file called env.secret similar to env.dummy and run source export_env_variables.sh)
you can pass in your credentials also as params e.g.
import os
from transkribus_utils.transkribus_utils import ACDHTranskribusUtils
tr_user = os.environ.get("TRANSKRIBUS_USER")
tr_pw = os.environ.get("TRANSKRIBUS_PASSWORD")
client = ACDHTranskribusUtils(user=tr_user, password=tr_pw)
List all collections
collections = client.list_collections()
for x in collections[-7:]:
print(x["colId"], x["colName"])
# 188933 bv-play
# 188991 Kasten_blau_45_11
# 190357 acdh-transkribus-utils
# 193145 palm
# 195363 Österreichische Bundesverfassung: Datenset A
# 196428 Österreichische Bundesverfassung: Datenset B
# 196429 Österreichische Bundesverfassung: Datenset C
List all documents from a given collection
col_id = 142911
documents = client.list_docs(col_id)
n = -3
for x in documents[n:]:
print(x["docId"], x["title"], x["author"], x["nrOfPages"])
# 950920 Kasten_blau_44_9_0050 Pfalz-Neuburg, Eleonore Magdalena Theresia von 1
# 950921 Kasten_blau_44_9_0037 Pfalz, Johann Wilhelm Joseph Janaz von der 4
# 950922 Kasten_blau_44_9_0239 Pfalz, Johann Wilhelm Joseph Janaz von der 1
Download METS files from Collection
from transkribus_utils.transkribus_utils import ACDHTranskribusUtils
COL_ID = 51052
client = ACDHTranskribusUtils()
client.collection_to_mets(COL_ID)
# downloads a METS for each document in the given collection into a folder `./{COL_ID}
client.collection_to_mets(COL_ID, file_path='./foo')
# downloads a METS for each document in the given collection into a folder `./foo/{COL_ID}
client.collection_to_mets(COL_ID, filter_by_doc_ids=[230161, 230155])
# downloads only METS for document with ID 230161 and 230155 into a folder `./{COL_ID}
Metadata
Release files for acdh-transkribus-utils 2.11
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 |
|---|---|---|---|---|
| acdh-transkribus-utils-2.11.tar.gz | 9.7 kB | Without provenance | Details for acdh-transkribus-utils-2.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| acdh_transkribus_utils-2.11-py3-none-any.whl | Python 3 | none | any | Details for acdh_transkribus_utils-2.11-py3-none-any.whl |
Total release size: 20.8 kB
Release files / acdh-transkribus-utils-2.11.tar.gz
| Download URL | acdh-transkribus-utils-2.11.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
42180650d195f19dbc6b9f48e7b778db1971255642eb68b74e31408f38cecfa5
|
|
BLAKE2b-256 checksum How to use checksums |
b88abd0b4383d8a263879ed12f8867cd89e31cd7c2014d5abbc1b29ce32a729b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Release files / acdh_transkribus_utils-2.11-py3-none-any.whl
| Download URL | acdh_transkribus_utils-2.11-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
996ead10bfb4f4c4b52fca4de156d23f50ce16a859cd879cf3b479775ec482af
|
|
BLAKE2b-256 checksum How to use checksums |
7941797ea35673a55e04d0d22653ddcd45b971700025ba3015c2a32d7926464d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Security for acdh-transkribus-utils 2.11
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.