DEV.co
AI Coding Agents · miku

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.

Source: GitHub — github.com/miku/zek
820
GitHub stars
64
Forks
Go
Primary language
GPL-3.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorymiku/zek
Ownermiku
Primary languageGo
LicenseGPL-3.0 — OSI-approved
Stars820
Forks64
Open issues9
Latest releasev0.1.31 (2026-04-23)
Last updated2026-04-23
Sourcehttps://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.

Quickstart

Get the zek source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/miku/zek.gitcd zek# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Rapid prototyping of XML parsers

When you have sample XML documents and need to quickly generate Go structs to read them without writing struct definitions manually.

One-off data ingestion scripts

Short-lived tools that consume XML feeds or exports and need minimal scaffolding before business logic can be written.

Non-recursive XML document formats

Flat or shallow XML structures (like RSS feeds, simple configuration files) where element nesting is predictable and limited.

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.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityNeeds review
Deployment complexityLow
DEV.co fitPossible
Assessment confidenceMedium
Security considerations

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.

Software development agency

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.co

Related 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?
Not without legal review. GPL-3.0 is a strong copyleft license. Using zek as a build tool or runtime dependency may impose GPL obligations on your product. Consult counsel before commercial deployment.
What if my XML has recursive elements (like nested trees)?
Zek explicitly does not support recursive types. Use manual struct definitions or a different tool for Russian Doll patterns or self-referential XML.
Why are all generated fields strings?
Zek infers no types without a schema. All values are generated as strings; you must manually add type conversion logic or custom unmarshaling for numeric/boolean types.
Is zek production-ready?
No. README and project status explicitly label it as an experimental prototype. It works for simple, non-recursive XML but is not recommended for production systems.

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.