Skip to main content

Dexonline.ro API for Python

Project description

Dexonline.ro API

A simple API that queries dexonline.ro, it returns the definitions of the words.

What is dexonline - info

How to install, using pip install?

pip install -i https://test.pypi.org/simple/ dexonlineBK

Functionality

The first thing we need to do is import the library

from dexonlineBK import dexonlineBK as DO

The first, and most important, function is getWordDefinition() This function returns the list of lists

definitions = DO.getWordDefinition("neexplicabil")

for defs in definitions:
	print(defs[0])
	print(defs[1] + "\n")

Output:

NEEXPLICГЃBIL
adj. v. inexplicabil.

NEEXPLICABIL
adj. inexplicabil, neГ®nИ›eles. (Un fapt ~.)

Neexplicabil
в‰  explicabil

For more printing comfort I have the toString() function

DO.toString(definitions)

Output:

WORD: NEEXPLICГЃBIL
DEFINITION: adj. v. inexplicabil.

WORD: NEEXPLICABIL
DEFINITION: adj. inexplicabil, neГ®nИ›eles. (Un fapt ~.)

WORD: Neexplicabil
DEFINITION: в‰  explicabil

getWordOfTheDay() function, returns the list with the word and its definition toString() also works with this function

DO.toString(DO.getWordOfTheDay())

Output:

WORD: ARГIC, -Д,
DEFINITION: areici, -ce, adj. (Geol.; despre regiuni, soluri) Lipsit de apă, uscat, arid. [Pr.: -re-ic] †Din fr. aréique.

getWordOfTheMonth() function, returns the list with the word and its definition toString() also works with this function

DO.toString(DO.getWordOfTheMonth())

Output:

WORD: ntur
DEFINITION: i [At: ALR II, 5752/791 / E: fo] (Reg) Onomatopee care imitДѓ trilurile turturicii.

reallyExist() function, returns boolean. dexonline.ro have list of words in romanina. And here you check if this word exists in Romanian.

print(DO.reallyExist('mama'))

Output:

True

The API is still being tested

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dexonlineBK-0.0.8.tar.gz (3.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page