embroidery-ksy: open, machine-readable specs for embroidery file formats
Machine embroidery formats are mostly undocumented. If you want to read a .dst or .pes file in your own code, you usually end up reverse-engineering it, or copying a parser buried inside a large desktop application.
embroidery-ksy is my attempt to fix that: open, machine-readable Kaitai Struct specifications (.ksy) for embroidery file formats. From one spec, Kaitai Struct generates a parser for JavaScript, Python, Java, Go, C++, Rust and other languages.
It’s MIT licensed and maintained under BroideryFab.
Work in progress (pre-1.0). Most formats are partial, and some are stubs. Specs and layouts may change without notice until 1.0.
- Source: github.com/broideryfab/embroidery-ksy
- Format catalog: broideryfab.com/formats
- Web IDE: broideryfab.com/formats/ide

Formats
The catalog is grouped by priority:
- Tier 1, launch formats: Tajima DST, Brother PES and PEC, Janome JEF, Melco EXP, Husqvarna Viking / Pfaff VP3, Singer XXX.
- Tier 2: HUS, VIP, SHV, SEW, Barudan U01 and DSB, ZSK DSZ, Tajima TBF, Pfaff KSM and PCS, Happy TAP, Sunstar and Barudan DAT.
- Tier 3, the long tail: Toyota, Melco, Singer, Elna, Pfaff, Brother, Janome, Gunold, ThredWorks and many others.
- Proprietary source formats (preview only): Wilcom EMB, Bernina ART, Melco OFM, Pulse PXF.
- Thread color files: Embird EDR, INF, RGB.
Each spec has a status on the formats page: Planned (stub only), Partial, or Complete (all known versions, tested).
How a format is laid out
Every format is self-contained:
formats/<format>/
├── <format>.ksy the spec
├── README.md structure, versions, quirks, sources consulted
├── samples/ redistributable sample files + MANIFEST.yaml
└── tests/ expected parse results (.json)
Shared tooling lives in tools/, and conventions are in docs/style-guide.md.
Use it
# Compiling and testing run on Node.js (no Java needed)
npm install
# Generate parsers with the npm kaitai-struct-compiler
tools/compile.sh python javascript
# Run sample tests
node tools/run_tests.js
You don’t have to build anything to try a spec. The BroideryFab Web IDE is the Kaitai Struct Web IDE with every spec and its sample files preloaded: pick a format in the file tree under broideryfab.com, open a sample next to the spec, and you get:
- the
.ksyspec in an editor; - the parsed object tree, so you can see how each field was read;
- a hex viewer that highlights the bytes behind whatever you select;
- an info panel and a value converter for the selected bytes.
You can also open any .ksy file together with a sample in the stock Kaitai Web IDE.
Generated parsers (Python, JavaScript, Java, Go) and the specs are also published as zip files: an always-current edge pre-release rebuilt from main on every push after CI passes, and tagged vX.Y.Z releases.
What CI checks
On every push and pull request, CI:
- compiles every
.ksyfor Python, JavaScript, Java and Go with the JVM compiler, and fails on any error or warning; - compiles the specs with the npm compiler;
- loads every generated JavaScript parser, parses every sample in the manifests, and checks the result against
tests/*.json; - publishes the full parsed tree of every sample as a JSON artifact, so you can see exactly what a spec produced.
Contribute
New formats, corrections and sample files are welcome. Start with the repository and its CONTRIBUTING.md.