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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

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

Hashes for serve-me-once-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d2dcf4b218ccd6e47374dd7ceffdd349236fcbec8a0d4c9116311e4a0018ed21
MD5 dc4f77aa4ffe71065262dc362a799a17
BLAKE2b-256 e04afe9f4efe6b70f45eb4ffa64343f4944003d327aef2a2591bd27461768a23

See more details on using hashes here.

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

Hashes for serve_me_once-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 de5f0eb96a1eedd9f1e3f36edd79f6f3416ce11febd39b423d59e2efe24b97cd
MD5 8f501a5127de75fe1c2350624a00c627
BLAKE2b-256 807ad41639643800c0d9d8cdaec9fa9a566ed779beebf119edbc2b6602c20c4d

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