{"id":13856757,"url":"https://github.com/neuml/txtmarker","last_synced_at":"2025-10-31T21:27:05.189Z","repository":{"id":53141559,"uuid":"317989970","full_name":"neuml/txtmarker","owner":"neuml","description":"Highlight text in documents","archived":false,"fork":false,"pushed_at":"2023-09-23T13:09:35.000Z","size":854,"stargazers_count":73,"open_issues_count":8,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-17T07:41:40.288Z","etag":null,"topics":["highlight","pdf","python","search","text"],"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/neuml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-02T20:59:45.000Z","updated_at":"2024-11-05T17:54:15.000Z","dependencies_parsed_at":"2022-09-16T08:20:11.535Z","dependency_job_id":null,"html_url":"https://github.com/neuml/txtmarker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuml%2Ftxtmarker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuml%2Ftxtmarker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuml%2Ftxtmarker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuml%2Ftxtmarker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neuml","download_url":"https://codeload.github.com/neuml/txtmarker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225912249,"owners_count":17544132,"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":["highlight","pdf","python","search","text"],"created_at":"2024-08-05T03:01:12.040Z","updated_at":"2025-10-31T21:27:05.152Z","avatar_url":"https://github.com/neuml.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/neuml/txtmarker/master/logo.png\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cb\u003eHighlight text in documents\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/neuml/txtmarker/releases\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/release/neuml/txtmarker.svg?style=flat\u0026color=success\" alt=\"Version\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/neuml/txtmarker/releases\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/release-date/neuml/txtmarker.svg?style=flat\u0026color=blue\" alt=\"GitHub Release Date\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/neuml/txtmarker/issues\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/issues/neuml/txtmarker.svg?style=flat\u0026color=success\" alt=\"GitHub issues\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/neuml/txtmarker\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/last-commit/neuml/txtmarker.svg?style=flat\u0026color=blue\" alt=\"GitHub last commit\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/neuml/txtmarker/actions?query=workflow%3Abuild\"\u003e\n        \u003cimg src=\"https://github.com/neuml/txtmarker/workflows/build/badge.svg\" alt=\"Build Status\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://coveralls.io/github/neuml/txtmarker?branch=master\"\u003e\n        \u003cimg src=\"https://img.shields.io/coverallsCoverage/github/neuml/txtmarker\" alt=\"Coverage Status\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n-------------------------------------------------------------------------------------------------------------------------------------------------------\n\n![demo](https://raw.githubusercontent.com/neuml/txtmarker/master/demo.png)\n\ntxtmarker highlights text in documents. txtmarker takes a list of (name, text) pairs, scans an input document and creates a modified version with highlights embedded.\n\nCurrent file formats supported:\n\n- pdf\n\n## Installation\nThe easiest way to install is via pip and PyPI\n\n```\npip install txtmarker\n```\n\nPython 3.10+ is supported. Using a Python [virtual environment](https://docs.python.org/3/library/venv.html) is recommended.\n\ntxtmarker can also be installed directly from GitHub to access the latest, unreleased features.\n\n```\npip install git+https://github.com/neuml/txtmarker\n```\n\n## Examples\n\nThe examples directory has a series of examples and notebooks giving an overview of txtmarker. See the list of notebooks below.\n\n### Notebooks\n\n| Notebook     |      Description      |   |\n|:----------|:-------------|------:|\n| [Introducing txtmarker](https://github.com/neuml/txtmarker/blob/master/examples/01_Introducing_txtmarker.ipynb) | Overview of the functionality provided by txtmarker | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtmarker/blob/master/examples/01_Introducing_txtmarker.ipynb) |\n| [Highlighting with Transformers](https://github.com/neuml/txtmarker/blob/master/examples/02_Highlighting_with_Transformers.ipynb) | AI-driven highlighting with Transformers | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuml/txtmarker/blob/master/examples/02_Highlighting_with_Transformers.ipynb) |\n\n\n## Configuration\n\nThe following section gives an overview of highlighters and available methods/configuration. See the notebooks above for detailed examples.\n\n### Create a new highlighter\n\nCreates a new highlighter instance.\n\n```python\nfrom txtmarker.factory import Factory\nhighlighter = Factory.create(\"pdf\")\n```\n\n#### extension\n```yaml\nextension: string\n```\n\nType of highlighter to create (i.e. pdf)\n\n#### Optional constructor arguments:\n\n#### formatter\n```yaml\nformatter: callable\n```\n\nFormats queries and input text using this method. Helps with cleanup of files with lots of symbols and other content.\n\n#### chunks\n```yaml\nchunks: int\n```\n\nSplits queries into multiple chunks. This is designed for very long text matches.\n\n### Page text\n\nExtracts page text from `infile` and returns as a generator. This enables analysis on the text exactly as it will appear to the highlighter.\n\n```python\nhighlighter.pages(\"input.pdf\")\n```\n\n#### infile\n```yaml\ninfile: string\n```\n\nFull path to input file\n\n### Highlight text\n\nHighlights using provided annotations. Annotated file is stored as `outfile`.\n\n```python\nhighlighter.highlight(\"input.pdf\", \"output.pdf\", [(\"name\", \"text to highlight\")])\n```\n\n#### infile\n```yaml\ninfile: string\n```\n\nFull path to input file\n\n#### outfile\n```yaml\noutfile: string\n```\n\nFull path to output file, i.e. the highlighted file\n\n#### highlights\n```yaml\nhighlights: list of (string, string|regex)\n```\n\nList of highlight elements. Each pair has a name (can be None) and text value. The text can either be a string or a regular expression. When using string matching, make sure to escape regular expressions (i.e. call `re.escape`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuml%2Ftxtmarker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuml%2Ftxtmarker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuml%2Ftxtmarker/lists"}