Parametric configuration and tooling for build123d models.
Project description
bdbox
Parametric configuration and tooling for build123d models.
Installation
pip install bdbox
Features
Easily add configurable parameters to build123d models! Declare typed parameters with defaults, then override them individually or with named presets.
Great for simple models:
from bdbox import Float, Int, Params, Preset, show
from build123d import Box
class P(Params):
width = Float(10.0, min=5, max=100)
length = Float(20.0, min=5, max=100)
thickness = Int(2, min=1, max=10)
presets = (
Preset("small", width=5.0, length=8.0),
Preset("large", width=80.0, length=40.0, thickness=5),
)
result = Box(P.width, P.length, P.thickness)
show(result)
Or inherit from the provided base class for reusable, importable models:
from bdbox import Float, Int, Model, Preset
from build123d import Box
class MyBox(Model):
width = Float(10.0, min=5, max=100)
length = Float(20.0, min=5, max=100)
thickness = Int(2, min=1, max=10)
presets = (
Preset("small", width=5.0, length=8.0),
Preset("large", width=80.0, length=40.0, thickness=5),
)
def build(self):
return Box(self.width, self.length, self.thickness)
This provides a CLI with parameter value arguments, preset selection, and usage information:
python mybox.py # Run with default values
python mybox.py --width 50 # Override a field value
python mybox.py --preset large # Apply a named preset of values
python mybox.py --help # Usage info with all parameters
See full details in the documentation!
Project template
This project is generated and maintained with copier-python.
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 bdbox-0.2.0.tar.gz.
File metadata
- Download URL: bdbox-0.2.0.tar.gz
- Upload date:
- Size: 26.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbbf89102da740eefb3a1c6ecd48b41726fc3a67084935c8ee8a326101c75070
|
|
| MD5 |
ef8288d66bfcb56531c8c0569af81dad
|
|
| BLAKE2b-256 |
2fd2f13650ade654a81c5a18b87169a4a4b3f4d4368aeae71a89ef4b82cc5181
|
Provenance
The following attestation bundles were made for bdbox-0.2.0.tar.gz:
Publisher:
release.yaml on smkent/bdbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bdbox-0.2.0.tar.gz -
Subject digest:
dbbf89102da740eefb3a1c6ecd48b41726fc3a67084935c8ee8a326101c75070 - Sigstore transparency entry: 1293422016
- Sigstore integration time:
-
Permalink:
smkent/bdbox@98406abafe380048aad4a668cc411f6d951f842b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/smkent
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@98406abafe380048aad4a668cc411f6d951f842b -
Trigger Event:
push
-
Statement type:
File details
Details for the file bdbox-0.2.0-py3-none-any.whl.
File metadata
- Download URL: bdbox-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2b328dc7c913587f1990decade8ef8f0dacacc75798c4c4d2a1c0a0fa89e6fb
|
|
| MD5 |
4580006330729ee0c8373f1445f6f777
|
|
| BLAKE2b-256 |
7c1e5f51c2db0f58b9a146a6cd3b56f33709a61a047438525021279cdacd3d05
|
Provenance
The following attestation bundles were made for bdbox-0.2.0-py3-none-any.whl:
Publisher:
release.yaml on smkent/bdbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bdbox-0.2.0-py3-none-any.whl -
Subject digest:
b2b328dc7c913587f1990decade8ef8f0dacacc75798c4c4d2a1c0a0fa89e6fb - Sigstore transparency entry: 1293422033
- Sigstore integration time:
-
Permalink:
smkent/bdbox@98406abafe380048aad4a668cc411f6d951f842b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/smkent
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@98406abafe380048aad4a668cc411f6d951f842b -
Trigger Event:
push
-
Statement type: