Skip to main content

YediPy

X12 EDI, as typed Python objects.

YediPy is a free, MIT-licensed Python library for reading, inspecting, and structurally validating X12 EDI. Preserve the original bytes while working with named fields, typed values, and structured diagnostics.

It includes 32 healthcare transaction models across X12 004010, 005010, and 005010 pre-errata, covering eligibility, claim status, authorizations, enrollment, payments, claims, and acknowledgments.

Supported transaction families: 270, 271, 276, 277, 277A, 278, 820, 820 HIX, 834, 835, 837D, 837I, 837P, and 999. Availability varies by release; see the transaction coverage table.

What It Does

  • Detects separators from a fixed-width ISA header.
  • Preserves the original source bytes, segment order, elements, and byte offsets.
  • Validates ISA/IEA, GS/GE, and ST/SE nesting, control numbers, and counts.
  • Slices one interchange into ordered ST/SE transactions.
  • Provides a shared parsing API for all supported transaction models.
  • Builds typed Pydantic objects with snake_case attributes and JSON serialization.
  • Checks required fields, numeric values, and field lengths in typed transaction models.
  • Emits diagnostics without including source values.

Install

Requires Python 3.11 or newer.

python -m pip install yedipy

For development:

python -m pip install -e ".[dev]"

CLI

yedipy x12 inspect input.edi
yedipy x12 validate input.edi --transaction 270

inspect reports envelope structure for X12 files without printing source values. The validate command currently supports 270 eligibility requests; use the Python API below to parse any supported transaction model.

Both commands return JSON and exit with 0 when their checks pass, 2 for parsing or validation failures, and 3 when the input cannot be read.

Python API

from pathlib import Path

from yedipy.x12 import parse_x12
from yedipy.x12.transactions import parse_transaction

result = parse_x12(Path("claims.edi").read_bytes())
result.raise_for_errors()

interchange = result.interchange
assert interchange is not None

raw = interchange.transactions[0]
typed = parse_transaction(raw, interchange.delimiters)
if typed.errors:
    raise ValueError([diagnostic.code for diagnostic in typed.errors])

transaction = typed.transaction  # A typed model for the selected transaction.
assert transaction is not None

For 004010, supply the implementation version from GS08 using the implementation_version argument. See the parsing guide for examples.

Documentation

Validation Scope

YediPy 0.1 provides structural validation, not complete implementation-guide compliance. Situational rules, external code lists, and cross-segment requirements are not comprehensively enforced. Additional HL parent/child checks are available for 005010X279A1 270 requests.

HL7 v2 and FHIR interoperability are on the roadmap; they are not implemented in this release.

License

YediPy is released under the MIT License.

Metadata

Release files for yedipy 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yedipy 0.1.1
File Size Uploaded Provenance Actions
yedipy-0.1.1.tar.gz 727.8 kB With provenance Details for yedipy-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yedipy 0.1.1
File Interpreter ABI Platform Actions
yedipy-0.1.1-py3-none-any.whl Python 3 none any Details for yedipy-0.1.1-py3-none-any.whl

Total release size: 1.5 MB

Release files / yedipy-0.1.1.tar.gz

Download URL yedipy-0.1.1.tar.gz
Size 727.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3057da08b808cae98916f16072e4e444fdd657d4f612747033d593388e202aaf
BLAKE2b-256 checksum
How to use checksums
f46b271c9f901f05910a3ebb3d9c4906d094fe3f3d5438ac513a49d8e8524bbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / yedipy-0.1.1-py3-none-any.whl

Download URL yedipy-0.1.1-py3-none-any.whl
Size 734.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9143650cc3d3ff6ddfaeb3111314599441d63192aa474de26e64d1e0c3dd73a5
BLAKE2b-256 checksum
How to use checksums
c3b013a2464289d22ebfa1114d77ad053b403109453aaf3f6d0a20d5c96f948e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for yedipy 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for yedipy-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page