Skip to main content

A somewhat curated collection of words to use in nonce generation.

Project description

General Words

.. image::

.. image::

.. image::

Often, when building an application, I've had occasions where I need to provide
a nonce of some sort to a user. A nonce is some thing, whether number, or
otherwise, that is used only once.


The over-arching goal was for this to be simple to use,
and reasonably fast. Next, I wanted something that the average user would be
able to enter manually with minimal risk. This ruled out a lot of the crazy
mixed-case alphanumeric strings that are often used. Finally,
a goal was to have a reasonably large number of permutations available so
that the nonce, while not cryptographically strong, was strong enough for
uses like registration, password reset, etc. For example, with the default
`word source`_, and a selection of three words, there are
`almost 19 billion permutations`_ available. Presuming you're doing any form
of brute-force-attack prevention, this should be more than adequate.

.. _almost 19 billion permutations:

Word Source

The list of words comes from the `New General Service List`_ v1.01. The original
list, distributed in Excel format, is covered under the
`Creative Commons Attribution 3.0 Unported License`_. More information can be
found on the website. From the base data, the following changes have been made:

#. The list was converted from Excel to a simple one-word-per-line text file
2. Only headwords were retained for clarity;
3. Supplemental words, such as months and numbers, were added;
3. Words less than 4 characters were removed.

Combined, a total of 2,668 headwords were retained.

.. _New General Service List:
.. _Creative Commons Attribution 3.0 Unported License:

Usage Example

The library is trivially easy to use::

>>> from generalwords import *
>>> get_word()
>>> get_word()
>>> get_words(n=3)
('climb', 'repair', 'force')

In the future, there may be more options, but not right now.

Not Done Yet

While the library will never be massively complicated, there's a few things I'd
like to have in the future:

* Expand to other languages
* Add additional word sources


0.1.0 (2015-55)

* First release on PyPI.

Project details

Release history Release notifications | RSS feed

This version


Download files

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

Source Distribution

generalwords-1.0.tar.gz (17.2 kB view hashes)

Uploaded Source

Built Distribution

generalwords-1.0-py2.py3-none-any.whl (16.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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