A simple Python package that looks up synonyms for words.
Synnamon: Offline synonyms for English words (Python 3.8+)
What is it?
Synnamon is a simple Python package that looks up synonyms using a built in thesaurus shelve file instead of reaching out to web resources (PyDictionary) or using large English lexical databases (nltk WordNet).
Where to get it
Source code: https://github.com/eddiethedean/synnamon
# PyPI
pip install synnamon
Requirements
- Python 3.8+
- Dependency:
inflex(used to convert plural word lookups to singular and then convert singular synonym results to plural)
Usage
import synnamon
syns = synnamon.get_syns('jump')
print(syns.get('verb', [])[:5])
Behavior
- Input is normalized to lowercase and trimmed.
- If the plural form is not found,
get_synswill try the singular form and pluralize only the noun synonyms. - Returns
{}for unknown words or empty/whitespace input.
API
from synnamon import get_syns
def get_syns(word: str) -> dict:
"""Get synonyms for a word from the built-in thesaurus."""
Development
Run tests with pytest:
pytest -q
Test configuration lives in pyproject.toml and collects coverage for synnnamon.
Metadata
Release files for synnamon 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| synnamon-0.2.0.tar.gz | 6.5 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| synnamon-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.0 MB
Release files / synnamon-0.2.0.tar.gz
| Download URL | synnamon-0.2.0.tar.gz |
|---|---|
| Size | 6.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
23dffa3863e6a1e35443375d243307cb3345d1532600073dd1fb90e3bdca4644
|
|
BLAKE2b-256 checksum How to use checksums |
e54e6b922474f3c0ba43633595e2337a7acbc825656c167621281f54beaa80cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / synnamon-0.2.0-py3-none-any.whl
| Download URL | synnamon-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a49356975c512bf8e231b8dab40ccbdd511ab7c2ce06ef888ae90408b05c564
|
|
BLAKE2b-256 checksum How to use checksums |
c8ce8a12e5994ed435f1ddbc2aaaa860c7f27229756506c029477129ee982c5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|