pyx12
HIPAA X12 validator, parser and converter
Decision gist · record as of 2026-08-14
Yes. Pyx12 is a stable, actively maintained library with low install friction, no security vulnerabilities, and a permissive license. It is the standard choice for X12 EDI parsing and validation in Python, especially for healthcare workflows. Install it if you need to work with ANSI X12 documents or HIPAA EDI compliance.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or later.
- X12 Implementation Guide maps must be present in pyx12/map/ for the transaction type and version being parsed.
- Low friction: pure Python wheel with a single runtime dependency (defusedxml).
License · maintenance · safety
BSD (permissive) — BSD permissive license allows commercial and private use with minimal restrictions, making it suitable for proprietary healthcare applications.
last release 2026-05-05 (101 days) · last repo commit 2026-05-06 · 188 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 260,401 downloads/mo, #8,397 on PyPI
Alternatives
Verify before relying
import pyx12.x12context
src = pyx12.x12context.X12ContextReader(param, errh, fd_in)
for datatree in src.iter_segments('2300'):
for loop2400 in datatree.select('2400'):
value = loop2400.get_value('SV101')
loop2400.set_value('SV102', 'xx')- Whether the package handles all common X12 transaction types (270, 271, 276, 277, 278, 834, 837, 841) or only a subset
- Performance characteristics when processing large EDI files or high-volume streams
- Whether custom validation rules or code lists can be extended beyond the bundled maps
What it is and what it does
Pyx12 is a HIPAA-focused X12 EDI parser and validator that reads ANSI X12 data files and validates them against X12 Implementation Guidelines. It generates standard 997 (for 4010) and 999 (for 5010) functional acknowledgments, detects and can fix common structural errors (loop/segment counting, line breaks), and converts between X12 and XML representations. The package ships with implementation-guide maps for multiple transaction types and versions; its design is transaction-agnostic, so new X12 transaction types can be added by registering new XML maps.
The library exposes a Python API for iterating over X12 loops and segments, reading and modifying values, and checking segment existence. It also provides command-line tools (x12valid, x12norm) for validation and normalization workflows. The single runtime dependency is defusedxml, used for safe XML parsing. Maintenance is active, with support for modern Python versions (3.11–3.14) and no known vulnerabilities.
Use it for
- Validate incoming healthcare EDI claims (837) or eligibility requests (270) against HIPAA X12 standards before processing
- Convert X12 EDI files to XML for integration with systems that consume structured XML data
- Generate 997/999 functional acknowledgments to confirm receipt and validation status of X12 documents
- Normalize malformed X12 files by fixing segment/loop counts and line-break issues before downstream processing
- Build healthcare data pipelines that parse and extract specific claim or eligibility data from X12 loops and segments
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Pyx12 is a stable, actively maintained library with low install friction, no security vulnerabilities, and a permissive license. It is the standard choice for X12 EDI parsing and validation in Python, especially for healthcare workflows. Install it if you need to work with ANSI X12 documents or HIPAA EDI compliance.
Install
pyx12 on PyPI
Before you install
Low friction: pure Python wheel with a single runtime dependency (defusedxml). Active maintenance with a recent release (101 days ago) and steady repository activity. Supports current Python versions (3.11–3.14).
Requires Python 3.11 or later. X12 Implementation Guide maps must be present in pyx12/map/ for the transaction type and version being parsed.
License in practice
BSD permissive license allows commercial and private use with minimal restrictions, making it suitable for proprietary healthcare applications.
Quickstart
import pyx12.x12context
src = pyx12.x12context.X12ContextReader(param, errh, fd_in)
for datatree in src.iter_segments('2300'):
for loop2400 in datatree.select('2400'):
value = loop2400.get_value('SV101')
loop2400.set_value('SV102', 'xx')
Verify before relying
- Whether the package handles all common X12 transaction types (270, 271, 276, 277, 278, 834, 837, 841) or only a subset
- Performance characteristics when processing large EDI files or high-volume streams
- Whether custom validation rules or code lists can be extended beyond the bundled maps
Package facts
| License | BSD permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagedefusedxml |
| Maintenance | Actively maintained 101 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 260,401 / month, #8,397 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Healthcare IndustryLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Office/BusinessTopic :: Software Development :: Libraries :: Python Modules |
Evidence: pyx12-4.0.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “x12 edi parser validator”
- pyx12Pyx12 parses, validates, and converts ANSI X12 EDI documents against…
- pydifactPydifact parses and serializes UN/EDIFACT interchange files, allowing…
- pyas2libBuilds and parses AS2 protocol messages with compression, signing,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also pydifact · hl7 · swagger-spec-validator · hl7apy · bids-validator · word2number · roman-numerals · ofxtools · iregexp-check · rfc3986-validator