Skip to main content

Serve the contents of a Zip file over HTTP.

Project description

ziphttpd: serve Zip files over HTTP

This runs a small web server that serves the contents of a Zip file. URLs mapping to directories within the Zip files are mapped to the index.html file if the directory contains it, otherwise it generates (very bare) listing of the directory.

Install

pip install ziphttpd

Example uses

ziphttpd archive.zip

Serves the contents of archive.zip over an automatically-selected ephemeral port, over the loopback interface (localhost).

ziphttpd -p 18888 archive.zip

Serves the file over the loopback interface, at port 18888.

ziphttpd -b 192.168.1.45 -p 18888 archive.zip

Serves the file over one's a network-exposed interface associated to one's IP address, port 18888.

python -m ziphttpd -B -b "" -p 18888 archive.zip

Serves over all of the host's network interfaces, port 18888, and skips starting a the host's web browser to http://0.0.0.0:18888/ (path / at the server's location). Notice how one can use python -m ziphttpd as an alternative to short-form entry point.

Command line arguments

Command line schema:

ziphttpd [options] ZIPFILE
Argument Description Example
ZIPFILE The file whose contents to distribute with this server. myfile.zip
-b ADDRESS
--address ADDRESS
Address to the IP interface to which the server should bind. localhost
10.2.1.18
0.0.0.0 (all interfaces bound)
-p PORT
--port PORT
Port to which to bind the server. 10080
80 (careful with privileged ports)
0 (autochoose an ephemeral port)
-B
--no-browser
By default, once the web server is set up, Ziphttpd opens a web browser tab to the server's URL on the host. This option omits this browser action.
-v
--verbose
Increases the verbosity level of the server log. Use twice for debugging trace.

In the wild...

Interactive standalone data maps generated using DataMapPlot

The DataMapPlot Python package, made by the Tutte Institute, enables the production of standalone interactive viewers for data embedded into vector spaces. These small web apps can be saved to Zip files for sharing. When downloaded to your own computer, use ziphttpd to view them. (The following example is slightly contrived, but it does demonstrate the composition satisfyingly.)

curl -L -o datamapplot_examples.zip https://github.com/lmcinnes/datamapplot_examples/archive/refs/heads/master.zip
ziphttpd datamapplot_examples.zip

Then browse through datamapplot_examples and arXiv to enjoy an interactive map of some 2.6 million papers made available on ArXiV between 1996 and January 2025.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ziphttpd-1.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ziphttpd-1.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file ziphttpd-1.1.0.tar.gz.

File metadata

  • Download URL: ziphttpd-1.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.7

File hashes

Hashes for ziphttpd-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c5f1c395f9ee977e4fed02448923fbe634a281c5cb58a802fe4a1207e8ae5ade
MD5 ca5e38bf04f59136e0323ab37be1b2c1
BLAKE2b-256 0c5e0c7c93f5f9e941d01d5f9970915ac44f26a4e6eeff4c7e3f723a05867601

See more details on using hashes here.

File details

Details for the file ziphttpd-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: ziphttpd-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.7

File hashes

Hashes for ziphttpd-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1bc08aa45022f2e838864aeee66e669ff71d377b41bcb849565a850a3f7dda3b
MD5 926249ec8a3e2fbedff4038bfd605452
BLAKE2b-256 23e6b30525a8d70821ac94dc51a6b5b023cb38fc8f757b1eacf3d28bff5cb14f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page