Skip to main content
Pre-release

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

Scrapewiki - Wikipedia Scraper

It can scrape Wikipedia synchronously and asynchronously. scrapewiki.Scrapewiki has two methods, search and wiki.

wiki

It is used to scrape a Wikipedia page.

It is used to search some query on Wikipedia. limit parameter can be optionally specified to set a limit to the amount of results.

Examples

Asynchronous:

import scrapewiki
import trio


wiki = scrapewiki.Scrapewiki()


async def main():
    async with wiki.search("python") as results:
        async for search_result in results:
            ...

    # equivalent of

    searcher = wiki.search("python")
    results = await searcher.async_method()

trio.run(main)
import scrapewiki
import trio


wiki = scrapewiki.Scrapewiki()


async def main():
    async with wiki.wiki("python", limit=45) as page:
        ...

    # equivalent of

    page_scraper = wiki.wiki("python")
    page = await page_scraper.async_method()

trio.run(main)

Synchronous:

import scrapewiki


wiki = scrapewiki.Scrapewiki()


with wiki.search("python", limit=45) as results:
    for search_result in results:
        ...

# equivalent of

searcher = wiki.search("python")
results = searcher.sync_method()
import scrapewiki


wiki = scrapewiki.Scrapewiki()


with wiki.wiki("python") as page:
    ...

# equivalent of

page_scraper = wiki.wiki("python")
page = page_scraper.sync_method()

Extras

The module also provides some utility functions for ease of use (currently just one):

Plans

There are a lot of things that needs to be parsed. There are a lot of bugs that needs to be fixed. I'm pretty sure there are some typos in docstrings and wrong annotations as well. My plan for now is to fix the aforesaid problems.

Note

This library is English only due to how some things have been parsed. I'm sure there are better ways to do them and make it support all languages. This is in my TODO list.

Documentation

I don't have any plans for online documentation as of now. Please read the source code. All the dataclasses can be found here.

Metadata

Release files for scrapewiki 0.1.5b0

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

Source distribution (sdist)

Source distribution for scrapewiki 0.1.5b0
File Size Uploaded Provenance
scrapewiki-0.1.5b0.tar.gz 10.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for scrapewiki 0.1.5b0
File Interpreter ABI Platform
scrapewiki-0.1.5b0-py3-none-any.whl Python 3 none any Details

Total release size: 22.2 kB

Release files / scrapewiki-0.1.5b0.tar.gz

Download URL scrapewiki-0.1.5b0.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cfb5a512ccee89b73c7582af841346edd58bc467e4c0b128b9114d569f1fe9aa
BLAKE2b-256 checksum
How to use checksums
12279c7b8218cdb5aad5e0e0769fff8aa1c47716d51b56213fdb5b99f16057a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

Release files / scrapewiki-0.1.5b0-py3-none-any.whl

Download URL scrapewiki-0.1.5b0-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac43764ae644cf1e05ce38092c353c5e1330a466018b698781d1780de4926507
BLAKE2b-256 checksum
How to use checksums
0bcd670b5309109fc7447339704d1d6294befc71bd4582b8e6b43097c01f82fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

Security for scrapewiki 0.1.5b0

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