Dicio: A Python API for Exploring the Richness of the Portuguese Language
Are you interested in exploring the depths of the Portuguese language? Look no further! Meet Dicio, a python API for Dicio.com.br, a comprehensive online dictionary. Dicio allows users to search for words and access detailed information such as meanings, synonyms, examples, and even etymology.
Installation
Getting started with Dicio is a breeze. Simply run the following command to install the Dicio
package using pip:
sh
$ pip install Dicio
Usage
Dicio provides a user-friendly and versatile API that empowers users to dig deeper into the world of Portuguese vocabulary. Here’s a quick glimpse of how to leverage Dicio’s features and functionalities:
“`python
from dicio import Dicio
Create a Dicio object
dicio = Dicio()
Search for “Doce” and return an object Word
word = dicio.search(“Doce”)
Print the word, the url and the meaning
print(word, word.url, word.meaning)
Print a list of synonyms
print(word.synonyms)
Print a list of examples
print(word.examples)
Print extra informations
for chave, valor in word.extra.items():
print(chave, “=>”, valor)
Load information about the first synonym
Print the word, the URL and the meaning of the first synonym
word.synonyms[0].load()
print(word.synonyms[0], word.synonyms[0].url, word.synonyms[0].meaning)
“`
Word Details
Dicio’s API provides an extensive range of word details that can be accessed using various attributes, properties, and functions:
Attributes
-
word
– the word itself -
url
– Dicio.com.br URL for the word -
meaning
– the meaning -
etymology
– the etymology
Properties
-
synonyms
– list of synonyms -
examples
– list of examples -
extra
– dictionary of extra information (keys in Portuguese)
Functions
-
load
– load additional information from Dicio.com.br
Contribute
Do you want to make Dicio even better? You’re in luck! Dicio is an open-source project, and the development team welcomes your contributions. If you have new features to add or improvements to suggest, simply send a pull request. Together, we can enhance the Dicio experience for all users.
Discover the richness of the Portuguese language with Dicio, and let your curiosity guide you through a world of words!
Cover Image Source: Dicio
Leave a Reply