Skip to main content

WikipediaMultistreamExtractor

This is a simple application that extracts articles from Wikipedia backup files.

Installation

pip install wikipedia_multistream_extractor

Usage

From the CLI:

 wikipedia_multistream_extractor SRC DEST

As a library:

from wikipedia_multistream_extractor import dump_wiki_pages, extract_wiki_pages


dump_wiki_pages(src, dst, preprocessor=None, writer=None)

# Or

pages = extract_wiki_pages(src) 

You can pass a preprocessor to dump_wiki_pages if you wanted to transform the data.

  • Your function should accept two arguments page and title.
  • It should return the modified page as a str, unless your writer expects something different.
  • If you return None the page will be skipped by the writer.

You can also pass a writer if the intended output is not xml.

  • Your function should accept four arguments page, title, dest_path and safe_title.
  • IF you pass a writer it's up to you two write the file, not further action is taken.
  • safe_title should be a safe filename to use when writing the file, title is almost certainly not.

This library was built on Windows using Python 3.9.13.

It should work on other platforms but it has not been tested.

License

The license is MIT, see the LICENSE file for details.

Contributing

PRs welcome, please have type annotations and docstrings.

Todos

  • Extracting a single article, based on the index offsets.
  • Extracting the index files.
  • Create a UI that displays the index file contents and allows the users to select articles.
  • Extracting multiple articles at offsets.
  • Use multiprocessing?
  • Write some tests.

Metadata

Release files for wikipedia-multistream-extractor 0.0.2

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

Source distribution (sdist)

Source distribution for wikipedia-multistream-extractor 0.0.2
File Size Uploaded Provenance Actions
wikipedia_multistream_extractor-0.0.2.tar.gz 12.2 kB Without provenance Details for wikipedia_multistream_extractor-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wikipedia-multistream-extractor 0.0.2
File Interpreter ABI Platform Actions
wikipedia_multistream_extractor-0.0.2-py3-none-any.whl Python 3 none any Details for wikipedia_multistream_extractor-0.0.2-py3-none-any.whl

Total release size: 17.0 kB

Release files / wikipedia_multistream_extractor-0.0.2.tar.gz

Download URL wikipedia_multistream_extractor-0.0.2.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ccda019a114471b83c7f47831bc563345fbe15447aa6d13c9984e126a579e15b
BLAKE2b-256 checksum
How to use checksums
42f8fd377f7e6cf18c098beb74672a99ff5e56d60fc87210f9dc4d6cd0050bd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release files / wikipedia_multistream_extractor-0.0.2-py3-none-any.whl

Download URL wikipedia_multistream_extractor-0.0.2-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82c127d4c9454dd0d8d1e2256d7ec92108e8097bcc10413966467b7274ad901b
BLAKE2b-256 checksum
How to use checksums
ad5e384517cd7cbf4b94e12b99d9ed0e9fbf4ecee58aecf87e241084ecad5aa6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Security for wikipedia-multistream-extractor 0.0.2

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

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