Skip to main content

Transkribus Metagrapho API Client.

Project description

Transkribus Processing API Client

Tests pypi Version

Python bindings for the Transkribus Metagrapho/Processing API.

Usage

with ContextManager

from time import sleep
from transkribus_metagrapho_api import transkribus_metagrapho_api

with transkribus_metagrapho_api(USERNAME, PASSWORD) as api:
    process_id = api.process(IMAGE_PATH, line_detection=49272, htr_id=51170)
    while True:
        match api.status(process_id).upper():
            case "FINISHED":
                print(api.apge(process_id))
                break
            case "FAILED":
                print("FAILED")
                break
        sleep(10)

or

with transkribus_metagrapho_api(USERNAME, PASSWORD) as api:
    for image_path, page_xml in zip(IMAGES, api(IMAGES*, line_detection=49272, htr_id=51170)):
        with open(
            Path(image_path.parent, image_path.name.replace(image_path.suffix, ".xml")),
            "w",
            encoding="utf8"
        ) as f:
            f.write(page_xml)

from command line

$ python3 -m transkribus_metagrapho_api --username USERNAME --password PASSWORD --images images/*.tiff

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

transkribus_metagrapho_api-0.3.2.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

transkribus_metagrapho_api-0.3.2-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file transkribus_metagrapho_api-0.3.2.tar.gz.

File metadata

File hashes

Hashes for transkribus_metagrapho_api-0.3.2.tar.gz
Algorithm Hash digest
SHA256 9b0c5e5658ec7c989c8cd61183da31316f7b2d936fd5e3a92de647d1245e36b6
MD5 e432c738fe5c6bc8232c30f09f89d127
BLAKE2b-256 30aa66ba3d9d3fd82a8cbd9c4270289725d13be45a8c69cf15e81ab2e8311816

See more details on using hashes here.

File details

Details for the file transkribus_metagrapho_api-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for transkribus_metagrapho_api-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d30149c68427c8dfd68a88ccd8bc4ca19e9e9777cb6019e176cec4a353daa465
MD5 becc09898cfc96ad44ddf3b5ed7c3588
BLAKE2b-256 efa48e747b947fbd70e3f2dbbf27f5737366c9ce1b7afb6752b8c0b339d0adef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page