Skip to main content

quickhttp

PyPI tests coverage

quickhttp is a lightweight CLI that wraps Python's http.server with automatic port-finding and automatic shutdown after a configurable idle duration.

Features

  • Automatically finds and uses an available port.
  • Has a keep-alive time after which it will shut down automatically if no requests are received, in case you forget about it.
  • More secure default of 127.0.0.1 (localhost) instead of 0.0.0.0.
  • Easier to type and autocomplete than python -m http.server.

Installation

If you're using uv, you can immediately run it without installing by using uvx:

uvx quickhttp

To install it to be available for later use, you can use any method that installs from PyPI. I recommend using uv tool or pipx to manage Python command-line programs.

uvx quickhttp
# or
uv tool install quickhttp
# or
pipx install quickhttp
# or
pip install quickhttp

Development Version

To run the development version of this program, get it directly from GitHub.

uvx "quickhttp @ git+https://github.com/jayqi/quickhttp.git"

Documentation

quickhttp --help
Usage: quickhttp [OPTIONS] [DIRECTORY]

  Lightweight CLI that wraps Python's `http.server` with automatic port-
  finding and shutdown.

Arguments:
  [DIRECTORY]  Directory to serve.  [default: .]

Options:
  -t, --timeout TEXT              Time to keep server alive for after most
                                  recent request. Accepts time expressions
                                  parsable by pytimeparse, such as '10m' or
                                  '10:00'.  [default: 10m]

  -b, --bind TEXT                 Address to bind server to. '127.0.0.1' (or
                                  'localhost') will only be accessible from
                                  this computer. '0.0.0.0' is all interfaces
                                  (IP addresses) on this computer, meaning
                                  that it can be accessible by other computers
                                  at your IP address.  [default: 127.0.0.1]

  -p, --port INTEGER              Port to use. If None (default), will
                                  automatically search for an open port using
                                  the other port-related options. If
                                  specified, ignores other port-related
                                  options.

  --port-range-min INTEGER        Minimum of range to search for an open port.
                                  [default: 8000]

  --port-range-max INTEGER        Maximum of range to search for an open port.
                                  [default: 8999]

  --port-max-tries INTEGER        Maximum number of ports to check.  [default:
                                  50]

  --port-search-type [sequential|random]
                                  Type of search to use.  [default:
                                  sequential]

  --version                       Show version and exit.
  --install-completion [bash|zsh|fish|powershell|pwsh]
                                  Install completion for the specified shell.
  --show-completion [bash|zsh|fish|powershell|pwsh]
                                  Show completion for the specified shell, to
                                  copy it or customize the installation.

  --help                          Show this message and exit.

Why use quickhttp?

  • python -m http.server is a pain to type. quickhttp is shorter and can autocomplete. (But you can still do python -m quickhttp too if you really want to.)
  • If you try starting python -m http.server and port 8000 is unavailable, you get OSError: [Errno 48] Address already in use. Then you have to choose another port and try again. quickhttp deals with ports automatically for you.
  • quickhttp will automatically shutdown after the keep-alive time expires. This defaults to 10 minutes. I often start up an HTTP server to look at something, then open a new tab to continue doing things, and then I forget about the server.
  • python -m http.server defaults to 0.0.0.0, which may make your server accessible to other people at your computer's IP address. This can be a security vulnerability, but isn't necessarily obvious to people who just want to quickly serve some static files.

Metadata

Release files for quickhttp 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quickhttp 2.2.0
File Size Uploaded Provenance Actions
quickhttp-2.2.0.tar.gz 7.2 kB With provenance Details for quickhttp-2.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quickhttp 2.2.0
File Interpreter ABI Platform Actions
quickhttp-2.2.0-py3-none-any.whl Python 3 none any Details for quickhttp-2.2.0-py3-none-any.whl

Total release size: 15.7 kB

Release files / quickhttp-2.2.0.tar.gz

Download URL quickhttp-2.2.0.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7b0e45168e38f5e96bc45e3538b37af463f64fa3acedb8b9c7050e9354f0516c
BLAKE2b-256 checksum
How to use checksums
a3587338e22ca1e60e92e657f67b7c473f1313ec686e967ba01cfb307acb9bfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Release files / quickhttp-2.2.0-py3-none-any.whl

Download URL quickhttp-2.2.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f54fe55fc9dcbc83cb65bcdfb34a2a36fd8d2a4f6c3ed6de71b6592225f37633
BLAKE2b-256 checksum
How to use checksums
0b885b738fd2753394ba93dea154daac87e591f39ec41585146d5f82935ce626
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Security for quickhttp 2.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for quickhttp-2.2.0.tar.gz

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 Nov 5, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page