Wiktionary Parser
A python project which parses word content from Wiktionary in an easy to use JSON format. Right now, it parses etymologies, definitions, pronunciations, examples, audio links and related words.
JSON structure
[{
"pronunciations": {
"text": ["pronunciation text"],
"audio": ["pronunciation audio"]
},
"definitions": [{
"relatedWords": [{
"relationshipType": "word relationship type",
"words": ["list of related words"]
}],
"text": ["list of definitions"],
"partOfSpeech": "part of speech",
"examples": ["list of examples"]
}],
"etymology": "etymology text",
}]
Installation
Using pip
- run
pip install wiktionaryparser
From Source
- Clone the repo or download the zip
cdto the folder- run
pip install -r "requirements.txt"
Usage
- Import the WiktionaryParser class.
- Initialize an object and use the
fetch("word", "language")method. - The default language is English, it can be changed using the
set_default_language method. - Include/exclude parts of speech to be parsed using
include_part_of_speech(part_of_speech)andexclude_part_of_speech(part_of_speech) - Include/exclude relations to be parsed using
include_relation(relation)andexclude_relation(relation)
Examples
>>> from wiktionaryparser import WiktionaryParser
>>> parser = WiktionaryParser()
>>> word = parser.fetch('test')
>>> another_word = parser.fetch('test', 'french')
>>> parser.set_default_language('french')
>>> parser.exclude_part_of_speech('noun')
>>> parser.include_relation('alternative forms')
Requirements
- requests==2.7.0
- beautifulsoup4==4.4.0
Contributions
If you want to add features/improvement or report issues, feel free to send a pull request!
Metadata
Release files for wiktionaryparser 0.0.97
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wiktionaryparser-0.0.97.tar.gz | 17.8 kB | Without provenance | Details for wiktionaryparser-0.0.97.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wiktionaryparser-0.0.97-py3-none-any.whl | Python 3 | none | any | Details for wiktionaryparser-0.0.97-py3-none-any.whl |
Total release size: 37.3 kB
Release files / wiktionaryparser-0.0.97.tar.gz
| Download URL | wiktionaryparser-0.0.97.tar.gz |
|---|---|
| Size | 17.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0310388ad68586d68d573b220a2593a16b4702d2861502ce63299ff203bdbca1
|
|
BLAKE2b-256 checksum How to use checksums |
511246c23fc56ca2ca8dfbe5541f488bed4e9cebed19604cceba575ca2a63e38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.4
|
Release files / wiktionaryparser-0.0.97-py3-none-any.whl
| Download URL | wiktionaryparser-0.0.97-py3-none-any.whl |
|---|---|
| Size | 19.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81a96aee048d41f1a9ec9c9dd2b8c436fe2c4b02b70f30f63cf07495712f8ae3
|
|
BLAKE2b-256 checksum How to use checksums |
649ea2274834996d560387d8848ba9f9fd77d28b9f57eb2e4b3ad7108351bb16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.4
|
Security for wiktionaryparser 0.0.97
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.