Wordsmith Engine for Python
The Python implementation of Wordsmith Engine provides composable, deterministic-friendly procedural text components.
pip install wordsmith-engine
import random
from wordsmith import Adjective, Noun
rng = random.Random(5343)
ship_name = ("The" | Adjective() | Noun()).title_case()
print(ship_name(rng))
The title_case() method uppercases the first alphabetic character in each word
that requires capitalization. A prefix stays in place: 123hello world becomes
123Hello World, as it does in TypeScript.
The direct Text, OneOf, and WeightedOneOf constructors accept lists or
tuples of components and store immutable tuples. Later changes to an input
list do not change the component. The text, one_of, and weighted_one_of
helpers also accept strings.
WeightedOneOf and weighted_one_of require finite, non-negative weights with
a finite positive total. Invalid weights raise ValueError at construction.
Zero weights are allowed when the total is positive; their options are never
selected.
Pass the same caller-owned random.Random through every related Wordsmith
render. Isolate that RNG from unrelated consumers when its output must be
replayable.
Custom components must depend only on that RNG and fixed captured configuration to remain replayable. Pin the Python runtime as well as the package when durable replay includes non-English host case conversion.
See the repository README for the complete feature list, TypeScript usage, examples, and development guide.
Metadata
Release files for wordsmith-engine 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wordsmith_engine-0.4.1.tar.gz | 145.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wordsmith_engine-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 302.4 kB
Release files / wordsmith_engine-0.4.1.tar.gz
| Download URL | wordsmith_engine-0.4.1.tar.gz |
|---|---|
| Size | 145.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
097927e00c856026777c9151a741ac75fb889e5dc97c19505de40c94824ca4b3
|
|
BLAKE2b-256 checksum How to use checksums |
71eabf0b5e6e31073516f8b34cd70ac99f10771efebe2ea261c9d31a1f4fe8d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.
Transparency logRelease files / wordsmith_engine-0.4.1-py3-none-any.whl
| Download URL | wordsmith_engine-0.4.1-py3-none-any.whl |
|---|---|
| Size | 156.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49fb7febb4ff917931459e9dcee0a00bdbb31db0d596fe97836f395919da5de7
|
|
BLAKE2b-256 checksum How to use checksums |
89a54e3164c95b5e33f5c37b6aab43b6fe493e44bd62de1c5871da8b656b6d55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.
Transparency log