Skip to main content

A useful module for random text.

Project description

Overview

RandomWords is a useful package for generate random words, nicks and senteces (soon).

Requirements

  • Python 2.6 or 2.7

  • Liunx, Windows?, Mac OSX?, BSD?

Install

Quick way:

pip install RandomWords

or:

git clone https://github.com/tomislater/RandomWords.git
cd RandomWords
python setup.py install

How to use

Random words:

>>> from random_words import RandomWords
>>> rw = RandomWords()
>>> word = rw.random_word()
>>> print word
factors

>>> word = rw.random_word('y')
>>> print word
yards

>>> words = rw.random_words(count=10)
>>> print words
['runs', 'experience', 'comments', 'freedom', 'permit', 'honks', 'pins', 'texts', 'grant', 'fathers']

>>> words = rw.random_words(letter='r', count=5)
>>> print words
['raincoat', 'reactance', 'room', 'relocation', 'rudders']

>>> words = rw.random_words(letter=None, count=2)
>>> print words
['tides', 'eights']

Random nicks:

>>> from random_words import RandomNicknames
>>> rn = RandomNicknames()

>>> rn.random_nick()
'Fredrick'

>>> rn.random_nick('y')
'York'

>>> rn.random_nick(letter='r', gender='m')
'Roosevelt'

>>> rn.random_nick(letter='r', gender='f')
'Rene'

>>> rn.random_nicks()
['Fionn']

>>> rn.random_nicks(count=10)
['Kristy', 'Imani', 'Delbert', 'Brevyn', 'Jasmin', 'Genevieve', 'Clodagh', 'Graham', 'Sondra', 'Ed']

>>> rn.random_nicks(letter='u', gender='f', count=4)
['Una', 'Uma', 'Ursula', 'Ulrica']

>>> rn.random_nicks(letter='a', gender='m', count=4)
['Anthony', 'Alec', 'Antonio', 'Adam']

>>> rn.random_nicks(gender='m', count=5)
['Elijah', 'Abraham', 'Noel', 'Myles', 'Pedro']

>>> rn.random_nicks(gender='f', count=5)
['Sabrina', 'Debbie', 'Jerri', 'Savannah', 'Wendy']

TODO

  • random sentence/sentences

  • random lorem ipsum

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

RandomWords-0.1.3.tar.gz (25.4 kB view details)

Uploaded Source

File details

Details for the file RandomWords-0.1.3.tar.gz.

File metadata

  • Download URL: RandomWords-0.1.3.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for RandomWords-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5e69ec4a52b5b6036ad0e9033fea909718a64dc91018c713f51f1916205d843a
MD5 d180125e5ed8e7cceda4f8d24cdc826c
BLAKE2b-256 3481955d57813dcd83403219a556dde2b4727b55d03ebb2ad9fc3985573fb396

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page