Composable toolkit for clean, testable, and maintainable Python applications
Project description
BuildingBlocks 🧩
Composable abstractions and interfaces for writing clean, testable, and maintainable Python code.
🌱 What Is BuildingBlocks?
Not a framework — a toolkit of composable contracts and abstractions.
BuildingBlocks helps you create codebases that are:
- Clean — with clear boundaries and intent
- Testable — by design, through explicit interfaces
- Maintainable — by isolating concerns and dependencies
It doesn’t dictate your architecture. Instead, it provides foundations and reusable building blocks for designing software with intent and clarity.
You can use it to:
- Learn and apply architecture and design principles
- Build decoupled applications that scale safely
- Model systems with type safety and explicit intent
- Experiment with Clean, Hexagonal, DDD, or message-driven styles
🧩 Core Idea
Foundations, not frameworks. You choose the architecture — BuildingBlocks provides the language.
This toolkit defines layer-agnostic foundations that compose into any design:
Result,Ok,Err→ explicit success/failure handlingPort,InboundPort,OutboundPort→ communication boundariesEntity,ValueObject,AggregateRoot→ domain modelingRepository,UnitOfWork→ persistence contractsEvent,EventBus,CommandHandler→ messaging and orchestration
🚀 Installation
poetry add building-blocks-toolkit
# or
pip install building-blocks-toolkit
⚡ Quick Example
from building_blocks.foundation import Result, Ok, Err
def divide(a: int, b: int) -> Result[int, str]:
if b == 0:
return Err("division by zero")
return Ok(a // b)
result = divide(10, 2)
if result.is_ok():
print(result.value) # → 5
📚 Learn More
🧠 Why It Matters
Most systems fail not because of missing features, but because of tight coupling, implicit dependencies, and unclear responsibilities.
BuildingBlocks helps you design code intentionally — so that your system remains testable, extensible, and adaptable as it grows.
💡 Examples
Educational examples are being migrated to a dedicated repository (coming soon). They include both good practices and intentional anti-patterns to teach design reasoning.
🤝 Contributing
Contributions are welcome! See CONTRIBUTING.md for environment setup and workflow.
⚖️ License
MIT — see LICENSE
Built with ❤️ by Glauber Brennon and the Building Blocks community.
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 building_blocks_toolkit-0.3.5.tar.gz.
File metadata
- Download URL: building_blocks_toolkit-0.3.5.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dda88cbaa53b216259e5dbebe9b3706f2c136b896a7bd1beccdb3eb05e596c1c
|
|
| MD5 |
31822276993f20bc68e76802e289a187
|
|
| BLAKE2b-256 |
c3a89eeccafafdeca93f94ccc119bee99618749aa4e2428ef84cad421a4a3b0e
|
Provenance
The following attestation bundles were made for building_blocks_toolkit-0.3.5.tar.gz:
Publisher:
publish.yml on building-blocks-org/building-blocks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
building_blocks_toolkit-0.3.5.tar.gz -
Subject digest:
dda88cbaa53b216259e5dbebe9b3706f2c136b896a7bd1beccdb3eb05e596c1c - Sigstore transparency entry: 687137454
- Sigstore integration time:
-
Permalink:
building-blocks-org/building-blocks@c6114e8b53f1bead06a4d73b6731202a1bd8dff2 -
Branch / Tag:
refs/tags/v0.3.5 - Owner: https://github.com/building-blocks-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c6114e8b53f1bead06a4d73b6731202a1bd8dff2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file building_blocks_toolkit-0.3.5-py3-none-any.whl.
File metadata
- Download URL: building_blocks_toolkit-0.3.5-py3-none-any.whl
- Upload date:
- Size: 46.0 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 |
c78052a4b925d74f422116f886e63cafbf364a68c9cfa24d310b7f2af0c9ab10
|
|
| MD5 |
1a5196b4c43b84546c57b70e1da1a95d
|
|
| BLAKE2b-256 |
b9825ddd923d727682389003efbcb7e39575379d2195a90678294170ce51a802
|
Provenance
The following attestation bundles were made for building_blocks_toolkit-0.3.5-py3-none-any.whl:
Publisher:
publish.yml on building-blocks-org/building-blocks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
building_blocks_toolkit-0.3.5-py3-none-any.whl -
Subject digest:
c78052a4b925d74f422116f886e63cafbf364a68c9cfa24d310b7f2af0c9ab10 - Sigstore transparency entry: 687137496
- Sigstore integration time:
-
Permalink:
building-blocks-org/building-blocks@c6114e8b53f1bead06a4d73b6731202a1bd8dff2 -
Branch / Tag:
refs/tags/v0.3.5 - Owner: https://github.com/building-blocks-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c6114e8b53f1bead06a4d73b6731202a1bd8dff2 -
Trigger Event:
push
-
Statement type: