Registry / web-framework / httpwatcher

httpwatcher

JSON →
library0.5.2pypypiunverified

httpwatcher is a Python library and command-line utility for serving static files with live reload functionality, primarily intended for web development. It leverages the Tornado asynchronous web framework for its HTTP and WebSocket server capabilities. The current version is 0.5.2. Releases appear to be ad-hoc, tied to development needs rather than a fixed cadence.

pip install httpwatcher
INSTALL
IMPORT
SIG · HTTPWATCHER
H
httpwatcher
web-frameworkpythonv0.5.2
Install
3.5s avg
Import
460ms
Disk
26MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.5.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
installs and imports cleanly · install 0.0s · import 0.095s · 27.3MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 3.5s · import 0.089s · 28MB
26MB installed
● package 26MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

watch
import httpwatcher httpwatcher.watch(...)
Convenience method to quickly set up and run a server.
HttpWatcherServer
from httpwatcher import HttpWatcherServer
For more fine-grained control over the server and I/O loop.

This example demonstrates how to set up and run an `httpwatcher` server programmatically. It serves files from a 'my_static_app' directory, includes a basic `index.html` file, and starts the server on `http://127.0.0.1:5555`. Changes to files in 'my_static_app' would trigger a live reload in connected browsers. The `open_browser=False` argument is used for programmatic control.

import os from httpwatcher import HttpWatcherServer from tornado.ioloop import IOLoop # Create a dummy directory and file for demonstration if not os.path.exists('my_static_app'): os.makedirs('my_static_app') with open('my_static_app/index.html', 'w') as f: f.write('<!DOCTYPE html><html><head><title>Test</title></head><body><h1>Hello, httpwatcher!</h1></body></html>') # Instantiate the server server = HttpWatcherServer( root='my_static_app', host='127.0.0.1', port=5555, base_path='/', open_browser=False, verbose=True ) # Start the server (usually in a separate thread or process for non-blocking operations) # For a quick runnable example, we'll run it directly, which will block. # In a real application, you might use IOLoop.current().start() in a thread. print(f"Serving 'my_static_app' at http://127.0.0.1:5555") print("Press Ctrl+C to stop.") try: server.start() # This blocks the current thread except KeyboardInterrupt: print("Server stopped.") finally: server.stop() # Clean up dummy files/directories os.remove('my_static_app/index.html') os.rmdir('my_static_app')
httpwatcher --version
Debug
Known issues
gotchaThis Python library 'httpwatcher' is distinct from the 'HttpWatch' browser extension for HTTP debugging. Searching for issues or documentation might lead to irrelevant results for the browser tool.
fix
Always qualify searches with 'python library' or 'pypi' when looking for information on this specific package.
affects: All versions
breakinghttpwatcher is explicitly designed for development purposes and is NOT intended for production environments. It has 'only basic security checks' and may have critical vulnerabilities not addressed in smaller sub-projects.
fix
Do not deploy applications using `httpwatcher` as a production web server. Use production-ready web servers like Nginx, Apache, Gunicorn, or uWSGI instead.
affects: All versions
gotchaThe live reload functionality relies on injecting `<script>` tags before the `</body>` closing tag. HTML content without a `</body>` tag (e.g., partial HTML files or non-HTML content) will not receive the live reload script injection.
fix
Ensure that all HTML files intended for live reloading contain a `</body>` tag. For non-HTML content, live reload will not function as expected.
affects: All versions
Upgrade
Version history
0.5.2latest on PyPI · released Nov 14, 2018
Audit
Dependencies
tornadorequiredCore asynchronous web framework for HTTP and WebSocket server.
Agent activity
6 hits · last 30 days
node
6
Resources
httpwatcher — pip install httpwatcher · libregistry