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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for transkribus_metagrapho_api-0.3.1.tar.gz
Algorithm Hash digest
SHA256 388eaf13740327fb2507dd7633546dc6569ff1e1456170653741dc78bb9e3c12
MD5 024455113292a9c4fbf40382c6c2a5cf
BLAKE2b-256 2a8a447f3f0852c88e8ad39c7d21a7132e7d1d0ab4526fc33835065c0e6af419

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transkribus_metagrapho_api-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e8bf93cecccec2c4c1b8a7deb6a828a6605d141a69412746343a6158c9b4174
MD5 231fd36502d27dcd6caf520ad23adf15
BLAKE2b-256 ff917c3d7fe6c42d951771b7eead1dc7b48b4bfc3ecc190de9d8c6537de6021d

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