Skip to main content

Perform searches against the RAE dictionary.

Project description

pyrae

Perform searches against the RAE dictionary.

pyrae is a simple library providing functionality to search for words or terms in the RAE (Real Academia Española) online dictionary.

The RAE does not provide a public API, so this library makes HTML requests to the dle.rae.es domain and parses the responses to assemble the search results.

Installation

The easiest is to use pip, so that :

$ pip install pyrae

Usage

To search for a word or term in Spanish:

>>> from pyrae import dle
>>> print(dle.search_by_word(word='hola'))
{'title': 'hola | Definición | Diccionario de la lengua española | RAE - ASALE', 'articles': [{'id': 'KYtLWBc', 'lema': {'lema': 'hola', 'index': 0, 'female_suffix': ''}, 'supplementary_info': [{'text': 'Voz expr. (Voz expresiva); cf. (confer) ingl. (inglés o inglesa) hello, al. (alemán o alemana) hallo.'}], 'definitions': [{'index': 1, 'category': {'abbr': 'interj.', 'text': 'interjección'}, 'abbreviations': [{'abbr': 'U.', 'text': 'Usado, usada, usados o usadas'}], 'sentence': {'text': 'como salutación familiar.'}, 'examples': []}, {'index': 2, 'category': {'abbr': 'interj.', 'text': 'interjección'}, 'abbreviations': [{'abbr': 'p. us.', 'text': 'poco usado o usada, poco usados o usadas'}, {'abbr': 'U.', 'text': 'Usado, usada, usados o usadas'}, {'abbr': 'U. t. repetida.', 'text': 'Usada también repetida'}], 'sentence': {'text': 'para denotar extrañeza, placentera o desagradable.'}, 'examples': []}, {'index': 3, 'category': {'abbr': 'interj.', 'text': 'interjección'}, 'abbreviations': [{'abbr': 'desus.', 'text': 'desusado, desusada, desusados o desusadas'}, {'abbr': 'Era u.', 'text': 'Era usado o usada'}], 'sentence': {'text': 'para llamar a los inferiores.'}, 'examples': []}], 'complex_forms': [], 'other_entries': []}]}

Other use cases offered by the RAE will be covered in future versions.

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

pyrae-0.1.0.tar.gz (11.8 kB view hashes)

Uploaded Source

Built Distribution

pyrae-0.1.0-py3-none-any.whl (12.5 kB view hashes)

Uploaded Python 3

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