x12sdk

Read, check and generate HIPAA X12 health care transactions in Python: claims (837P, 837I, 837D), remittances (835), eligibility (270/271), claim status (276/277) and enrollment (834).

pip install x12sdk
x12sdk-table remit.835 -o remit.csv          # an 835 as one row per service line
x12sdk-validate claims.837                   # valid, or where it breaks
x12sdk-generate 837p --seed 7 --claims 25    # synthetic claims, no PHI

Everything runs locally; no file is uploaded anywhere.

Start where you are

You have…

Go to

A file and no Python

The browser playground: check it, get a CSV, nothing to install

An 835 you want in a spreadsheet

Tables

A file a payer or clearinghouse rejected

Checking files

Code to test, and no X12 you can share

Generating synthetic files

Claims and the remittances that paid them

Pairs and matching

Denials to understand across many remittances

Denial analytics

An AI assistant that should read X12

MCP server

A service that reads other people’s files

Handling untrusted input

Code on x12sdk 2.x

Upgrading to 3.0

Code on linuxforhealth-x12

Migrating

A ready-made dataset of 30,000 synthetic claims with their remittances is on Hugging Face.

Supported transaction sets

Set

Implementation

What it is

Generate

Accessors

837P

005010X222A2

Professional claim

generate_837p

claims(), subscribers()

837I

005010X223A3

Institutional claim

generate_837i

claims(), subscribers()

837D

005010X224A2

Dental claim

generate_837d

claims(), subscribers()

835

005010X221A1

Claim payment / remittance advice

generate_835

claims()

834

005010X220A1

Benefit enrollment and maintenance

generate_834

270 / 271

005010X279A1

Eligibility inquiry / response

generate_270 / generate_271

members()

276 / 277

005010X212

Claim status inquiry / response

generate_276 / generate_277

claims()

Every transaction parses into a validated Pydantic v2 model and serializes back to X12; the test suite asserts the round trip reproduces each sample file byte for byte. x12sdk runs on Python 3.10–3.14.