Modernized bag system for the Genropy framework - hierarchical data container with XML serialization
Project description
genro-bag
An intermediate representation for structured data in Python.
What is Bag?
A Bag is an abstraction that bridges the gap between how humans think about structured data and how software implements it.
When you work with configuration files, API responses, form data, or document structures, they all share the same fundamental shape: named things containing values, organized in a hierarchy, with additional properties attached.
Yet in code, we scatter this across dictionaries, classes, JSON, XML, database rows—each with its own access patterns and limitations.
A Bag unifies these patterns into a single, consistent model:
- Nodes — Named containers that hold a value
- Hierarchy — Nodes can contain other nodes, forming a tree
- Attributes — Each node carries metadata alongside its value
- Paths — Navigate the tree with familiar dot notation
The Layered Design
Bag provides progressive capability. Start simple, add layers when needed:
| Layer | Purpose |
|---|---|
| Core Bag | The fundamental container: paths, values, attributes |
| Resolvers | Values that compute themselves: lazy loading, API calls |
| Subscriptions | React to changes: validation, logging, computed properties |
| Builders | Domain-specific languages: HTML, Markdown, XML schemas |
Install
pip install genro-bag
Documentation
Full documentation with examples: genro-bag.readthedocs.io
| Section | Description |
|---|---|
| Getting Started | Learn the three core concepts |
| Core Bag | Basic usage, paths, attributes, serialization |
| Resolvers | Lazy loading, API calls, computed values |
| Subscriptions | React to changes, validation, logging |
| Builders | Domain-specific languages (HTML, Markdown, XSD) |
Development
pip install -e ".[dev]"
pytest
1500+ tests, 88%+ coverage.
License
Apache License 2.0 - see LICENSE for details.
Copyright 2025 Softwell S.r.l. - Genropy Team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file genro_bag-0.7.5.tar.gz.
File metadata
- Download URL: genro_bag-0.7.5.tar.gz
- Upload date:
- Size: 250.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58bb270d390e684bdfaa02e7e02dd42ffaca39b10946c997105527933727cdd8
|
|
| MD5 |
7a4fbf33776ed312909a3e13cd7d8a20
|
|
| BLAKE2b-256 |
14a8df2283e1ebb7f6a30aeb897a9b862869fb90db8cc3a0189f2527ea8f35b1
|
Provenance
The following attestation bundles were made for genro_bag-0.7.5.tar.gz:
Publisher:
publish.yml on genropy/genro-bag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
genro_bag-0.7.5.tar.gz -
Subject digest:
58bb270d390e684bdfaa02e7e02dd42ffaca39b10946c997105527933727cdd8 - Sigstore transparency entry: 832845202
- Sigstore integration time:
-
Permalink:
genropy/genro-bag@a0d5e47ebdf83efc36f3324240a808938f59aa7b -
Branch / Tag:
refs/tags/v0.7.5 - Owner: https://github.com/genropy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a0d5e47ebdf83efc36f3324240a808938f59aa7b -
Trigger Event:
push
-
Statement type:
File details
Details for the file genro_bag-0.7.5-py3-none-any.whl.
File metadata
- Download URL: genro_bag-0.7.5-py3-none-any.whl
- Upload date:
- Size: 90.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6188186346b54979433b66a66bd1a51412e9e20b70b5d1907b9db0cebf3a6bd
|
|
| MD5 |
51726feacfa2124b352aa87a460d9d16
|
|
| BLAKE2b-256 |
536c47fca2689cf9da9cef25a07bc26a5d24082f371568089795937ea9800cb9
|
Provenance
The following attestation bundles were made for genro_bag-0.7.5-py3-none-any.whl:
Publisher:
publish.yml on genropy/genro-bag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
genro_bag-0.7.5-py3-none-any.whl -
Subject digest:
b6188186346b54979433b66a66bd1a51412e9e20b70b5d1907b9db0cebf3a6bd - Sigstore transparency entry: 832845203
- Sigstore integration time:
-
Permalink:
genropy/genro-bag@a0d5e47ebdf83efc36f3324240a808938f59aa7b -
Branch / Tag:
refs/tags/v0.7.5 - Owner: https://github.com/genropy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a0d5e47ebdf83efc36f3324240a808938f59aa7b -
Trigger Event:
push
-
Statement type: