A Python package to generate random things.
Currently, randomit
can generate a random word(s) based on a given theme, as well as load your words files to randomize them.
To see what’s coming next, see open projects.
$ pip install randomit
$ git clone https://github.com/dimitryzub/randomit.git
Words will always be different on each execution no matter what arguments being passed.
from randomit.words_randomizer import Words
# return one word
Words().randomizer(return_one_word=True)
# cabinet
# bristlecone pine
# dim - bright
Words().randomizer() # returns a list of 17k words
Words().randomizer(words_to_return=3) # ['axis', 'overabundant', 'superuser']
Words().randomizer(letter_starts_with='A') # returns all words that starts with letter "A"
Words().randomizer(letter_starts_with='A', words_to_return=3) # ['abandoned', 'able', 'absolute']
Words().randomizer(letter_starts_with='A', words_to_return=3, capitalize=True) # ['Apron', 'Ashes', 'Anvil']
If “theme” argument is not specified ➡ defaults to “random words“.
Words().available_themes()
# ['random words', 'names', 'surnames', 'cities', 'countries', 'address']
Words(theme='cities').randomizer() # pass available arguments + other theme from available_themes()
Make sure all words are lowercase, and start on a new line (\n
), otherwise it won’t work.
# call your words
Words(file=YOUR_FILE).randomizer(return_one_word=True, capitalize=True)
# Bazinga!
If you have any suggestions or ideas what will be good to add, get involved in discussions section.
For issues, visit issues page 🙃
Note for replit.com users. If you’re using randomit
on replit, it will throw an error for no obvious for me reason. If you know how to fix it, please, let me know. Installing package locally via pip
doesn’t produce that error as it should (tested in Pycharm).
To read more in-depth about something, visit documentation page.