wikipya


Namewikipya JSON
Version 4.0.7 PyPI version JSON
download
home_pagehttps://github.com/jDan735/wikipya
SummaryA simple async python library for search pages and images in wikis
upload_time2024-03-09 20:16:30
maintainer
docs_urlNone
authorDaniel Zakharov
requires_python>=3.10,<4.0
licenseMIT
keywords api wikipedia mediawiki asyncio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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": "",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "",
    "keywords": "api,wikipedia,mediawiki,asyncio",
    "author": "Daniel Zakharov",
    "author_email": "gzdan734@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b5/8a/049e7881cd160caf5b3a57e2bb652a64c003bb993f6b0d677907d5c849de/wikipya-4.0.7.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.7",
    "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": "9064d17096222c438a9855ec28dd08372fcf9458771699e7bd264754dfe1b0b4",
                "md5": "63be0615f3210acece83b94db0eeb40d",
                "sha256": "84ed0b4fa9420a51e3da7047a8cb73c94ae1ff5a7e0f53015825ed874c3aa448"
            },
            "downloads": -1,
            "filename": "wikipya-4.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "63be0615f3210acece83b94db0eeb40d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 15071,
            "upload_time": "2024-03-09T20:16:29",
            "upload_time_iso_8601": "2024-03-09T20:16:29.174367Z",
            "url": "https://files.pythonhosted.org/packages/90/64/d17096222c438a9855ec28dd08372fcf9458771699e7bd264754dfe1b0b4/wikipya-4.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b58a049e7881cd160caf5b3a57e2bb652a64c003bb993f6b0d677907d5c849de",
                "md5": "827673dd895e818d3410b822c3151e4b",
                "sha256": "1a13fd06441f025ef5bf6bc971e7770260241bb55c86a6c6372f729b3fb72446"
            },
            "downloads": -1,
            "filename": "wikipya-4.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "827673dd895e818d3410b822c3151e4b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 9334,
            "upload_time": "2024-03-09T20:16:30",
            "upload_time_iso_8601": "2024-03-09T20:16:30.793692Z",
            "url": "https://files.pythonhosted.org/packages/b5/8a/049e7881cd160caf5b3a57e2bb652a64c003bb993f6b0d677907d5c849de/wikipya-4.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-09 20:16:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jDan735",
    "github_project": "wikipya",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "wikipya"
}
        
Elapsed time: 0.20390s