<div align="center">
<h1>📚 wikipya</h1>
<h3>A simple async python library for search pages and images in wikis</h3>
</div><br>
## 🛠Usage
```python
# 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](https://github.com/samuelcolvin/pydantic)
## 🚀 Install
To install, run this code:
```
pip install wikipya
```
Raw data
{
"_id": null,
"home_page": "https://github.com/jDan735/wikipya",
"name": "wikipya",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "api, wikipedia, mediawiki, asyncio",
"author": "Daniel Zakharov",
"author_email": "gzdan734@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/34/3f/b75f0f1c3e3d3e3bad09e8f7849a6a1aee233a71b000007619fed0fa9c44/wikipya-4.0.8.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n <h1>\ud83d\udcda wikipya</h1>\n <h3>A simple async python library for search pages and images in wikis</h3>\n</div><br>\n\n## \ud83d\udee0 Usage\n```python\n# Import wikipya\nfrom wikipya import Wikipya\n\n# Create Wikipya object with Wikipedia methods\nwiki = Wikipya(lang=\"en\").get_instance()\n\n# or use other MediaEiki server (or other service, but this is'n fully supported now)\n\nwikipya = Wikipya(url=\"https://ipv6.lurkmo.re/api.php\", lurk=True, prefix=\"\").get_instance()\n\n# for use Lurkmore (russian). simple and fast\n\n# Get a pages list from search\nsearch = await wiki.search(\"test\")\n\n# Get a pages list from opensearch\nopensearch = await wiki.opensearch(\"test\")\n\n# Get page class\n# You can give to wiki.page() search item, title of page, page id\n\n# Search item (supported ONLY by wiki.search)\npage = await wiki.page(search[0])\n\n# Page title\npage = await wiki.page(\"git\")\n\n# Pageid\npage = await wiki.page(800543)\n\nprint(page.html) # Get page html\nprint(page.parsed) # Get html cleared of link, and other non-formating tags\n\n# Get image\nimage = await wiki.image(page.title) # may not work in non-wikipedia services, check true prefix, or create issue\n\nprint(image.source) # Image url\nprint(image.width) # Image width\nprint(image.height) # Image height\n```\n\n## \ud83c\udf89 Features\n- Full async\n- Support of other instances of MediaWiki\n- Support cleaning of HTML with TgHTML\n- Uses models by [pydantic](https://github.com/samuelcolvin/pydantic)\n\n## \ud83d\ude80 Install\nTo install, run this code:\n```\npip install wikipya\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A simple async python library for search pages and images in wikis",
"version": "4.0.8",
"project_urls": {
"Homepage": "https://github.com/jDan735/wikipya",
"Repository": "https://github.com/jDan735/wikipya"
},
"split_keywords": [
"api",
" wikipedia",
" mediawiki",
" asyncio"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8174c7172e7545eda224807d02e7b251f2871efe08f41db5f13e7f0ea6663f5e",
"md5": "655b83c40d1706acbf4e399793592c64",
"sha256": "46f90ed2ad63901de8ac3e9d99c1bdf436e35e2cf2b7828e521763201fe6a13b"
},
"downloads": -1,
"filename": "wikipya-4.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "655b83c40d1706acbf4e399793592c64",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 15074,
"upload_time": "2024-05-12T22:10:35",
"upload_time_iso_8601": "2024-05-12T22:10:35.684055Z",
"url": "https://files.pythonhosted.org/packages/81/74/c7172e7545eda224807d02e7b251f2871efe08f41db5f13e7f0ea6663f5e/wikipya-4.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "343fb75f0f1c3e3d3e3bad09e8f7849a6a1aee233a71b000007619fed0fa9c44",
"md5": "51bfc50a80c694d46689ff7755afda65",
"sha256": "2c4207193eb61e8d9e16e3e8ed892223f561f23aa0f8491911c175769617507f"
},
"downloads": -1,
"filename": "wikipya-4.0.8.tar.gz",
"has_sig": false,
"md5_digest": "51bfc50a80c694d46689ff7755afda65",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 9218,
"upload_time": "2024-05-12T22:10:37",
"upload_time_iso_8601": "2024-05-12T22:10:37.834530Z",
"url": "https://files.pythonhosted.org/packages/34/3f/b75f0f1c3e3d3e3bad09e8f7849a6a1aee233a71b000007619fed0fa9c44/wikipya-4.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-12 22:10:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jDan735",
"github_project": "wikipya",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "wikipya"
}