Skip to main content

PyPI

english-words-py

Returns sets of English words created by combining different words lists together. Example usage: to get a set of English words from the "web2" word list, including only lower-case letters, you write the following:

>>> from english_words import get_english_words_set
>>> web2lowerset = get_english_words_set(['web2'], lower=True)

Usage

From the main package, import get_english_words_set as demonstrated above. This function takes a number of arguments; the first is a list of word list identifiers for the word lists to combine and the rest are flags. These arguments are described here (in the following order):

  • sources is an iterable containing strings corresponding to word list identifiers (see "Word lists" subsection below)
  • alpha (default False) is a flag specifying that all non-alphanumeric characters (e.g.: -, ') should be stripped
  • lower (default False ) is a flag specifying that all upper-case letters should be converted to lower-case

Each word list is pre-processed to handle the above flags, so using any combination of options will not cause the function to run slower.

Note that some care needs to be used when combining word lists. For example, only proper nouns in the web2 word list are capitalized, but every word in the gcide word list is capitalized.

Word lists

Name/URL Identifier Notes
GCIDE 0.53 index gcide Words found in GNU Collaborative International Dictionary of English 0.53. All words capitalized, and like a dictionary.

Unicode characters are currently unprocessed; for example <ae/ is present in the dictionary instead of æ. Ideally, these should all be converted.
web2 revision 326913 web2

Adding additional word lists

To add a word list, say with identifier x, put the word list (one word per line), into a plain text file x.txt in the raw_data directory at the root of the repository. Then, to process the word list (and all others in the directory) run the script process_raw_data.py.

Installation

Install this with pip with

pip install english-words

This package is unfortunately rather large (~20MB), and will run into scaling issues if more word lists or (especially) options are added. When that bridge is crossed, word lists should possibly be chosen by the user instead of simply including all of them; word lists could also be preprocessed on the client side instead of being included in the package.

Metadata

Release files for english-words 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for english-words 2.0.0
File Size Uploaded Provenance Actions
english-words-2.0.0.tar.gz 8.2 MB Without provenance Details for english-words-2.0.0.tar.gz

Release files / english-words-2.0.0.tar.gz

Download URL english-words-2.0.0.tar.gz
Size 8.2 MB
Tags Source
SHA-256 checksum
How to use checksums
123d7308fbbfe0c39dccb6984f92af847035b59482e51fcf1f6a4943dd4782b9
BLAKE2b-256 checksum
How to use checksums
34554a8c7eb50e2c9445e8dd8e1960893050267179359fbd348a0601b800d7c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.6

Security for english-words 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page