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.2.0.tar.gz (20.8 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.2.0-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for transkribus_metagrapho_api-0.2.0.tar.gz
Algorithm Hash digest
SHA256 008930300b97cc427eb6632684c5c4b7398a74607ccb43d6aaa1a8d1464dc276
MD5 26af2a1d38e7210a4e33804dab237203
BLAKE2b-256 f1e91580ad833837936f795b670412826179174db33875218fc62ed5e9220274

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transkribus_metagrapho_api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fe29252d7947563f39ce9e75011aacb10d8d28a06031f105d158edf56fddbf7
MD5 517657b5fa920cce71b4b02dd0d7e6d3
BLAKE2b-256 8d53285663ba8f967c1739e9039fbf52b255a89d16934e7e8cfa281bba4e4b5d

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