Skip to main content

Modernized bag system for the Genropy framework - hierarchical data container with XML serialization

Project description

genro-bag

PyPI version Tests codecov Documentation Python 3.10+ License

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


Download files

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

Source Distribution

genro_bag-0.7.5.tar.gz (250.4 kB view details)

Uploaded Source

Built Distribution

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

genro_bag-0.7.5-py3-none-any.whl (90.7 kB view details)

Uploaded Python 3

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

Hashes for genro_bag-0.7.5.tar.gz
Algorithm Hash digest
SHA256 58bb270d390e684bdfaa02e7e02dd42ffaca39b10946c997105527933727cdd8
MD5 7a4fbf33776ed312909a3e13cd7d8a20
BLAKE2b-256 14a8df2283e1ebb7f6a30aeb897a9b862869fb90db8cc3a0189f2527ea8f35b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for genro_bag-0.7.5.tar.gz:

Publisher: publish.yml on genropy/genro-bag

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_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

Hashes for genro_bag-0.7.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b6188186346b54979433b66a66bd1a51412e9e20b70b5d1907b9db0cebf3a6bd
MD5 51726feacfa2124b352aa87a460d9d16
BLAKE2b-256 536c47fca2689cf9da9cef25a07bc26a5d24082f371568089795937ea9800cb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for genro_bag-0.7.5-py3-none-any.whl:

Publisher: publish.yml on genropy/genro-bag

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