Python module that uses free dictionary API to retrieve definitions, examples, synonyms, antonyms, and audio of english words
Project description
Glossary.py
Glossary.py is a Python module that interacts with an online dictionary API. It's designed to fetch and manage word descriptions, phonetics, and semantics in a structured way.
Key Features:
- Fetches word descriptions, phonetics, and semantics from an online dictionary API.
- Implements a class-based approach for managing fetched data.
- Allows to set a limit for the number of descriptions per part of speech for a word.
- Provides audio transcription and audio file link for the fetched word.
- Allows to get all definitions or definitions based on a part of speech.
Installation
pip install python-glossary
How to Use:
from python_glossary.glossary import Glossary
# Create a rule object and set a limit for descriptions
rules = Glossary.Rules()
rules.set_limit_of_descriptions(3)
# Create a word object with a specific word and rule
word = Glossary.Word('example', rules)
# Check if the word exists
if word.exists():
# Get transcription
print(word.get_transcription())
# Get audio link
print(word.get_audio())
# Get all definitions
print(word.get_all_definitions())
# Get definitions for a specific part of speech
print(word.get_definitions_of_part_of_speech('noun'))
Requirements:
- Python 3.8+
- requests
Please note, this module relies on the API at https://api.dictionaryapi.dev/api/v2/entries/en/{input_word} for fetching word data. Ensure you have a stable internet connection while using this module.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_glossary-0.0.2.tar.gz.
File metadata
- Download URL: python_glossary-0.0.2.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3ef476d6af27730845a89dbcd1b42b154e53bdb63ddea74fe493f31b0966f41
|
|
| MD5 |
8afac82bb301f7f263b153766e94fa21
|
|
| BLAKE2b-256 |
304362273e9e1794f310cedc9c2fa3eec902f63574b934a8e061407940bdb5cc
|
File details
Details for the file python_glossary-0.0.2-py3-none-any.whl.
File metadata
- Download URL: python_glossary-0.0.2-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee3826f0b58c3fa0efe44d140520a820ae3d2964a58ade0e27a08e3e42c7b13a
|
|
| MD5 |
47e75b84e1c8d93307d0f910c6423f4e
|
|
| BLAKE2b-256 |
271cd4be4481f1c9e36cefee5202eee5107fbf7587b7fe6d002a4268db5f034c
|