{"id":13299785,"url":"https://github.com/willingham/x12-utils","last_synced_at":"2025-03-10T11:32:38.779Z","repository":{"id":62589740,"uuid":"182472909","full_name":"willingham/x12-utils","owner":"willingham","description":"Utilities for generating and validating x12 EDI","archived":false,"fork":false,"pushed_at":"2024-08-24T14:08:22.000Z","size":21,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T00:03:43.352Z","etag":null,"topics":["edi","x12"],"latest_commit_sha":null,"homepage":null,"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/willingham.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-21T01:53:04.000Z","updated_at":"2024-08-24T14:08:26.000Z","dependencies_parsed_at":"2024-10-23T11:24:26.107Z","dependency_job_id":null,"html_url":"https://github.com/willingham/x12-utils","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willingham%2Fx12-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willingham%2Fx12-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willingham%2Fx12-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willingham%2Fx12-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willingham","download_url":"https://codeload.github.com/willingham/x12-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242843229,"owners_count":20194347,"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":["edi","x12"],"created_at":"2024-07-29T17:37:51.802Z","updated_at":"2025-03-10T11:32:38.471Z","avatar_url":"https://github.com/willingham.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# X12 Utils\nLightweight utilities for working with x12 EDI\n\n## Background \u0026 Purpose\nAround 2010, I started working with EDI in a limited capacity.  At the time, I had no clue what it was, and didn't seem to find too much free help on the internet.  So, after spending countless hours digging through vendor-specific companion guides and comparing them to previously generated EDI, I was finally able to understand what was going on.  \n\nI've been writing Python packages to generate EDI for various organizations since around 2013.  In those projects I have used string concatenatiion, Jinja templating, Django templating, and a few more methods to generate EDI.  After much trial and error, I landed on a method to generate the EDI that was easy to maintain.  That is the `x12_generator` included in this repository.\n\nSince there is another crucial step, validating the resulting EDI, I have also included the `x12_validator` module which is a lightweight wrapper around the great work done on [pyx12](https://github.com/azoner/pyx12) by @azoner.\n\n## Installation\n``` sh\npip install x12-utils\n```\n\n## Included Utilities\n### Generator\nThe `x12_generator` is a small helper for generating syntactically correct x12 EDI, however, does not assist in ensuring correct structure at all.\n#### Usage\n``` py\nfrom x12_utils.x12_generator import x12_generate\n\ngenerator_input = [\n    (\"ISA\", [\"00\", \"          \", \"00\", \"          \", \"ZZ\"]),\n    (\"GS\", [\"BE\", \"          \", \"00\", \"          \", \"ZZ\"]),\n    (\"ST\", [\"00\", \"          \", \"00\", \"          \", \"ZZ\"]),\n    (\"SE\", [\"00\", \"          \", \"00\", \"          \", \"ZZ\"]),\n    (\"GE\", [\"00\", \"          \", \"00\", \"          \", \"ZZ\"]),\n    (\"IEA\", [\"00\", \"          \", \"00\", \"          \", \"ZZ\"]),\n]\n\nedi = x12_generate(src=generator_input)\n\n# `edi` will look like:\n\n# ISA*00*          *00*          *ZZ~\n# GS*BE*          *00*          *ZZ~\n# ST*00*          *00*          *ZZ~\n# SE*00*          *00*          *ZZ~\n# GE*00*          *00*          *ZZ~\n# IEA*00*          *00*          *ZZ~\n#\n# Note: This is not structurally valid EDI, just an example to show the format.\n\n```\n\n### Validator\nThe `x12_validator` is a light wrapper around @azoner's [pyx12](https://github.com/azoner/pyx12) intended for use in other projects.\n#### Usage\n``` py\nfrom x12_utils.x12_validator import x12_validate\n\nresult = x12_validate(\n    src=edi,             # String or file-like object\n    params=None,         # Valid [pyx12](https://github.com/azoner/pyx12) params or None\n    generate_html=False, # Passed to [pyx12](https://github.com/azoner/pyx12)\n    generate_997=False,  # Passed to [pyx12](https://github.com/azoner/pyx12)\n    generate_xml=False,  # Passed to [pyx12](https://github.com/azoner/pyx12)\n)\n# Assuming valid EDI, `result` will look like\n# {\n#   \"997\": \"\",\n#   \"errors\": \"\",\n#   \"html\": \"\",\n#   \"ok\": True,\n#   \"xml\": \"\"\n# }\n\n```\n\n## Documentation\nJust read the code.  The docstrings explain it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillingham%2Fx12-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillingham%2Fx12-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillingham%2Fx12-utils/lists"}