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.7.0.tar.gz (141.7 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.7.0-py3-none-any.whl (58.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: genro_builders-0.7.0.tar.gz
  • Upload date:
  • Size: 141.7 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.7.0.tar.gz
Algorithm Hash digest
SHA256 edd45874e1ab9d92f7af7fc4e4923a6189164539164edb93fb29e9000fd8a248
MD5 c48bb2add4fc8e395e8d64ea22bcc938
BLAKE2b-256 6cc2768997443910829a801b0c4f3cf2f8394ab7bd9192688977d88b3c3e0ad3

See more details on using hashes here.

Provenance

The following attestation bundles were made for genro_builders-0.7.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.7.0-py3-none-any.whl.

File metadata

  • Download URL: genro_builders-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 58.3 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.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0b4fac0d6309fb7c2a6b7ad4e8af7cb74dd328f763d4af744dbf85ff5cf5624
MD5 f23730897e652dc874c961c9651802b0
BLAKE2b-256 fd3fdde30daf31c80e7293e09927f64c2b3ab7839da6e1c79f7474477da5cfb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for genro_builders-0.7.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