selfcontain
Make HTML more self-contained by in-lining:
JavaScript (minified)
CSS (minified)
Images (base-64 encoded)
Including (explicitly linked) favicons
For straightforward cases, this will take an HTML document which might have external dependencies and return an HTML document with no external dependencies - a single self-contained file that you could send as an email attachment, or show as a presentation without worrying about internet connectivity, for example.
Cases that are not straightforward are those that involve loading things via JavaScript, iframe things, fonts, and things I haven’t thought of. Pull requests welcome!
Usage
Loaded as a module, selfcontain() takes an HTML string and base path or URL and is the main function to know. Command-line usage wraps the minor extension selfcontain_ref(), which takes a string specifying a file path or URL to fetch and process:
selfcontain test_in.html > test_out.html # or selfcontain https://raw.githubusercontent.com/ajschumacher/selfcontain/master/test_in.html > test_out.html
Metadata
Release files for selfcontain 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| selfcontain-0.2.tar.gz | 3.1 kB | Without provenance | Details for selfcontain-0.2.tar.gz |
Release files / selfcontain-0.2.tar.gz
| Download URL | selfcontain-0.2.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
799573a05265e9ace390baedc9e683d948a8dffe914f68042834bf3fe1d85bff
|
|
BLAKE2b-256 checksum How to use checksums |
134f252c1d043d86985784687a1bb3e4ed8f1c20856fd82ae6d90dc47afe74fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for selfcontain 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.