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.

Person names

Use PersonName(style="varied") for a mix of given-name formats and rare modifiers. Configure a fixed form with given_name_format, prefix, generation, and credentials. Call person.from_hash(digest) with a hexadecimal SHA-256 digest for cross-language replay. See the person-name example.

Metadata

Release files for wordsmith-engine 0.7.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.7.0
File Size Uploaded Provenance Actions
wordsmith_engine-0.7.0.tar.gz 158.5 kB With provenance Details for wordsmith_engine-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 329.8 kB

Release files / wordsmith_engine-0.7.0.tar.gz

Download URL wordsmith_engine-0.7.0.tar.gz
Size 158.5 kB
Tags Source
SHA-256 checksum
How to use checksums
98f708d400e6aecef8ec71c90720879b847cbea3b8959411bcbbaacfad867935
BLAKE2b-256 checksum
How to use checksums
541cb0c1ac4042b3a8557e207edf068198e12a9d51ba52c7efc7fea3688e100e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

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

Download URL wordsmith_engine-0.7.0-py3-none-any.whl
Size 171.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21250eaca1ad41a9b8dd8cb7d8e8782fdb517bdc06414f37811e1dec5a5c17b7
BLAKE2b-256 checksum
How to use checksums
fc8192755303db6d92c067000ea5597c28ec54dac6aa67d950c6852db48cb3a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Security for wordsmith-engine 0.7.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.7.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 Nov 27, 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.7.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