{"id":24911658,"url":"https://github.com/svolodarskyi/invoice-parser","last_synced_at":"2025-10-13T04:04:44.785Z","repository":{"id":181989024,"uuid":"354409090","full_name":"svolodarskyi/invoice-parser","owner":"svolodarskyi","description":"Python parser library for extracting data from machine generated pdf invoice","archived":false,"fork":false,"pushed_at":"2021-04-08T15:35:52.000Z","size":46,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T04:04:44.394Z","etag":null,"topics":["automation","business","workflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/svolodarskyi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-04-03T22:43:10.000Z","updated_at":"2025-05-24T05:53:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a008db2-4496-4251-884d-c0e80ad37eb3","html_url":"https://github.com/svolodarskyi/invoice-parser","commit_stats":null,"previous_names":["svolodarskyi/invoice-parser"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/svolodarskyi/invoice-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svolodarskyi%2Finvoice-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svolodarskyi%2Finvoice-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svolodarskyi%2Finvoice-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svolodarskyi%2Finvoice-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svolodarskyi","download_url":"https://codeload.github.com/svolodarskyi/invoice-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svolodarskyi%2Finvoice-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013604,"owners_count":26085389,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"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":["automation","business","workflow"],"created_at":"2025-02-02T04:29:21.376Z","updated_at":"2025-10-13T04:04:44.744Z","avatar_url":"https://github.com/svolodarskyi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Invoice Parser for Account Payable Automation\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Setup](#setup)\n- [Templates](#templates)\n- [Usage](#usage)\n\n## Overview\n\nThis library was developed for a purpose of accounts payable automation in a real-life company.\nIt can be used as a standalone solution or as a part of a workflow.\n\nAt this point it is working only with machine generated pdf files. \n\nOCR functionality will added at the next iterations.\n\nText extraction is handled by [PdfPlumber library](https://github.com/jsvine/pdfplumber).\n\n## Setup\n\nTo use the project you need to install the dependencies listed in the `requirements.txt` file.\nDependencies can be installed by running the following command:\n\n```console\npip install -r requirements.txt\n```\n\n## Templates\nThis library supposes that each vendor has a separate template. \n\nTemplates are the collection of patterns (regular extpessions) and other parameters stored in JSON file. \nPatterns are used for extracting data from the invoice.\n\nTemplate JSON file can store any other parameters. The libary is not restricted to any specific format of the templates. \n\n#### Steps for adding vendor template:\n1. Creating JSON file with a template.\n2. Adding created template to the Template Mapping JSON file.\n\nTo see the example of template handling, refer to the section `Usage` below and `sample` folder of the repository. \n\n## Usage\n\nBelow is an example of using the `invoice-parser` library.\n\n```python\nfrom invoiceparser.loader import Loader\nfrom invoiceparser.pdfparser import PdfParser\nfrom invoiceparser.invoice import Invoice\nfrom invoiceparser.matcher import Matcher\nfrom invoiceparser.templatehandler import TemplateHandler\nfrom invoiceparser.datacollector import DataCollector\n\n\n# if GUI is used for the front-end, below variable will be passed from it\nvendorname = 'Vendor1'\ntemplatemapping = 'TemplateMapping.json'\nfolder_with_pdf = 'C:/Users/user/invoiceparser/src'\noutput_folder = 'C:/Users/user/invoiceparser/'\n\n#loading pdf files\nfiles = Loader.get_pdf_files(folder_with_pdf)\n\n#loading the template\ntemplate = TemplateHandler.load_template(templatemapping, vendorname)\n\n#creating repository for storing parsed data\nparsed_data = DataCollector()\n\nfor f in files:\n\n    inv = Invoice(template, PdfParser.extract_raw_text(f))\n\n    invdata = {}\n\n    # loaded template contains value indicator.\n    # it specifies if value contains regular expression or not.\n  \n    for key, value in inv.template.items():\n        if inv.template[key][0] == 'regex':\n            invdata[key], inv.text = Matcher.find_match(inv.template[key][1], inv.text)\n        else:\n            invdata[key] = inv.template[key][1]\n            \n    # adding invoice data to repository\n    parsed_data.add(invdata)\n\n#viewing dataframe with parsed data\nprint(parsed_data.dataframe)\n\n#save to excel, if needed\nparsed_data.save_to_excel(output_folder)\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvolodarskyi%2Finvoice-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvolodarskyi%2Finvoice-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvolodarskyi%2Finvoice-parser/lists"}