Skip to main content

Web-CLI

Easy to use Web CLI for python applications.

Table of content

Usage

Import and make a instantiate it.

settings = Settings(name="Example page")
server = WebCLIServer(settings, backend)

fun backend(user_command: UserCommand) -> None:
    # do stuff here

After, start the server with server.start().

server.start()

The example provded will result in a webserver opened on 127.0.0.1:8080 (localhost:8080). Opening this page will result in a command line looking webpage that can communicate with the server.

Settings

  • host: Host's IP.
  • port: Port for the IP address.
  • name: Name of the web server.

functions

to_file

  • string_path (str or None): A string path for the settings file.

Creates a config file with the path provided or in the current folder witht he default name.

from_file

  • string_path (str or None): A string path for the settings file.

Reads the file provided, and creates a settings class.

WebCLIServer

  • settings: Settings data to set up the server.
  • backend: A func that can handle UserCommand data class as input, and do something with it, with a return value that's ignored.
  • logger: An smdb_logger logger. It can be None or ignored, so it won't produce output on stdrout.

functions

push_data

  • response (str or List[str]): The output for a user command.
  • command (UserCommand or None): The user command to reply to. If None, the last command will be used.

Adds a response for a user command. It can be used to oush data to the web cli, with command being not set, it will result in the data being pushed to the last command in the history.

start

Starts the server.

stop

Stops the server.

Metadata

Release files for smdb-web-interface 0.1.6

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

Source distribution (sdist)

Source distribution for smdb-web-interface 0.1.6
File Size Uploaded Provenance Actions
smdb_web_interface-0.1.6.tar.gz 14.2 kB Without provenance Details for smdb_web_interface-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for smdb-web-interface 0.1.6
File Interpreter ABI Platform Actions
smdb_web_interface-0.1.6-py3-none-any.whl Python 3 none any Details for smdb_web_interface-0.1.6-py3-none-any.whl

Total release size: 27.9 kB

Release files / smdb_web_interface-0.1.6.tar.gz

Download URL smdb_web_interface-0.1.6.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7af6f475677251697aa6346c72a10c5e2728a6be4cf9378609f37f99fd0fc830
BLAKE2b-256 checksum
How to use checksums
1b7b57c7354f95327aa895d73cd60d287fea1ecaf2ebf96890ba5d714f0554e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.13

Release files / smdb_web_interface-0.1.6-py3-none-any.whl

Download URL smdb_web_interface-0.1.6-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d9abf038d148cd37f408a1efc8589a8f6ade4741380f61305e8c3a36d55f1c8
BLAKE2b-256 checksum
How to use checksums
54c2dd122dd67321604983929af008bed48684e2b23976632cfd42eadba276d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.13

Security for smdb-web-interface 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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