{"id":24553259,"url":"https://github.com/ocr-d/page-to-alto","last_synced_at":"2026-01-12T02:48:12.625Z","repository":{"id":44576207,"uuid":"353091333","full_name":"OCR-D/page-to-alto","owner":"OCR-D","description":"Convert PAGE (v. 2019) to ALTO (v. 2.0 - 4.2)","archived":false,"fork":false,"pushed_at":"2024-10-10T15:52:02.000Z","size":459,"stargazers_count":14,"open_issues_count":12,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-21T10:11:38.466Z","etag":null,"topics":["ocr-d"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OCR-D.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-30T17:48:31.000Z","updated_at":"2025-01-03T04:30:29.000Z","dependencies_parsed_at":"2024-01-11T15:40:30.729Z","dependency_job_id":"c39f1ad3-d58b-4fdf-a3ce-04eef21e747a","html_url":"https://github.com/OCR-D/page-to-alto","commit_stats":null,"previous_names":["ocr-d/page-to-alto"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCR-D%2Fpage-to-alto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCR-D%2Fpage-to-alto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCR-D%2Fpage-to-alto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCR-D%2Fpage-to-alto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OCR-D","download_url":"https://codeload.github.com/OCR-D/page-to-alto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235213319,"owners_count":18953731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ocr-d"],"created_at":"2025-01-23T01:45:07.562Z","updated_at":"2026-01-12T02:48:12.563Z","avatar_url":"https://github.com/OCR-D.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ocrd-page-to-alto\n\n\u003e Convert PAGE (v. 2019) to ALTO (v. 2.0 - 4.2)\n\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/OCR-D/page-to-alto/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/OCR-D/page-to-alto/tree/master)\n\n\n## Introduction\n\nThis software converts PAGE XML files to the ALTO XML OCR result format. It\nenables using PAGE XML generating software in a context where ALTO is needed\nto display the results, i.e. in libraries.\n\n## Installation\n\nIn a Python virtualenv:\n```\nmake install     # or pip install .\n# or to install from PyPI\npip install ocrd_page_to_alto\n```\n\n## Usage\n\nTo convert the PAGE XML document `example.xml` to ALTO:\n\n    page-to-alto example.xml \u003e example.alto.xml\n\nYou can get an exhaustive list of page-to-alto's many options with `--help`:\n\u003cdetails\u003e\u003csummary\u003eCLI\u003c/summary\u003e\n\u003cp\u003e\n\u003cpre\u003e\nUsage: page-to-alto [OPTIONS] FILENAME\n  Convert PAGE to ALTO\nOptions:\n  -l, --log-level [OFF|ERROR|WARN|INFO|DEBUG|TRACE]\n                                  Log level\n  --alto-version [4.2|4.1|4.0|3.1|3.0|2.1|2.0]\n                                  Choose version of ALTO-XML schema to produce\n                                  (older versions may not preserve all\n                                  features)\n  --check-words / --no-check-words\n                                  Check whether PAGE-XML contains any Words\n                                  and fail if not\n  --check-border / --no-check-border\n                                  Check whether PAGE-XML contains Border or\n                                  PrintSpace\n  --skip-empty-lines / --no-skip-empty-lines\n                                  Whether to omit or keep empty lines in PAGE-\n                                  XML\n  --trailing-dash-to-hyp / --no-trailing-dash-to-hyp\n                                  Whether to add a \u003cHYP/\u003e element if the last\n                                  word in a line ends in \"-\"\n  --dummy-textline / --no-dummy-textline\n                                  Whether to create a TextLine for regions\n                                  that have TextEquiv/Unicode but no TextLine\n  --dummy-word / --no-dummy-word  Whether to create a Word for TextLine that\n                                  have TextEquiv/Unicode but no Word\n  --textequiv-index INTEGER       If multiple textequiv, use the n-th\n                                  TextEquiv by @index\n  --textequiv-fallback-strategy [raise|first|last]\n                                  What to do if nth textequiv isn't available.\n                                  'raise' will lead to a runtime error,\n                                  'first' will use the first TextEquiv, 'last'\n                                  will use the last TextEquiv on the element\n  -O, --output-file FILE          Output filename (or \"-\" for standard output,\n                                  the default)\n  -h, --help                      Show this message and exit.\n\u003c/pre\u003e\n\u003c/p\u003e\n\u003c/details\u003e\n\nTo process an OCR-D workspace, use\n[ocrd_fileformat](https://github.com/OCR-D/ocrd_fileformat), which uses\npage-to-alto by default:\n```\nocrd-fileformat-transform -I OCRD-OCR-OUTPUT-PAGE -O OCRD-OCR-OUTPUT-ALTO \\\n  -P script-args \"--dummy-word --no-check-words --no-check-border\"\n```\n\n\n## TODO\n\n* [ ] AlternativeImage\n* [ ] unmappable regions\n* [x] handle Border\n* [x] TextStyle\n* [x] ParagraphStyle\n* [x] table regions\n* [ ] recursive regions for *Region\n* [x] Set `PAGECLASS` from `pc:Page/@type` #4\n* [ ] Layers / z-level via `StructureTag`? #4\n* [x] `\u003cSP/\u003e`\n* [X] `\u003cHYP/\u003e`\n* [ ] rotation\n* [x] reading order\n* [x] input PAGE-XML not having words #5\n* [x] multiple pc:TextEquivs\n* [x] language\n* [X] ~~script~~ no equivalent in ALTO :(\n* [X] ~~kerning~~ no equivalent in ALTO :(\n* [X] ~~underlineStyle~~ no equivalent in ALTO :(\n* [X] ~~bgColour~~ no equivalent in ALTO :(\n* [X] ~~bgColourRgb~~ no equivalent in ALTO :(\n* [X] ~~reverseVideo~~ no equivalent in ALTO :(\n* [X] ~~xHeight~~ no equivalent in ALTO :(\n* [X] ~~letterSpaced~~ no equivalent in ALTO :(\n* [x] ProcessingStep\n* [x] differentiate/select ALTO versions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focr-d%2Fpage-to-alto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focr-d%2Fpage-to-alto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focr-d%2Fpage-to-alto/lists"}