Parameters tableยถ

Summary of all parameters.

โœ… means that parameter acts when RandomGenerator is created: it either configures the generator, or acts as load-time validation. If such validation fails, ConfigurationError is raised.

๐Ÿš€ means that parameter acts at runtime every time generate() or generate_slug() is called. Itโ€™s to silently discard unwanted combinations.

Parameter

Scope

When

Type

Default value

Description

allow_whitespace

Words list, Phrases list, *.txt, Constant list; "all" list as a fallback [1]

โœ…

bool

False

Allow words or words within a phrase to contain whitespace.

generator

Any top-level list

โœ…

bool

False [2]

List is a generator endpoint and can be used in generate().

ensure_unique

RandomGenerator instance via "all" list

๐Ÿš€

bool

True

Donโ€™t generate combinations with repeating words.

ensure_unique_prefix

RandomGenerator instance via "all" list

๐Ÿš€

int | None

None

Donโ€™t generate combinations where first N symbols of any two word match, e.g. "great-fox-of-greatness".

max_length

Words list, Phrases list, *.txt

โœ…

int | None

None

Maximum number of characters in a word or phrase (not counting separators).

max_slug_length

RandomGenerator instance via "all" list

๐Ÿš€

int | None

None

Donโ€™t generate slugs with total length (including separators) exceeding N.

number_of_words

Phrases list, *.txt

โœ…

int | None

None

Exact number of words in every phrase in this list.

separator

Phrases list, *.txt; "all" list as a fallback [1]

โœ…

str

r're:\s+'

Separator used to split phrases defined as plain strings (not as lists/tuples). Use 're:' prefix for regular expression.

strip_whitespace

Words list, Phrases list, *.txt; "all" list as a fallback [1]

โœ…

bool

True

Strip leading and trailing whitespace from phrases and words before further processing.

word_regex

Words list, Phrases list, *.txt, Constant list; "all" list as a fallback [1]

โœ…

str

r'\w+'

Regex to validate all words. Default: any Unicode letters, numbers, underscore. [3]

Footnotes