Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PyWiktionary

The Python library for wiktionary words

Version 0.4.1

This is an alpha library to retrieve and parse Wiktionary word pages that will require enhancements and fixes

Install

Requirements

If you install this library from source code or you want help with development of the code, make sure to install requirements first:

$ pip install -r ./requirements.txt

Pywiktionary install

Install from the remote pip repository:

$ pip install pywiktionary

Install from the root of the source code:

$ pip install .

How to use

Initialize the parser factory (pywiktionary.wiktionary_parser_factory.WiktionaryParserFactory) with a supported language, then make the request with get_page() method passing the word you desire to get.

from pywiktionary import WiktionaryParserFactory

parser_factory = WiktionaryParserFactory(default_language='en')
pizza_parser = parser_factory.get_page('pizza')

Then to get data about the word use the parse() method of the parser object returned from WiktionaryParserFactory:

parsing_result = pizza_parser.parse()

The result variable is a dictionary containing the result of the wiktionary page parsing divided by type/subtype. The meanings type categories are dynamically taken from the Wiktionary page in the wiktionary language, Here the result for "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": [
                    "a slice of pizza",
                    "a pizza pie",
                    "Want to go out for pizza tonight?"
                ]
            },
            {
                "meaning": "(countable) A single instance of this dish",
                "examples": [
                    "He ate a whole pizza!",
                    "Should we cook a frozen pizza for dinner?"
                ]
            }
        ]
    }
}

Summary

This is the summary of above commented code:

from pywiktionary import WiktionaryParserFactory

parser_factory = WiktionaryParserFactory(default_language='en')
pizza_parser = parser_factory.get_page('pizza')
parsing_result = pizza_parser.parse()

Yeah, yeah... i know it is beautiful and easy as idea, but this library require many development to enhance this system!

Supported languages (Language - Code)

  • English - en
  • Italian - it

ToDo

  • Surfable Software Documentation!
  • Implement a good system to select wiktionary language parser
  • Write a good human friend documentation! =)
  • Write some examples for humans!

Main Changes

0.1.2

  • Add requirements in setup.py for distributed package under wheel and PyPI

Metadata

Release files for pywiktionary 0.4a1.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pywiktionary 0.4a1.post1
File Size Uploaded Provenance Actions
pywiktionary-0.4a1.post1.tar.gz 6.1 kB Without provenance Details for pywiktionary-0.4a1.post1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pywiktionary 0.4a1.post1
File Interpreter ABI Platform Actions
pywiktionary-0.4a1.post1-py3-none-any.whl Python 3 none any Details for pywiktionary-0.4a1.post1-py3-none-any.whl

Total release size: 15.7 kB

Release files / pywiktionary-0.4a1.post1.tar.gz

Download URL pywiktionary-0.4a1.post1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
53c4a5c903e5bca8c97bf3339d8f4a2accbf6601fdf99a2c1fd254aaf1c4bce4
BLAKE2b-256 checksum
How to use checksums
d1fecfebb5b1795b64083cdc55b59fc5762568d2cdc48d6f3df6e86e0d604d22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.0

Release files / pywiktionary-0.4a1.post1-py3-none-any.whl

Download URL pywiktionary-0.4a1.post1-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a821fed1f00599c996e500563c543fe7158ebad3ce0eb1105ca7818c3dbafa60
BLAKE2b-256 checksum
How to use checksums
fa81b662ad47fb23ad3770807e94187dcd370beef61f04c43dd6349346bff7b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.0

Security for pywiktionary 0.4a1.post1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page