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.
Install this library using pip
:
pip install frozen-soup
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
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