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. Title casing also normalizes the Mc prefix: mcdowell becomes McDowell, and mccormick becomes McCormick.

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.

TavernName, LandmarkName, and OrganizationName create names for inns, natural features and ruins, and guilds, orders, and societies. Each takes no constructor arguments and composes with the other components.

BusinessName, CelestialBodyName, and CreatureName use the same component interface to create fictional company, celestial body, and creature names. They also take no constructor arguments and use the caller-owned random source.

Reusable naming parts include TavernAnimal, BusinessColor, BodyPart, CreatureType, and CelestialObjectType. CompoundCreatureName, CompoundLandmarkName, and HeraldicSymbol compose smaller components. NaturalNameRoot selects from a required landmark or creature context. These components keep specialized vocabularies separate.

ArtifactName, SpellName, OperationName, and FestivalName add relics, magic, missions, and celebrations. They reuse existing name and word components. ArtifactObject, SpellEffect, MagicalConcept, OperationColor, and Season are also available for custom compositions.

See the repository README for the complete feature list, TypeScript usage, examples, and development guide.

Metadata

Release files for wordsmith-engine 0.5.0

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.5.0
File Size Uploaded Provenance Actions
wordsmith_engine-0.5.0.tar.gz 153.8 kB With provenance Details for wordsmith_engine-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wordsmith-engine 0.5.0
File Interpreter ABI Platform Actions
wordsmith_engine-0.5.0-py3-none-any.whl Python 3 none any Details for wordsmith_engine-0.5.0-py3-none-any.whl

Total release size: 322.1 kB

Release files / wordsmith_engine-0.5.0.tar.gz

Download URL wordsmith_engine-0.5.0.tar.gz
Size 153.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8147b1f54ff255ebd8a21c2b52f0996d04c2951f89c418345be8a687888ee42e
BLAKE2b-256 checksum
How to use checksums
d2853501f3057de6d338c544432f74ca5d13c1d3d747bfc51723250c78b8ed1c
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 17, 2026.

Transparency log

Release files / wordsmith_engine-0.5.0-py3-none-any.whl

Download URL wordsmith_engine-0.5.0-py3-none-any.whl
Size 168.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7caac9c38b6ff42567c4a3ecf1cc1d95b7a5540df35012cfeefdd0c7ed0cdd68
BLAKE2b-256 checksum
How to use checksums
edd33d5af7ebb4cebbbdb708a065bdbb7d89947b913eea1f7c293b00aaf70e50
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 17, 2026.

Transparency log

Security for wordsmith-engine 0.5.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wordsmith_engine-0.5.0.tar.gz

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 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files Full provenance

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