Skip to main content

MSB Architecture

Python Version License Version

Mega-Super-Base (MSB) - a flexible and extensible architecture for Python applications, providing a modular system for managing entities, containers, operations, and projects with built-in type safety, serialization, and logging.

Features

  • Typed Entity Management: Automatic attribute validation and serialization.
  • Containers for Collections: Support for queries and bulk operations on entities.
  • Flexible Operation System: Through Super-classes with method resolution.
  • Projects as High-Level Containers: High-level data organization.
  • Universal Serialization: Support for nested objects and cyclic references.
  • Integrated Logging and Validation: Logging through a dedicated msb_arch logger that stays silent until the application configures it, plus data validation.
  • No External Dependencies: Requires only Python >= 3.12.

Installation

pip install msb_arch

Quick Start

from msb_arch.base.baseentity import BaseEntity
from msb_arch.super.project import Project

class MyEntity(BaseEntity):
    value: int

class MyProject(Project):
    _item_type = MyEntity

    def create_item(self, item_code: str = "ITEM_DEFAULT", isactive: bool = True) -> None:
        item = MyEntity(name=item_code, isactive=isactive, value=42)
        self.add_item(item)

project = MyProject(name="MyProject")
project.create_item("item1")
print(project.get_item("item1").to_dict())
# Output: {'name': 'item1', 'isactive': True, 'type': 'MyEntity', 'value': 42}

restored = MyProject.from_dict(project.to_dict())
print(restored.get_item("item1").value)
# Output: 42

Architecture

The project is divided into 4 modules:

Main classes:

  • Serializable: Shared base holding validation, serialization, caching and ownership.
  • BaseEntity: An object addressed by its attributes.
  • BaseContainer[T]: A named collection, sibling of BaseEntity rather than a subclass.
  • Super: Abstract class for operation handlers with method resolution.
  • Project: Class for managing projects as entity containers.
  • Manipulator: Central class for operation registration and request processing.

API

Complete API reference is available in docs/api.md.

Examples

Practical usage examples are available in docs/examples.md.

Testing

The project includes a complete set of unit, integration, and performance tests using pytest. Tests are located in the tests/ directory and cover all modules with high coverage rates.

The tests import msb_arch rather than the source tree, so they run against whatever is installed. Install the package first:

pip install -e .

Then run the tests:

pytest tests/

CI builds the wheel and installs it before running the same suite, so the distribution that ships is the one that was tested.

Changelog

Release history and upgrade notes are in CHANGELOG.md. Known issues that have not been addressed yet are tracked in docs/ROADMAP.md.

License

MSB is licensed under the MSB Software License for non-commercial and research use, allowing free use, modification, and distribution for non-commercial purposes with attribution.

For commercial use, a separate royalty-bearing license is required. Please contact almax1024@gmail.com for details.

Contacts

Download files

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

Source Distribution

msb_arch-0.3.0.tar.gz (92.0 kB view details)

Uploaded Source

Built Distribution

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

msb_arch-0.3.0-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

Details for the file msb_arch-0.3.0.tar.gz.

File metadata

  • Download URL: msb_arch-0.3.0.tar.gz
  • Upload date:
  • Size: 92.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for msb_arch-0.3.0.tar.gz
Algorithm Hash digest
SHA256 80ce49589e615fe55f429c31804701dbf5fdbc96bf5c34fd68511fb26c2723e6
MD5 f05aa6a791cacb1db6394edc027f962e
BLAKE2b-256 ff4f62f8ad44321fcdf2caf121ee23673b2272f76ecd5e67298b247ff34c11e9

See more details on using hashes here.

File details

Details for the file msb_arch-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: msb_arch-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 41.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for msb_arch-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5cfb66eafe613d2bb2122e025eecc8cbadfaf3388d601e821def913937eda992
MD5 719b36439399484d03441a659d1b723b
BLAKE2b-256 5f8e6ffd864ce8b6f8e5372d0797a36e5577ab16529a7243f2f1d5bdc1e6832f

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0.1

2 files

2.0.0

2 files

1.10.0

2 files

1.9.2

2 files

1.9.1

2 files

1.9.0

2 files

1.8.0

2 files

1.7.0

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

This release

0.3.0 This release

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page