Simple generators¶
BinaryGenerator¶
Generate synthetic bytes, optionally with MIME-sniffable signature bytes.
Why: Use BinaryGenerator for bounded binary payload fixtures, optionally with a recognisable MIME signature; use a file source when realistic document contents matter.
Category: core.
Output: bytes.
1 | |
Parameters¶
min_len:int | None; DefaultNoneβ Inclusive minimum payload size in bytes.max_len:int | None; DefaultNoneβ Inclusive maximum payload size in bytes.mime_type:str | None; DefaultNoneβ Optional MIME type whose signature bytes prefix the generated payload.
BooleanGenerator¶
Generate a boolean with a configurable probability of returning true.
Why: Use BooleanGenerator for binary business states with a known prevalence, such as active or consented; use a constant when every row must have the same state.
Category: core.
Output: bool.
1 | |
Parameters¶
prob_true:float; Default0.5β Probability from 0.0 to 1.0 that a row evaluates to true.
ColorGenerator¶
Generate color values in different formats.
Why: Use ColorGenerator for UI, catalogue, or theme fixtures that need syntactically valid color values; use a constant when brand colors are fixed requirements.
Category: core.
Output: str.
1 | |
Parameters¶
format_type:str; Defaulthexβ Output representation: hexadecimal, RGB, or named color.
FloatGenerator¶
Generate floating-point values within a configurable range and distribution.
Why: Use FloatGenerator for bounded measurements, ratios, or monetary test values that require decimal granularity; use IntegerGenerator when fractional values are invalid.
Category: core.
Output: float.
1 | |
Parameters¶
min:float | null; DefaultNoneβ Inclusive lower bound of generated values.max:float | null; DefaultNoneβ Inclusive upper bound of generated values.granularity:float | null; DefaultNoneβ Smallest permitted step between generated values.distribution:str | null; DefaultNoneβ Statistical distribution used across the bounded numeric grid.
HashGenerator¶
Generate cryptographic hashes using various algorithms.
Why: Use HashGenerator for new random digest-shaped values such as synthetic fingerprints; use the Hash converter to pseudonymize an existing source value reproducibly.
Category: core.
Output: str.
1 | |
Parameters¶
algorithm:str; Defaultsha256β Supported cryptographic digest algorithm used for the random input.
IncrementGenerator¶
Generate a sequential integer as a pure function of the row position.
Why: Use IncrementGenerator for row-position-derived local sequences whose result must be worker-invariant; use SequenceTableGenerator when a database must coordinate identifiers across runs.
Category: core.
Output: int.
1 | |
Parameters¶
start:int; Default1β Value produced for the first row.end:int; Default9223372036854775807β Upper sequence boundary used to detect exhaustion.step:int; Default1β Signed increment applied for each following row position.include_end:bool; DefaultTrueβ Whether the exact end boundary is a valid output.
IntegerGenerator¶
Generate integer values within a configurable range, granularity, and distribution.
Why: Use IntegerGenerator for bounded counts, scores, and ordinal fixtures with optional granularity and distribution; use IncrementGenerator when values must follow row order.
Category: core.
Output: int.
1 | |
Parameters¶
min:int | null; DefaultNoneβ Inclusive lower bound of generated integers.max:int | null; DefaultNoneβ Inclusive upper bound of generated integers.granularity:int | null; DefaultNoneβ Positive step defining the permitted integer grid.distribution:str | null; DefaultNoneβ Statistical distribution used across the bounded grid.
NumericStringGenerator¶
Generate a numeric string using a deterministic RNG.
Why: Use NumericStringGenerator for fixed- or variable-width digit strings where leading zeroes must be retained; use IntegerGenerator when numeric arithmetic and ordering matter.
Category: core.
Output: str.
1 | |
Parameters¶
length:int | null; DefaultNoneβ Fixed output length; mutually exclusive with min_len and max_len.min_len:int | null; DefaultNoneβ Inclusive minimum output length when length is omitted.max_len:int | null; DefaultNoneβ Inclusive maximum output length when length is omitted.char_set:str | null; DefaultNoneβ Non-empty characters sampled for each output position.
PrefixedIdGenerator¶
Generate an ID composed of a prefix and a regex-defined body.
Why: Use PrefixedIdGenerator for deterministic identifiers with a fixed business prefix and patterned body.
Category: core.
Output: str.
1 | |
Parameters¶
prefix:str; Defaultrequiredβ Fixed business prefix placed before the generated body.body_pattern:str; Defaultrequiredβ Regular-expression pattern defining the identifier body.separator:str; Default-β Constant text inserted between prefix and body.
StringGenerator¶
Generate strings with configurable length, character set, uniqueness, prefix, and suffix.
Why: Use StringGenerator for bounded synthetic strings with an explicit alphabet and optional affixes; use RegexStringGenerator when the entire lexical shape is best expressed as a regular expression.
Category: core.
Output: str.
1 | |
Parameters¶
min_len:int | null; DefaultNoneβ Inclusive minimum length of the generated body.max_len:int | null; DefaultNoneβ Inclusive maximum length of the generated body.char_set:str | null; DefaultNoneβ Non-empty alphabet sampled for the generated body.unique:bool; DefaultFalseβ Whether values must be unique within the supported in-process pool.prefix:str | null; DefaultNoneβ Constant text prepended to the generated body.suffix:str | null; DefaultNoneβ Constant text appended to the generated body.
UUIDGenerator¶
Generate UUID version 4 identifiers from the deterministic row RNG when seeded.
Why: Use UUIDGenerator for opaque UUIDv4-shaped identifiers that remain reproducible under a seeded model; use IncrementGenerator when human-readable ordering matters.
Category: core.
Output: str.
1 | |