html-previewer (Python client)
Cross-platform command-line client and library for html-previewer — a self-hosted service that publishes short-lived HTML previews behind unguessable capability URLs, with automatic expiry and disk reclaim.
Works on Linux, macOS and Windows. Pure stdlib — zero runtime
dependencies. It is a faithful, feature-complete port of the classic
preview-publish.sh, so existing habits and scripts carry over.
Install
pip install html-previewer
This installs the preview-publish command (alias: html-previewer).
Configure
Point the client at your server once:
preview-publish --base https://preview.example.com --key YOUR_API_KEY --save-config
Or just export the variables: PREVIEW_API_BASE and PREVIEW_API_KEY
(equivalently, put PREVIEW_API_KEY=… lines in the config file —
~/.config/preview/config on Linux/macOS, %APPDATA%\preview\config on
Windows; the same shell-style file the bash client reads).
Use
preview-publish ./site/ my-site 14 # publish a folder, 14-day expiry
preview-publish ./report.zip # publish a zip (topic from filename)
preview-publish ./page.html # publish a single html page
preview-publish ./site/ my-site 2m # short-lived: 2 minutes
preview-publish --dry-run ./site/ my # predict: update in place, or new URL?
preview-publish --new ./site/ my-site # force a brand-new URL
preview-publish --list # list live previews (--list-all: everything)
preview-publish --info <hash> # one preview's record
preview-publish --delete <hash> # reclaim now
preview-publish --expiry <hash> --action extend --days 30
preview-publish --open ./site/ my-site # publish, then open in a browser
preview-publish --health # is the server alive?
Re-publishing under a topic that is still live updates it in place and
keeps the same URL (expiry resets) — share a link once, keep refreshing the
content. A topic whose preview already expired gets a brand-new URL. Add
--json to any command for machine-readable output.
Library
from html_previewer import PreviewClient
c = PreviewClient("https://preview.example.com", api_key="…")
res = c.publish("./site", topic="my-site", expiry="14") # expiry: "14" or "2m"
print(res["url"])
for p in c.list_previews():
print(p["topic"], p["url"], p["seconds_remaining"])
c.check("my-site") # dry-run: update in place vs new URL
c.info(res["hash"])
c.expiry(res["hash"], "extend", days=30) # extend | expire | renew
c.delete(res["hash"])
Development
cd client
python -m pip install -e .[test]
python -m pytest tests -v
The test suite includes an end-to-end test that boots the real server from the repository checkout; it is skipped automatically when the server sources are absent (e.g. in the sdist).
License
MIT — see LICENSE.
Metadata
Release files for html-previewer 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| html_previewer-0.1.1.tar.gz | 17.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| html_previewer-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.8 kB
Release files / html_previewer-0.1.1.tar.gz
| Download URL | html_previewer-0.1.1.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
567517f5d194bb75085a10bbfa7f65d09c7d46119852c7c1cacd38c1e0d914ea
|
|
BLAKE2b-256 checksum How to use checksums |
3711ad5d365e2cd5a4408db6a327579d928f054c36d41743944c49d314b8f39b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / html_previewer-0.1.1-py3-none-any.whl
| Download URL | html_previewer-0.1.1-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fec99767ff3c18017d5f3d5a90c37e0e404af291876894e20392447bf82f12f6
|
|
BLAKE2b-256 checksum How to use checksums |
07075c07d2675ee6a8383b41c985ae3d1f73bb53f5ae329a47da5f6d48f8a9e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency log