Serve click scripts over the web with minimal effort.
Project description
click-web
Serve click scripts over the web with minimal effort.
Caution: No security (login etc.), do not serve scripts publicly.
Usage
See this demo screen capture.
Take an existing click script, like this one:
example_command.py
import click import time @click.group() def cli(): 'A stupid script to test click-web' pass @cli.command() @click.option("--delay", type=float, default=0.01, help='delay for every line print') @click.argument("lines", default=10, type=int) def print_rows(lines, delay): 'Print lines with a delay' click.echo(f"writing: {lines} with {delay}") for i in range(lines): click.echo(f"Hello row: {i}") time.sleep(delay) if __name__ == '__main__': cli()
Create a minimal script to run with flask
app.py
from click_web import create_click_web_app import example_command app = create_click_web_app(example_command, example_command.cli)
Running example app:
In Bash:
export FLASK_ENV=development export FLASK_APP=app.py flask run
Unsupported click features
It has only been tested with basic click features, and most advanced features will probably not work.
Variadic arguments of file and path type
Promts (probably never will)
Custom ParamTypes (depending on implementation)
TODO
Abort started/running processes.
Browser history
Included 3:rd party libraries
SplitJs - Copyright (c) 2018 Nathan Cahill (MIT license)
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
click-web-0.6.6.tar.gz
(36.5 kB
view hashes)
Built Distribution
click_web-0.6.6-py3-none-any.whl
(46.0 kB
view hashes)
Close
Hashes for click_web-0.6.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79956f4c27de0a0ae620c504282d615c014245f6611e1f58dda22e4175d41782 |
|
MD5 | 8278bda8529db6bc94c44fe0b262f01a |
|
BLAKE2b-256 | dfbb73d1bb96cfea764cfcb42f98d477ccf715a595775d1630fe5a00c6b7b3c0 |