Open In App

PyDictionary module in Python

Last Updated : 22 Aug, 2025
Comments
Improve
Suggest changes
6 Likes
Like
Report

PyDictionary is a Python module used to fetch word definitions, synonyms, antonyms and translations. It provides a simple interface to access these features from Python programs.

Note: The original PyDictionary may not work reliably with Python 3. A modified alternative called AyDictionary is available, which is more compatible with Python 3.

Installation

You can install PyDictionary using pip:

pip install PyDictionary

Getting Started with PyDictionary

1. Import the Module

from PyDictionary import PyDictionary

2. Create an Instance

dictionary = PyDictionary()

3. Fetch the Meaning of a Word

Use the meaning() method to get the definition of a word:

Python
# Get the meaning of "python"
meaning = dictionary.meaning("python")
print(meaning)

Output:

{'Noun': ['large nonvenomous snake', 'a programming language']}

4. Fetch Synonyms

You can get synonyms using the synonym() method:

Python
synonyms = dictionary.synonym("happy")
print(synonyms)

Output:

['content', 'joyful', 'cheerful']

5. Fetch Antonyms

The antonym() method returns antonyms:

Python
antonyms = dictionary.antonym("happy")
print(antonyms)

Output:

['sad', 'unhappy', 'miserable']

Related articles


Article Tags :

Explore