randomit

A Python package to generate random things.

View the Project on GitHub dimitryzub/randomit

Randomit 🎲

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.

📡 Installation

$ pip install randomit
$ git clone https://github.com/dimitryzub/randomit.git

🕹️ Quickstart

Words will always be different on each execution no matter what arguments being passed.

Randomize words

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']

Look for available built-in themes

If “theme” argument is not specified ➡ defaults to “random words.

Words().available_themes()
# ['random words', 'names', 'surnames', 'cities', 'countries', 'address']

Specify theme you want to get words from

Words(theme='cities').randomizer() # pass available arguments + other theme from available_themes()

Load and pass your file(s) with words

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!

👾 Suggestions

If you have any suggestions or ideas what will be good to add, get involved in discussions section.

🔬 Issues

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).

📜 Docs

To read more in-depth about something, visit documentation page.