Tediware launches an official MCP server for EDI.Learn more →

tediparse

An open-source Ruby library for parsing, generating and validating X12 EDI.

tediparse is the X12 engine Tediware runs on. It's a fork of Kyle Putnam's stupidedi, maintained by Tediware to support a broader set of X12 documents. The Ruby namespace is still Stupidedi, so the parser, builder and navigation APIs are unchanged. Code that relied on the grammars stupidedi bundled needs its own grammar registered first.

You describe a transaction set in Ruby, and tediparse gives you a parser for inbound documents and a DSL for building outbound ones, validated against that definition.

Bring your own grammar

tediparse ships the engine without any X12 transaction set definitions, code lists or envelopes. That material is licensed X12 content. You write the grammar yourself or, with an X12 license, generate it from the official X12 Table Data for any of seven releases: 003060, 004010, 004060, 005010, 006010, 007010 and 008010.

tediparse generate --release 005010 \
  --table-data vendor/x12/table_data/005010 \
  --out lib

Install

It's on RubyGems. Add it to your Gemfile:

gem "tediparse"

require "tediparse" and require "stupidedi" both work. It's licensed BSD-3-Clause.

Documentation

The README on GitHub and the docs it links to cover defining a grammar, generating one from Table Data, and parsing, generating and validating documents.

If you'd rather not run a parser at all, Tediware converts X12 to JSON for you, and the EDI Translator shows what that looks like on your own document.