zek
Zek is a code generator that reads XML documents and automatically produces Go struct definitions for parsing them. It infers the structure from sample XML without requiring a schema, making it useful for quickly scaffolding Go code to read XML data.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | miku/zek |
| Owner | miku |
| Primary language | Go |
| License | GPL-3.0 — OSI-approved |
| Stars | 820 |
| Forks | 64 |
| Open issues | 9 |
| Latest release | v0.1.31 (2026-04-23) |
| Last updated | 2026-04-23 |
| Source | https://github.com/miku/zek |
What zek is
Zek analyzes XML input, infers element hierarchies and attributes, and generates Go struct types with appropriate xml tags for decoding via encoding/xml. It supports schema inference across multiple files, optional JSON tags, and example comments in generated code.
Get the zek source
Clone the repository and explore it locally.
git clone https://github.com/miku/zek.gitcd zek# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Generated structs include xml.Name and chardata fields; review and clean up generated code before use in production—it is a starting point, not final output.
- All fields are string type; add manual type conversion logic or use custom unmarshaling if numeric or boolean values are needed.
- Schema inference works on sample files; atypical XML elements or optional fields in later documents may not be captured. Validate generated structs against full dataset.
- No support for namespaces or complex attribute handling; works best with simple, flat XML structures.
- Generated code includes a timestamp and author comment; use -B flag in CI/CD to ensure reproducible output.
When to avoid it — and what to weigh
- Production XML-to-Go parsing layer — README explicitly marks this as a prototype and early-stage; the project itself documents experimental status, instability, and bugs. Use established libraries (encoding/xml, third-party unmarshaling tools) for production systems.
- Recursive or deeply self-referential XML — Project explicitly states no support for recursive types (Russian Doll pattern). Complex nested hierarchies will not generate correctly.
- Type-safe parsing with inferred types — All values are generated as strings; no type inference from content occurs. If you need int, float, bool, or custom types, manual struct editing is required.
- XML generation (writing/serialization) — README notes the generated structs work best for reading XML. For creating/writing XML, use different tools. Bidirectional marshaling is not a design goal.
License & commercial use
Licensed under GPL-3.0 (GNU General Public License v3.0). This is a copyleft license requiring derivative works and distributions to be licensed under the same terms. The generated Go code is output; license implications of the output code itself are not stated in the DATA.
GPL-3.0 is a strong copyleft license. Using zek as a build tool may trigger GPL obligations if the binary is distributed or embedded in a commercial product. Commercial use requires legal review and may require open-sourcing derivative work or linking binaries under GPL terms. If using zek only internally for code generation (generating structs once), consulting counsel is still advised. Requires legal review before commercial deployment.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Needs review |
| Deployment complexity | Low |
| DEV.co fit | Possible |
| Assessment confidence | Medium |
No security assessment provided. Zek processes untrusted XML input to generate code; malformed or malicious XML could theoretically cause unexpected output. Generated structs use standard Go encoding/xml package, which has known XML parsing considerations (billion laughs, external entity expansion). Validate and review generated code before use. No information on input sanitization or XML parser hardening in zek itself.
Alternatives to consider
encoding/xml (Go standard library)
Manual struct definition but no GPL dependency, full type control, and recommended for production. Better for maintainability if you own the XML schema.
Chidley (go-xmlstruct, XMLGen, JSONGen)
Other open-source XML-to-struct generators. Review their licenses and maturity vs zek prototype status.
Third-party XML unmarshaling libraries (e.g., xmltomap, xml2json)
Map-based or dynamic unmarshaling avoids code generation entirely; trades compile-time safety for runtime flexibility and fewer dependencies.
Build on zek with DEV.co software developers
Use Zek to quickly scaffold Go code for reading XML. Perfect for prototypes and one-off data ingestion tasks. Review limitations and licensing before production use.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
zek FAQ
Can I use zek in a commercial product?
What if my XML has recursive elements (like nested trees)?
Why are all generated fields strings?
Is zek production-ready?
Software development & web development with DEV.co
DEV.co is a software development agency delivering custom software development services to companies building on open source. Our software developers and web developers design, integrate, and ship production systems — spanning web development, APIs, AI, data, and cloud. If zek is part of your ai coding agents roadmap, our team can implement, customize, migrate, and maintain it.
Generate Go Structs from Your XML
Use Zek to quickly scaffold Go code for reading XML. Perfect for prototypes and one-off data ingestion tasks. Review limitations and licensing before production use.