Skip to main content

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)

Source distribution for wordsmith-engine 0.4.1
File Size Uploaded
wordsmith_engine-0.4.1.tar.gz 145.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wordsmith-engine 0.4.1
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page