Skip to main content

WARPED - a Webbased frontend for ARgparser in Python

warped can be used to execute single Python file and Python modules. It captures calls to the argparse module of Python and renders a web GUI based on the options and arguments defined. It also displays the output of the program inside the web GUI and allows you to stop, pause and resume the program, as well as downloading the output.

Install

Either get a stable version from PyPI, or install the current version from git

# Installation from PyPI
pip install warped

# Installation from git
pip install git+https://git.k-fortytwo.de/christofsteel/warped/

Usage

warped [-h] [--port PORT] [--host HOST] [--module] file

a Webbased frontend for ARgparse in Python

positional arguments:
file                  File to run

optional arguments:
-h, --help            show this help message and exit
--port PORT, -p PORT  The port to listen on (default 5000)
--host HOST           The host to bind to (default 0.0.0.0)
--module, -m          If set, loads a module instead of a file

Sample

To test the capabilities of warped an example module was included. You can run it like this:

warped -m warped.samples.hooked

Since warped also makes use of the argparse module, warped itself can be //warped//.

warped -m warped.hook

How does it work?

When warped is executed, it starts a flask webserver. The javascript of the website reads the /arguments resource of the server, where the configuration of the argparser returned. In a seperate process the given program is executed using the runpy library, redirecting sys.stdin and sys.stdout to a multiprocessing.Queue, which can be read by the warp process to display it via the web GUI.

Additionally, warped adds an entry for argparse in the sys.modules list. Python looks first looks at this list, everytime a module is imported, to avoid importing a module multiple times. This custom argparse module behaves similar to the original argparse module. In fact with the exception of the ArgumentParser.parse_args() method, it works exactly like the original. Once the program calls the parse_args() method, it blocks and waits for user interaction via the web GUI. Once the user submits the data, the process continues.

Release files for warped 0.1.3

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

Source distribution (sdist)

Source distribution for warped 0.1.3
File Size Uploaded
warped-0.1.3.tar.gz 522.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for warped 0.1.3
File Interpreter ABI Platform
warped-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / warped-0.1.3.tar.gz

Download URL warped-0.1.3.tar.gz
Size 522.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a845c47a4ce8ecb105f65c692bd83f4c0b47422e59cff80594a2904f0d0dc060
BLAKE2b-256 checksum
How to use checksums
6d3de602233544f22dbd1e8447cd8ca0e52aefe43d642f42bf8b70383276b6ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / warped-0.1.3-py3-none-any.whl

Download URL warped-0.1.3-py3-none-any.whl
Size 681.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3971c22d20763786bae869b4b5c2a510adcfafc39b6217931d6081be5b4599e5
BLAKE2b-256 checksum
How to use checksums
55623e437f5d271569d512928a67207ecec47f6bc13ff3f6241e06f1142c8539
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

1 release file

0.1.0

1 release file

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