{"id":20287091,"url":"https://github.com/devcsrj/docparsr-jvm","last_synced_at":"2026-06-08T10:33:09.471Z","repository":{"id":84464661,"uuid":"244585449","full_name":"devcsrj/docparsr-jvm","owner":"devcsrj","description":"JVM client for https://github.com/axa-group/Parsr","archived":false,"fork":false,"pushed_at":"2020-08-01T18:14:25.000Z","size":223,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T04:14:26.013Z","etag":null,"topics":["data","document","extraction","nlp","ocr","pdf"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/devcsrj.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-03T08:48:46.000Z","updated_at":"2020-08-01T18:14:28.000Z","dependencies_parsed_at":"2023-03-08T09:15:22.142Z","dependency_job_id":null,"html_url":"https://github.com/devcsrj/docparsr-jvm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devcsrj/docparsr-jvm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devcsrj%2Fdocparsr-jvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devcsrj%2Fdocparsr-jvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devcsrj%2Fdocparsr-jvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devcsrj%2Fdocparsr-jvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devcsrj","download_url":"https://codeload.github.com/devcsrj/docparsr-jvm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devcsrj%2Fdocparsr-jvm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34059156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["data","document","extraction","nlp","ocr","pdf"],"created_at":"2024-11-14T14:38:08.096Z","updated_at":"2026-06-08T10:33:09.456Z","avatar_url":"https://github.com/devcsrj.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Parsr\n\n![](https://img.shields.io/travis/devcsrj/docparsr-jvm)\n![](https://img.shields.io/github/license/devcsrj/docparsr-jvm)\n![](https://img.shields.io/maven-central/v/com.github.devcsrj/docparsr)\n\nThis project is a JVM client for [Axa group's Parsr](https://github.com/axa-group/Parsr) project.\n\n## Download\n\nGrab via Maven:\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.devcsrj\u003c/groupId\u003e\n    \u003cartifactId\u003edocparsr\u003c/artifactId\u003e\n    \u003cversion\u003e(version)\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nor Gradle:\n\n```\nimplementation(\"com.github.devcsrj:docparsr:$version\")\n```\n\n## Usage\n\nAssuming you have the [API server running](https://github.com/axa-group/Parsr#usage), you can communicate \nwith it using: \n\n```kotlin\nval uri = URI.create(\"http://localhost:3001\")\nval parser = DocParsr.create(uri)\n```\n\nThen, submit your file with:\n\n```kotlin\nval file = File(\"hello.pdf\")    // your pdf or image file\nval config = Configuration()    // or, 'parser.getDefaultConfig()`\nval job = parser.newParsingJob(file, config)\n```\n\nAt this point, the `job` object presents you with either synchronous:\n\n```kotlin\nval result = job.execute()\n``` \n\n...or asynchronous method:\n\n```kotlin\nval callback = object: Callback {\n    fun onFailure(job: ParsingJob, e: Exception) {}\n    fun onProgress(job: ParsingJob, progress: Progress) {}\n    fun onSuccess(job: ParsingJob, result: ParsingResult) {}\n}\njob.enqueue(callback)\n```\n\nRegardless of the approach you choose, you end up with a `ParsingResult`. You can then\naccess the [various generated output](https://github.com/axa-group/Parsr/blob/master/docs/api-guide.md#3-get-the-results)\nfrom the server with:\n\n```kotlin\nresult.source(Text).use {\n   // copy the InputStream\n}\n``` \n\nIf you are instead interested on the [JSON schema](https://github.com/axa-group/Parsr/blob/master/docs/json-output.md), this\nlibrary provides a [Visitor](https://en.wikipedia.org/wiki/Visitor_pattern) -based API:\n\n```kotlin\nval visitor = object: DocumentVisitor {\n   // override methods\n}\nval document = Document.from(result)\ndocument.accept(visitor) \n```\n\n## Building\n\nLike any other [gradle](https://github.com/axa-group/Parsr) -based project, you can build the artifacts\nwith:\n\n```\n$ ./gradlew build\n```\n\nThis project also includes functional test, which runs against an actual Parsr server. Assuming\nyou have [Docker](https://www.docker.com/) installed, run the tests with:\n\n```\n$ ./gradlew functionalTest\n```\n\n## Future work\n\n* [Key-Value pair metadata](https://github.com/axa-group/Parsr/blob/master/docs/json-output.md#31-key-value-pair-metadata)\n* [Drawing](https://github.com/axa-group/Parsr/blob/master/docs/json-output.md#126-drawing-type)\n* [Image](https://github.com/axa-group/Parsr/blob/master/docs/json-output.md#125-image-type)\n* [Barcode](https://github.com/axa-group/Parsr/blob/master/docs/json-output.md#125-image-type)\n* [Table](https://github.com/axa-group/Parsr/blob/master/docs/json-output.md#125-image-type)\n\n## Motivation\n\nWhen I was working on the [Klerk](https://github.com/devcsrj/klerk) project, I realized how difficult\nand time-consuming it is to scrape data from PDF documents. My approach then also involved the use of\nheavy witchcraft using [Tesseract](https://github.com/tesseract-ocr), because typical PDF-to-text libraries\njust don't cut it (especially on skewed, or garbled sections).\n\nThe [Parsr project](https://github.com/axa-group/Parsr) seems to also tackle the challenges I faced,\nand more. To keep the data extraction out of my [Beam](https://beam.apache.org/) pipeline, I wrote this\nlibrary.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcsrj%2Fdocparsr-jvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevcsrj%2Fdocparsr-jvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcsrj%2Fdocparsr-jvm/lists"}