Create a single-file version of an HTML file
Project description
frozen-soup
Frozen Soup is a Python library for creating a single-file version of an HTML file by pulling in required external resources and in-lining them.
Built with Python using:
Inspired by (but not based on) SingleFile.
Created by Jim Winstead in March 2024.
Installation
Install this library using pip
:
pip install frozen-soup
Usage
python -mfrozen_soup https://www.example.com
import frozen_soup
output = freeze_to_string("https://www.example.com")
This will serve up a single-file HTML version of the URL supplied. (This is not even vaguely appropriate for production use, but handy for testing.)
$ python -mfrozen_soup.server
Server started http://localhost:8080
$ curl -s http://localhost:8080/https://www.example.com
Development
To contribute to this library, first checkout the code. Then create a new virtual environment:
cd frozen-soup
python -m venv .venv
source .venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for frozen_soup-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edb1c9214d15084d7753cb5d1b0c2395d5de81facaf070bbfcc8a60d64fbaafc |
|
MD5 | 270210bb30c7b8e69423b0908feb319b |
|
BLAKE2b-256 | c3280de04c6026667344f1a22eaf810bf7e1f83837deb6d24b9023c630d953d4 |