Skip to main content

mediawiki-to-pdf

session

MediaWikiSession(access_token: str, apiurl: str) returns a requests.Session subclass that adds Mediawik authorization headers. apiurl is typically https://example.com/api.php MediaWikiSession.parse_yaml(file) is convenience method that reads access token and url from YAML file:

mediawiki:
  url: https://wiki.example.com/api.php
  access token: /usr/local/x/wiki_token

where access token is a file name.

PDF

save_pdf_from_authenticated_session(session: MediaWikiSession, page_title: str, output_path: str)->Path: Fetchs a MediaWiki page via API and convert it to PDF using pdfkit. Returns output. /usr/bin/wkhtmlpdf must be installed.

Command line

Processes list of pages specified in YAML file.

usage: mediawiki_to_pdf [-h] [-l LOGLEVEL] yaml

positional arguments:
  yaml                  Configuration file

options:
  -h, --help            show this help message and exit
  -l LOGLEVEL, --loglevel LOGLEVEL
                        Python logging level (default: WARN)

Example:

---
mediawiki:
  url: https://wiki.example.com/api.php
  access token: /usr/local/x/wiki_token
pages:
  -  First_page 
  -  Second_page 
...

Metadata

Release files for mediawiki-to-pdf 1.0

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

Source distribution (sdist)

Source distribution for mediawiki-to-pdf 1.0
File Size Uploaded Provenance Actions
mediawiki_to_pdf-1.0.tar.gz 4.7 kB Without provenance Details for mediawiki_to_pdf-1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mediawiki-to-pdf 1.0
File Interpreter ABI Platform Actions
mediawiki_to_pdf-1.0-py3-none-any.whl Python 3 none any Details for mediawiki_to_pdf-1.0-py3-none-any.whl

Total release size: 10.5 kB

Release files / mediawiki_to_pdf-1.0.tar.gz

Download URL mediawiki_to_pdf-1.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7b5354df380fda4c686ed9c12d556836e6e76532d629f9d45e7bd44cf55655a2
BLAKE2b-256 checksum
How to use checksums
f8358108ababfcbeb5eebc84cf9b9544ca2a1866eaac778b7db0e96ce1909006
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Release files / mediawiki_to_pdf-1.0-py3-none-any.whl

Download URL mediawiki_to_pdf-1.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ecbf0a74d421a95627973ec51d3e7fe92093b6ab4569a59a92bab2b68ede0d5
BLAKE2b-256 checksum
How to use checksums
cf25cc4410fb3587871c49bc34caebddce7588dba479da64adbfd77471fc109c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Security for mediawiki-to-pdf 1.0

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

1.0 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