All Projects → vaibhavsingh97 → Random Word

vaibhavsingh97 / Random Word

Licence: mit
This is a simple python package to generate random english words

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Random Word

an-array-of-spanish-words
List of ~636,000 Spanish words
Stars: ✭ 31 (-58.67%)
Mutual labels:  word, words
An Array Of English Words
List of ~275,000 English words
Stars: ✭ 114 (+52%)
Mutual labels:  word, words
Rando Php
RandoPhp is a open source library that implements random generators (Integer, Char, Byte, Sequences, Boolean) and take random sample from arrays
Stars: ✭ 107 (+42.67%)
Mutual labels:  package, random
toggler
Atom plugin - Toggle words and symbols
Stars: ✭ 21 (-72%)
Mutual labels:  package, words
Random Bytes Readable Stream
Creates a readable stream producing cryptographically strong pseudo-random data using `crypto.randomBytes()`
Stars: ✭ 71 (-5.33%)
Mutual labels:  random
Ttpassgen
密码生成 flexible and scriptable password dictionary generator which can support brute-force、combination、complex rule mode etc...
Stars: ✭ 68 (-9.33%)
Mutual labels:  word
Pgen
Command-line passphrase generator
Stars: ✭ 68 (-9.33%)
Mutual labels:  random
Mnemonic Words
List of words for making random mnemonic sentences
Stars: ✭ 66 (-12%)
Mutual labels:  words
Manager
Implementation of the Manager pattern existing in Laravel framework
Stars: ✭ 74 (-1.33%)
Mutual labels:  package
R.matlab
R package: R.matlab
Stars: ✭ 72 (-4%)
Mutual labels:  package
Picasso
Laravel Image Management and Optimization Package
Stars: ✭ 70 (-6.67%)
Mutual labels:  package
Laravel Mentions
End-to-end mentions in Laravel 5.
Stars: ✭ 68 (-9.33%)
Mutual labels:  package
Laravel Ownership
Laravel Ownership simplify management of Eloquent model's owner.
Stars: ✭ 71 (-5.33%)
Mutual labels:  package
Random
Generate random strings or numeric values
Stars: ✭ 68 (-9.33%)
Mutual labels:  random
Env Providers
👷 Load Laravel service providers based on your application's environment.
Stars: ✭ 73 (-2.67%)
Mutual labels:  package
Npm Api
Node.js library for getting info from NPM’s API
Stars: ✭ 67 (-10.67%)
Mutual labels:  package
Parallelly
R package: parallelly - Enhancing the 'parallel' Package
Stars: ✭ 70 (-6.67%)
Mutual labels:  package
Ex admin
ExAdmin is an auto administration package for Elixir and the Phoenix Framework
Stars: ✭ 1,180 (+1473.33%)
Mutual labels:  package
Django Webpacker
A django compressor tool that bundles css, js files to a single css, js file with webpack and updates your html files with respective css, js file path.
Stars: ✭ 69 (-8%)
Mutual labels:  package
Expandable Collection View Kit
🗂 Expandable, hierarchical, flexible, declarative UICollectionView with diffable data sources & SwiftUI-like tree items builder [Swift 5.1, iOS & iPadOS 13].
Stars: ✭ 69 (-8%)
Mutual labels:  package

random-word

Build PyPI version PyPI - Python Version PyPI - Status Codacy Badge Downloads License: MIT

This is a simple python package to generate random english words. If you need help after reading the below, please find me at @vaibhavsingh97 on Twitter.

If you love the package, please 🌟 the repo.

Installation

You should be able to install using easy_install or pip in the usual ways:

$ easy_install random-word
$ pip install random-word

Or just clone this repository and run:

$ python3 setup.py install

Or place the random-word folder that you downloaded somewhere where it can be accessed by your scripts.

Basic Usage

from random_word import RandomWords
r = RandomWords()

