Skip to main content

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.

Metadata

Release files for serve-me-once 0.1.2

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

Source distribution (sdist)

Source distribution for serve-me-once 0.1.2
File Size Uploaded
serve-me-once-0.1.2.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for serve-me-once 0.1.2
File Interpreter ABI Platform
serve_me_once-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 5.9 kB

Release files / serve-me-once-0.1.2.tar.gz

Download URL serve-me-once-0.1.2.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d2dcf4b218ccd6e47374dd7ceffdd349236fcbec8a0d4c9116311e4a0018ed21
BLAKE2b-256 checksum
How to use checksums
e04afe9f4efe6b70f45eb4ffa64343f4944003d327aef2a2591bd27461768a23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.10.89-1-MANJARO

Release files / serve_me_once-0.1.2-py3-none-any.whl

Download URL serve_me_once-0.1.2-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de5f0eb96a1eedd9f1e3f36edd79f6f3416ce11febd39b423d59e2efe24b97cd
BLAKE2b-256 checksum
How to use checksums
807ad41639643800c0d9d8cdaec9fa9a566ed779beebf119edbc2b6602c20c4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.10.89-1-MANJARO

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

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