Skip to main content

No project description provided

Project description

serve-me-once

Serves some data over HTTP, once. Based on the built-in Python module http.server.

Installation

pip install serve-me-once

Use

from serve_me_once import serve_once, gen_random_port
serve_once(
	"Hello, World",
	timeout=2,
	mime_type="text/html",
	port=gen_random_port()
)

or

from serve_me_once import serve_once_in_background, gen_random_port
import time

addr = serve_once_in_background(
	"Hello, World",
	timeout=2,
	mime_type="text/html",
	port=gen_random_port()
)
print("Hosting at:", addr)
time.sleep(3)

... Why?

The web version of Netron accepts an URL as a query parameter (example). But serving temporary files is a chore. Hence this.

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

serve-me-once-0.1.2.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

serve_me_once-0.1.2-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

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