# Return a single random word
r.get_random_word()
# Return list of Random words
r.get_random_words()
# Return Word of the day
r.word_of_the_day()

Advance Usage

  1. To generate single random word we can use these optional parameters

    • hasDictionaryDef (string) - Only return words with dictionary definitions (optional)
    • includePartOfSpeech (string) - CSV part-of-speech values to include (optional)
    • excludePartOfSpeech (string) - CSV part-of-speech values to exclude (optional)
    • minCorpusCount (integer) - Minimum corpus frequency for terms (optional)
    • maxCorpusCount (integer) - Maximum corpus frequency for terms (optional)
    • minDictionaryCount (integer) - Minimum dictionary count (optional)
    • maxDictionaryCount (integer) - Maximum dictionary count (optional)
    • minLength (integer) - Minimum word length (optional)
    • maxLength (integer) - Maximum word length (optional)
    r.get_random_word(hasDictionaryDef="true", includePartOfSpeech="noun,verb", minCorpusCount=1, maxCorpusCount=10, minDictionaryCount=1, maxDictionaryCount=10, minLength=5, maxLength=10)
    
    # Output: pediophobia
    
  2. To generate list of random word we can use these optional parameters

    • hasDictionaryDef (string) - Only return words with dictionary definitions (optional)
    • includePartOfSpeech (string) - CSV part-of-speech values to include (optional)
    • excludePartOfSpeech (string) - CSV part-of-speech values to exclude (optional)
    • minCorpusCount (integer) - Minimum corpus frequency for terms (optional)
    • maxCorpusCount (integer) - Maximum corpus frequency for terms (optional)
    • minDictionaryCount (integer) - Minimum dictionary count (optional)
    • maxDictionaryCount (integer) - Maximum dictionary count (optional)
    • minLength (integer) - Minimum word length (optional)
    • maxLength (integer) - Maximum word length (optional)
    • sortBy (string) - Attribute to sort by alpha or count (optional)
    • sortOrder (string) - Sort direction by asc or desc (optional)
    • limit (integer) - Maximum number of results to return (optional)
    r.get_random_words(hasDictionaryDef="true", includePartOfSpeech="noun,verb", minCorpusCount=1, maxCorpusCount=10, minDictionaryCount=1, maxDictionaryCount=10, minLength=5, maxLength=10, sortBy="alpha", sortOrder="asc", limit=15)
    
    # Output: ['ambivert', 'calcspar', 'deaness', 'entrete', 'gades', 'monkeydom', 'outclimbed', 'outdared', 'pistoleers', 'redbugs', 'snake-line', 'subrules', 'subtrends', 'torenia', 'unhides']
    
  3. To get word of the day we can use these optional parameters

    • date (string) - Fetches by date in yyyy-MM-dd (optional)
    r.word_of_the_day(date="2018-01-01")
    
    # Output: {"word": "qualtagh", "definations": [{"text": "The first person one encounters, either after leaving one\'s home or (sometimes) outside one\'s home, especially on New Year\'s Day.", "source": "wiktionary", "partOfSpeech": "noun"}, {"text": "A Christmas or New Year\'s ceremony, in the Isle of Man; one who takes part in the ceremony. See the first extract.", "source": "century", "partOfSpeech": "noun"}]}
    

Development

Assuming that you have Python and pipenv installed, set up your environment and install the required dependencies like this instead of the pip install random-word defined above:

$ git clone https://github.com/vaibhavsingh97/random-word.git
$ cd random-word
$ pipenv install
...
$ pipenv shell

Add API Key in random_word directory defining API Key in config.py. If you don't have an API key than request your API key here

API_KEY = "<API KEY>"

After that, install your package locally

$ pip install -e .

Issues

You can report the bugs at the issue tracker

License

Built with ♥ by Vaibhav Singh(@vaibhavsingh97) under MIT License

You can find a copy of the License at https://vaibhavsingh97.mit-license.org/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].