Skip to main content

Builder system for genro-bag - grammar, validation, compilation

Project description

genro-builders

Builder system for genro-bag — grammar, validation, compilation, and reactive data binding.

Installation

pip install genro-builders

Quick start

from genro_builders import BuilderBag
from genro_builders.builders import HtmlBuilder

html = BuilderBag(builder=HtmlBuilder)
body = html.body()
body.div(id='main').p('Hello, world!')

print(html.builder._compile())

Features

  • Domain-specific grammars — Define elements, validation rules, and components via decorators (@element, @abstract, @component)
  • Built-in builders — HTML5, Markdown, XSD (schema-driven XML)
  • Compilation pipeline — Expand components, resolve ^pointer bindings, render output
  • Reactive applicationsBagAppBase provides automatic re-render on data or source changes
  • Validationsub_tags cardinality, parent_tags constraints, typed attribute validation

Architecture

Source Bag (recipe)
    ↓ compiler.compile()
Compiled Bag (components expanded, ^pointers resolved)
    ↓ compiler.render()
Output (HTML, Markdown, XML, ...)

With BagAppBase, data changes trigger automatic updates via the BindingManager subscription map.

Documentation

See the docs/ directory for full documentation.

License

Apache License 2.0 — Copyright 2025 Softwell S.r.l.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genro_builders-0.6.0.tar.gz (138.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genro_builders-0.6.0-py3-none-any.whl (56.5 kB view details)

Uploaded Python 3

File details

Details for the file genro_builders-0.6.0.tar.gz.

File metadata

  • Download URL: genro_builders-0.6.0.tar.gz
  • Upload date:
  • Size: 138.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for genro_builders-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b26da9772c8a0d96433e9dc2f01c5249fda16c46a5a4aeccdb8c8c366fc1548f
MD5 8d73cc8609a21d3b6b33b7a3c21409d6
BLAKE2b-256 c9a22701544ed967d464468a977f6d40880b31014ec4f63dddc57ea3335816a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for genro_builders-0.6.0.tar.gz:

Publisher: publish.yml on genropy/genro-builders

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file genro_builders-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: genro_builders-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 56.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for genro_builders-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44ea3eaacf9bb5348d50957ecaa2f8e7abf21e136254dfe69aee0ee541e59afb
MD5 f440f4fe2b9d5020e55b889cf69de3e7
BLAKE2b-256 78920cf7d5b2786b44aee920490dbf58dfa822ebe7502de4282715eb2e883ec8

See more details on using hashes here.

Provenance

The following attestation bundles were made for genro_builders-0.6.0-py3-none-any.whl:

Publisher: publish.yml on genropy/genro-builders

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page