prefect.utilities.names
¶
generate_slug
¶
Generates a random slug.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
- |
n_words (int
|
the number of words in the slug |
required |
Source code in prefect/utilities/names.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
obfuscate
¶
Obfuscates any data type's string representation. See obfuscate_string
.
Source code in prefect/utilities/names.py
45 46 47 48 49 50 51 52 |
|
obfuscate_string
¶
Obfuscates a string by returning a new string of 8 characters. If the input string is longer than 10 characters and show_tail is True, then up to 4 of its final characters will become final characters of the obfuscated string; all other characters are "*".
"abc" -> "*" "abcdefgh" -> "*" "abcdefghijk" -> "*k" "abcdefghijklmnopqrs" -> "****pqrs"
Source code in prefect/utilities/names.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|