Composable toolkit for clean, testable, and maintainable Python applications
Project description
ForgingBlocks
Composable abstractions and interfaces for writing clean, testable, and maintainable Python code.
🌱 Overview
Not a framework — a toolkit of composable contracts and abstractions.
ForgingBlocks 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 abstractions for forging your own blocks.
Isolate external concerns from your core logic you will achieve systems that are adaptable and resilient. If you forge your own block you will achieve software with intent and clarity If you use blocks you will achieve consistency and reusability. ForgingBlocks helps you build systems that last.
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 Concepts
Foundations, not frameworks — ForgingBlocks provides the language for clean architecture.
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 forging-blocks
# or
pip install forging-blocks
⚡ Quick Example
from forging_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
- 📘 Documentation
- 🚀 Getting Started Guide
- 🏗️ Architecture Overview
- 🧱 Packages & Layers
- 🧩 Release Process
🧠 Why It Matters
Most systems fail not because of missing features, but because of tight coupling, implicit dependencies, and unclear responsibilities.
ForgingBlocks helps you design code intentionally — so your system remains testable, extensible, and adaptable as it grows.
🤝 Contributing
Contributions are welcome! 🎉
- Fork the repository
- Install dependencies with Poetry
- Run tests and lint checks:
poetry run poe ci:simulate
- Submit a pull request with a clear description of your improvement
See CONTRIBUTING.md for more details.
⚖️ License
MIT — see LICENSE
ForgingBlocks — foundations for clean, testable, and maintainable Python architectures.
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 forging_blocks-0.3.6.tar.gz.
File metadata
- Download URL: forging_blocks-0.3.6.tar.gz
- Upload date:
- Size: 32.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b23dcf158d7d99e8ad8142f298502f435fae271360cfe218ef950dface39f39f
|
|
| MD5 |
52a74a1c32da8bea5c191d198a20a8d6
|
|
| BLAKE2b-256 |
9fe207c80dfc96a41a52395f4280773597844d0318f8d3c8e3da1c008553b199
|
Provenance
The following attestation bundles were made for forging_blocks-0.3.6.tar.gz:
Publisher:
publish.yml on forging-blocks-org/forging-blocks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forging_blocks-0.3.6.tar.gz -
Subject digest:
b23dcf158d7d99e8ad8142f298502f435fae271360cfe218ef950dface39f39f - Sigstore transparency entry: 691151089
- Sigstore integration time:
-
Permalink:
forging-blocks-org/forging-blocks@f7d5f166b2b1f97504feb2fc2681ce0469de9fe6 -
Branch / Tag:
refs/tags/v0.3.6 - Owner: https://github.com/forging-blocks-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f7d5f166b2b1f97504feb2fc2681ce0469de9fe6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file forging_blocks-0.3.6-py3-none-any.whl.
File metadata
- Download URL: forging_blocks-0.3.6-py3-none-any.whl
- Upload date:
- Size: 45.9 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 |
e2dde843935a9d4baecb9659654951ffaa66f255358dc1b5dd16688fda14b2bc
|
|
| MD5 |
2e0de3ccbd6446c42ea9ee00ca30b2b6
|
|
| BLAKE2b-256 |
eaf34bec11c406a2da8aca6bfe95db850ccf33ec52463ba83513416b2d7cb814
|
Provenance
The following attestation bundles were made for forging_blocks-0.3.6-py3-none-any.whl:
Publisher:
publish.yml on forging-blocks-org/forging-blocks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forging_blocks-0.3.6-py3-none-any.whl -
Subject digest:
e2dde843935a9d4baecb9659654951ffaa66f255358dc1b5dd16688fda14b2bc - Sigstore transparency entry: 691151107
- Sigstore integration time:
-
Permalink:
forging-blocks-org/forging-blocks@f7d5f166b2b1f97504feb2fc2681ce0469de9fe6 -
Branch / Tag:
refs/tags/v0.3.6 - Owner: https://github.com/forging-blocks-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f7d5f166b2b1f97504feb2fc2681ce0469de9fe6 -
Trigger Event:
push
-
Statement type: