runway.lookups.handlers.random_string module¶
Generate a random string.
- pydantic model runway.lookups.handlers.random_string.ArgsDataModel[source]¶
Bases:
BaseModel
Arguments data model.
Show JSON schema
{ "title": "ArgsDataModel", "description": "Arguments data model.", "type": "object", "properties": { "digits": { "default": true, "title": "Digits", "type": "boolean" }, "lowercase": { "default": true, "title": "Lowercase", "type": "boolean" }, "punctuation": { "default": false, "title": "Punctuation", "type": "boolean" }, "uppercase": { "default": true, "title": "Uppercase", "type": "boolean" } } }
- class runway.lookups.handlers.random_string.RandomStringLookup[source]¶
Bases:
LookupHandler
[Any
]Random string lookup.
- static calculate_char_set(args: ArgsDataModel) str [source]¶
Calculate character set from the provided arguments.
- classmethod ensure_has_one_of(args: ArgsDataModel, value: str) bool [source]¶
Ensure value has at least one of each required character.
- Parameters:
args – Hook args.
value – Value to check.
- static generate_random_string(char_set: Sequence[str], length: int) str [source]¶
Generate a random string of a set length from a set of characters.