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.0.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.0-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for transkribus_metagrapho_api-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a35c90a3da4f1f9bd953e7ae707a4a8ce3aa495a34af5fee564daa92531a0f7e
MD5 6366f6cfea9b83da7b9f8920ce8cd7cd
BLAKE2b-256 4498cd41f4ea535af0c9f3e00748264ba3b46dd219d2def62e17afe87115c7a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transkribus_metagrapho_api-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f7500b3b3874c2915c2d5b566d8dee3c69840c4a613277268fbeab37e03c3ac
MD5 83cfb4ff65dbb40ab65b149d60e1ea1f
BLAKE2b-256 c3a9cf60492fffdfe1792b6b47068a7a33099a4d75c3ac231185317ff51026a1

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