Package: randomit
Randomit 🎲A Python library to generate random things.Currently,randomitcan:Generaterandom word(s)based on a giventheme.Load your filesthatcontainwordsto randomize them.Randomize imagesbased on a given query.Generate randomphone numbers.Generate/randomizeemail address.To see what's coming next, seeopen projects.💡UsageWords/addresses will always be different on each execution no matter what arguments being passed.Get Random Wordsfromrandomit.randomizerimportWords# return one wordWords(theme='random words').randomize(return_one_word=True)# cabinet# bristlecone pine# dim - brightWords(theme='random words').randomize()# returns a list of 17k wordsWords(theme='random words').randomize(amount_to_return=3)# ['axis', 'overabundant', 'superuser']Words(theme='random words').randomize(letter_starts_with='A')# returns all words that starts with letter "A"Words(theme='random words').randomize(letter_starts_with='A',amount_to_return=3)# ['abandoned', 'able', 'absolute']Words(theme='names').randomize(letter_starts_with='A',amount_to_return=3,capitalize=True)# ['Apron', 'Ashes', 'Anvil']Get Random Addressesimportjsonaddress_list=Words(theme='address').randomize(amount_to_return=1,return_dict=True)print(json.dumps(address_list,indent=2))'''[{"address": "279 troy road","city": "east greenbush","state": "ny","zip": "12061"}]'''# if "return_dict" argument isn't specified it will return a list():'''["2465 hempstead turnpike, east meadow ny 11554"]'''If you want to add your list of addresses, have a look ataddresses_list.txtand format it as it's formatted there to work properly.Format:address, city, state, zipLook for available built-in themesIf "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 fromWords(theme='cities').randomize()# pass available argumentsLoad and pass file(s) with wordsMake sure all words arelowercase, and start on anew line(\n), otherwise it won't work.# call your wordsWords(file=YOUR_FILE).randomize(capitalize=True,return_one_word=True)# Bazinga!Get Random ImagesEnter any query, and it will return a random image(s) URL based on the provided query, and it will be random on each execution.Note: If you don't need this feature and want to get rid of dependencies,usepoetry remove package_namefromrandomit.randomizerimportImagesImages(query='cats',amount_to_return=3).get_randomized()# ['https://images.pexels.com/photos/1170986/pexels-photo-1170986.jpeg', 'https://images.pexels.com/photos/1056251/pexels-photo-1056251.jpeg', 'https://images.pexels.com/photos/1056251/pexels-photo-1056251.jpeg']# if "amount_to_return" argument is not specified -> defaults to batch of 100 images.📡 Installationpip install randomitgit clone https://github.com/dimitryzub/randomit.git👾 SuggestionsIf you have any suggestions or ideas what will be good to add, get involved indiscussionssection.🔬 IssuesFor issues, visitissues page🙃Note forreplit.comusers. If you’re usingrandomiton 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 viapipdoesn’t produce such error as it should (tested in Pycharm and VSCode).📜 DocsTo read more in-depth about something, visitdocumentationpage. Currently, there's nothing there. It's under development. Soon there will be more examples.