{"id":22467931,"url":"https://github.com/openbookpublishers/obp-gen-xml","last_synced_at":"2026-05-17T08:34:40.923Z","repository":{"id":87180712,"uuid":"214404760","full_name":"OpenBookPublishers/obp-gen-xml","owner":"OpenBookPublishers","description":"Docker wrapper for OBP XML-last tool","archived":false,"fork":false,"pushed_at":"2022-10-20T10:28:01.000Z","size":5179,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-07T01:47:33.704Z","etag":null,"topics":["docker","epub","xml"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenBookPublishers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2019-10-11T10:08:55.000Z","updated_at":"2023-03-02T21:05:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"e455572f-1a41-4bbf-82a6-e715b60cffbd","html_url":"https://github.com/OpenBookPublishers/obp-gen-xml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OpenBookPublishers/obp-gen-xml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBookPublishers%2Fobp-gen-xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBookPublishers%2Fobp-gen-xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBookPublishers%2Fobp-gen-xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBookPublishers%2Fobp-gen-xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenBookPublishers","download_url":"https://codeload.github.com/OpenBookPublishers/obp-gen-xml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBookPublishers%2Fobp-gen-xml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33131979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T06:27:06.342Z","status":"ssl_error","status_checked_at":"2026-05-17T06:26:59.432Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["docker","epub","xml"],"created_at":"2024-12-06T11:14:11.370Z","updated_at":"2026-05-17T08:34:40.908Z","avatar_url":"https://github.com/OpenBookPublishers.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# obp-gen-xml\nWrapper to produce the XML editions of OBP books.\n\n## Run with docker\n```\ndocker run --rm \\\n  -v /path/to/local.epub:/ebook_automation/epub_file.epub \\\n  -v /path/to/local.xml:/ebook_automation/epub_file.xml \\\n  -v /path/to/output:/ebook_automation/output \\\n  openbookpublishers/obp-gen-xml\n```\n\nAlternatively you may clone the repo, build the image using `docker build . -t some/tag` and run the command above replacing `openbookpublishers/obp-gen-xml` with `some/tag`.\n\n## Run locally\n### Setup\nThis wrapper requires `saxonb-xslt` and `python3-bs4` to be installed on your system. On Debian (or Debian-based distributions) this package can be installed via\n\n`apt-get install libsaxonb-java python3-bs4`\n\nTo perform the setup, run:\n\n`bash setup`\n\nThe setup contains the necessary instruction to initialise the submodule.\n\n### Conversion\nTo start the conversion, place the **epub file** and the **DOI deposit** in the _obp-gen-xml_ folder. Finally, run:\n\n`bash run prefix`\n\nwhere _prefix_ is the name of the book and the DOI deposit files; i.e.: `bash run Siklos-Advanced_Problems2`.\n\n### Clean-up\n\n`bash clean [-y]`\n\nwould remove temporary files (untracked files and folders) from the _obp-gen-xml_ folder. The script asks for the user's confirmation before removing the files, but if you are running this as part of a script you might want to use the`-y` flag to bypass the confirmation.\n\n## DEV\n### ./src/tailor_book_transformation.py\nThis suite of scripts works as expected, but the introduction of `tailor_book_transform.py` is to be regarded as a _temporary patch_.\n\nThe stylesheet `Transform-to-XML-book.xsl` merges together XML files of the book sections. This is performed by tentative _includes_ of possible filenames hardcoded in the spreadsheet. All this works smoothly with the XML parser embedded in Oxygen, but the (apparently less tolerant) XML parser that `saxonb-xslt` uses fails at the first occurrence of a missing file.\n\n`tailor_book_transform.py` creates a temporary and simplified version of `Transform-to-XML-book.xsl` which lists only the successful includes.\n\nThere are a number of possible solutions, including (a) forcing `saxonb-xslt` to use a different XML parser and (b) re-write the `Transform-to-XML-book.xsl` to make its list of includes more precise.\n\n### Crossref schema version\nThe suite of XSL files stored in `XML-last` fail if the Crossref schema version declared in the DOI deposit does not correspond with the one hardcoded in the stylesheets.\n\nSince the version of our DOI deposit changed over the time, we need a resilient system able to process the all the deposits. The small collection of scripts stored in `./src.` serve for this purpose:\n -  `./src/extract_schema_version.py` reads the schema version declared in the DOI deposit;\n -  `./src/tailor_book_transformation.py` and `./src/tailor_section_transformation.py` produces compatible variations of the stylesheets. Please, note that `./src/tailor_book_transformation.py` has extra instructions described in this DEV section of the readme file.\n\n## PEP Enforcement\nUse `pre-commit.sh` as a pre commit git hook to build a test image that will run `flake8` to enforce PEP8 style.\n\n```\nln -sf ../../pre-commit.sh .git/hooks/pre-commit\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenbookpublishers%2Fobp-gen-xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenbookpublishers%2Fobp-gen-xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenbookpublishers%2Fobp-gen-xml/lists"}