Skip to main content

Mega-Super-Base (MSB) architecture for flexible and extensible Python applications

Project description

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: Full support for logging and 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)
    def from_dict():
        pass

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

Architecture

The project is divided into 4 modules:

Main classes:

  • BaseEntity: Abstract class for entities with type validation, serialization, and caching.
  • BaseContainer[T]: Generic container for BaseEntity collections with query and operation support.
  • 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.

To run tests:

pytest tests/

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

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

msb_arch-0.1.2.tar.gz (59.4 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.1.2-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: msb_arch-0.1.2.tar.gz
  • Upload date:
  • Size: 59.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for msb_arch-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6494711d9527dab6e24897f1e7258175e83b0247a0bfc690d445f5ad1c4d8d4a
MD5 c97562bb8e230d4b3df9be749ff3b893
BLAKE2b-256 ca871af4ab1b8941eb7103639a33424f3052e3db07dd044bbcba94404e2e0900

See more details on using hashes here.

File details

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

File metadata

  • Download URL: msb_arch-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 32.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for msb_arch-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b849f554175d738bd6da969f0484e91c8b76cb929c2a76088d59aafd55c64084
MD5 73753eb6b4ac664cf9fc13d01fa3729c
BLAKE2b-256 f3e6c13ecce01ffe6a9ccc9deb2cbcb7f93fa31792f3b6f77467b184c171be8f

See more details on using hashes here.

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