📚 wikipya
A simple async python library for search pages and images in wikis
🛠 Usage
# Import wikipya
from wikipya import Wikipya
# Create Wikipya object with Wikipedia methods
wiki = Wikipya(lang="en").get_instance()
# or use other MediaEiki server (or other service, but this is'n fully supported now)
wikipya = Wikipya(url="https://ipv6.lurkmo.re/api.php", lurk=True, prefix="").get_instance()
# for use Lurkmore (russian). simple and fast
# Get a pages list from search
search = await wiki.search("test")
# Get a pages list from opensearch
opensearch = await wiki.opensearch("test")
# Get page class
# You can give to wiki.page() search item, title of page, page id
# Search item (supported ONLY by wiki.search)
page = await wiki.page(search[0])
# Page title
page = await wiki.page("git")
# Pageid
page = await wiki.page(800543)
print(page.html) # Get page html
print(page.parsed) # Get html cleared of link, and other non-formating tags
# Get image
image = await wiki.image(page.title) # may not work in non-wikipedia services, check true prefix, or create issue
print(image.source) # Image url
print(image.width) # Image width
print(image.height) # Image height
🎉 Features
- Full async
- Support of other instances of MediaWiki
- Support cleaning of HTML with TgHTML
- Uses models by pydantic
🚀 Install
To install, run this code:
pip install wikipya
Metadata
Release files for wikipya 4.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wikipya-4.1.4-py3-none-any.whl | Python 3 | none | any | Details for wikipya-4.1.4-py3-none-any.whl |
Release files / wikipya-4.1.4-py3-none-any.whl
| Download URL | wikipya-4.1.4-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f88f0b909528da764d9e1230a780f5331f6df2c5ac46d60636809ac57d2ddc9
|
|
BLAKE2b-256 checksum How to use checksums |
0aefe6b761ef7a206a81b212e8a0d7cb66cf9c852c087be826fb45d3d057f757
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for wikipya 4.1.4
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.