Python library to retrieve wiktionary word definitions for different languages
Project description
PyWiktionary - a Python library for wiktionary words
Version 0.0.1 (pre-alpha)
This is just a pre alpha that need so many enhancements and fixes, but could be a starting base to start a simple python library for Wiktionary words
Install
Requirements
Before install, please, make sure you've installed the project dependencies if you're installing from source code:
$ pip install -r ./requirements.txt
Pywiktionary install
Install from the source code:
$ pip install .
How to use
First of all initialize the wiki parser with a supported language then make the request and at the end call the parse() method of the parser object returned from WiktionaryParser :
from pywiktionary import WiktionaryParser
wiktionary_parser = WiktionaryParser(default_language='en')
language_parser = wiktionary_parser.get_page('pizza')
result = language_parser.parse()
The result variable is dictionary containing the result of the wiktionary page parsing. Here the result for "pizza":
{
"pizza": {
"meanings": {
"noun": [
{
"meaning": "(uncountable) A baked Italian dish of a thinly rolled bread dough crust typically topped before baking with tomato sauce, cheese, and other ingredients such as meat, vegetables or fruit",
"examples": []
},
{
"meaning": "(countable) A single instance of this dish",
"examples": []
}
]
}
}
}
Yeah, yeah... i know it is beautiful and easy as idea, but it now require some development to enhance this system!
Supported languages
- English - en
- Italian - it
ToDo
- Implement a good system to select wiktionary language parser
- Write a good human friend documentation! =)
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
Hashes for pywiktionary-0.0a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fe3ce1686bf6af0e2214c4ed580aad8baeac97ac126e7f42fd58d99aa5147c5 |
|
MD5 | 38d37a61448ba71757aa3eb23763f10f |
|
BLAKE2b-256 | a467e377bd18940255422abef178eb58872b04f1e48137652bd0b9c5bbfdebb9 |