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
Release history Release notifications | RSS feed
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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file serve-me-once-0.1.2.tar.gz.
File metadata
- Download URL: serve-me-once-0.1.2.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.1 Linux/5.10.89-1-MANJARO
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2dcf4b218ccd6e47374dd7ceffdd349236fcbec8a0d4c9116311e4a0018ed21
|
|
| MD5 |
dc4f77aa4ffe71065262dc362a799a17
|
|
| BLAKE2b-256 |
e04afe9f4efe6b70f45eb4ffa64343f4944003d327aef2a2591bd27461768a23
|
File details
Details for the file serve_me_once-0.1.2-py3-none-any.whl.
File metadata
- Download URL: serve_me_once-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.1 Linux/5.10.89-1-MANJARO
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de5f0eb96a1eedd9f1e3f36edd79f6f3416ce11febd39b423d59e2efe24b97cd
|
|
| MD5 |
8f501a5127de75fe1c2350624a00c627
|
|
| BLAKE2b-256 |
807ad41639643800c0d9d8cdaec9fa9a566ed779beebf119edbc2b6602c20c4d
|