a function to create random usernames
Project description
a function to create random usernames
Tested against Windows / Python 3.11 / Anaconda
pip install genranddata
Generate random data using a given function and input data, while ensuring uniqueness and handling exceptions.
Parameters:
fu (callable): The function used to generate new data.
data (Union[list, tuple]): The input data to be used in the generation process.
created_already (list): A list of data that has already been created.
limit (int): The maximum number of new data to be generated.
**kwargs: Additional keyword arguments to be passed to the function.
Returns:
list: A list of randomly generated data, with a length not exceeding the specified limit.
from genranddata import create_random_data, load_data, save_data, genfunction
u = [
"Agent",
"Alex",
"Alonzo",
"Amon",
"Angel",
"Annie",
"Anton",
"August",
"Bane",
"Buddy",
"Calvin",
"Candyman",
"Captain",
"Catherine",
"Chucky",
"Colin",
"Commodus",
"Count",
"Cruella",
"Darth",
"Davy",
"Deadly",
"Death",
"Dolores",
"Dr",
"Elijah",
"Erik",
"Ernst",
"Esther",
"Frank",
"Freddy",
"Ghostface",
"Godzilla",
"Gollum",
"Gordon",
"Gozer",
"Green",
"HAL",
"Harry",
"Howard",
"Immortan",
"Ivan",
"Jack",
"Jason",
"Jigsaw",
"John",
"Joker",
"Judge",
"Khan",
"Koba",
"Lee",
"Lex",
"Lil",
"Lord",
"Lots",
"Maleficent",
"Margaret",
"Max",
"Michael",
"Miranda",
"Miss",
"Mrs",
"Norman",
"Nurse",
"Palpatine",
"Pazuzu",
"Pennywise",
"Predator",
"Queen",
"Raoul",
"Regina",
"Roger",
"Roy",
"Sauron",
"Scar",
"Shere",
"Shooter",
"T",
"Terence",
"Thanos",
"The",
"Ursula",
"Vice",
"William",
"Xenomorphs",
]
empty = []
save_data(empty, "c:\\testusername.pkl")
already_created = load_data("c:\\testusername.pkl")
gendata = create_random_data(
fu=lambda x, **kwargs: genfunction(x, **kwargs),
data=u,
created_already=already_created,
limit=10,
min_=2,
max_=4,
camel_case_percentage=20,
uppercase_percentage=30,
lowercase_percentage=30,
join_values=("x", "_", ""),
random_number_percentage=30,
random_number_range=(0, 100),
)
print(gendata)
# ['maleficent_xenomorphs_alex_max', 'queenlexantonnorman', 'DarthxJack', 'WilliamMaxRaoulAlonzo', 'MissxIvanxCaptainxMax', 'SAURONFREDDYAGENTDR', 'CAPTAIN_JOHN_ROGER_GREEN', 'JOKERERIKFREDDYESTHER71', 'scar_roger_1', 'T_GHOSTFACE_ANGEL_4']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
genranddata-0.10.tar.gz
(5.2 kB
view details)
Built Distribution
File details
Details for the file genranddata-0.10.tar.gz
.
File metadata
- Download URL: genranddata-0.10.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03075b5932f38e886e65c07482cf5b83f96ae3c59f590825c0bc061d6cddd9e7 |
|
MD5 | ba2b449c80268e17f33dccedb4390328 |
|
BLAKE2b-256 | d92ef0c8142f11cee469137d9b1acb0a18fac0b31bec84d64568bec32f9fb7a0 |
File details
Details for the file genranddata-0.10-py3-none-any.whl
.
File metadata
- Download URL: genranddata-0.10-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 577cbbfb5444f99f6045cc5862e982b98de9ae585b69d6a8ce709a156467d320 |
|
MD5 | 146df9a5530b78597e466262d2fccd2e |
|
BLAKE2b-256 | 14a9f158bc814d0b4cbfdd491b08dcd4e1556a107f69d01ce646b378ac5acc98 |