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):
sourcesis an iterable containing strings corresponding to word list identifiers (see "Word lists" subsection below)alpha(defaultFalse) is a flag specifying that all non-alphanumeric characters (e.g.:-,') should be strippedlower(defaultFalse) 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
most words in the gcide word list are capitalized.
Word lists
| Name/URL | Identifier | Notes |
|---|---|---|
| GCIDE 0.53 index | gcide |
Words found in GNU Collaborative International Dictionary of English 0.53. Most words capitalized (not exactly sure what the capitalization convention is). Contains some entries with multiple words (currently you must use the alpha option to exclude these). 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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| english-words-2.0.2.tar.gz | 8.2 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| english_words-2.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.3 MB
Release files / english-words-2.0.2.tar.gz
| Download URL | english-words-2.0.2.tar.gz |
|---|---|
| Size | 8.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e51d05607fe92ebf65047a2359e977c78a46aa16d1d92a3cba0bac3e34957d8e
|
|
BLAKE2b-256 checksum How to use checksums |
8e9512d90f2a3af18305b13d7c09401b59bd235db4cfb63d76ddf594748c2de8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / english_words-2.0.2-py3-none-any.whl
| Download URL | english_words-2.0.2-py3-none-any.whl |
|---|---|
| Size | 8.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a65b900b17201526d8ab2d414f45e5a37afc714a1857377b30182c754ae6e0d6
|
|
BLAKE2b-256 checksum How to use checksums |
906f42700113073ca6775fb12a260112f0cb36449a2c2e42dcd53d3fcc6970b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for english-words 2.0.2
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.