A simple framework to help you build scripts faster!
Project description
Scripto
Are you sick of writing long and annoying argparse initialization code? Worry no more - the future is here!
Scripto is a Python package designed to transform your scripts into a powerful CLI tool using decorators.
As in the example below, you can use the @script.register()
decorator on your main business logic functions
to effortlessly generate a feature-rich command-line interface.
Features
- Seamless integration with argparse.
- Simple and intuitive syntax inspired by Flask.
- Automatically generates CLI commands from decorated functions.
- Ideal for turning scripts into organized and user-friendly command-line tools.
Usage
-
Install Scripto. You can install Scripto using pip:
pip install scripto
-
Decorate your main business logic functions with
@script.register()
. -
Run your script to enjoy the generated CLI:
from scripto.app import Scripto script = Scripto('script') @script.register() def my_command(arg1, arg2): """ Description of your command. """ # Your business logic here if __name__ == "__main__": script.run()
Complex Examples
See the example scripts provided.
About the rationale
We all like the simple automations, and nifty little scripts play a vital role in the life of every developer.
Many times, what was a simple 3 line script turned into a slightly larger one, and then all of your friends want to use it too.
Which is when you find out, your user interface sucks.
This framework aims to simplify the creation of the command line interface of such scripts.
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
Built Distribution
File details
Details for the file Scripto-0.0.12.tar.gz
.
File metadata
- Download URL: Scripto-0.0.12.tar.gz
- Upload date:
- Size: 42.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f8821415f4fe8359b7ca00f49f7abb4fe5eb3db13a4244799045753f7a04cfb |
|
MD5 | 240a264e427b887a3a3d1d2ae15b882e |
|
BLAKE2b-256 | a91c1938a35e0b4d985bc0bc54eaeddf777c0db751e541d8aa49b57c3e95aebf |
File details
Details for the file Scripto-0.0.12-py3-none-any.whl
.
File metadata
- Download URL: Scripto-0.0.12-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 634176a1a3aa8bf4814f76cb5b7549eacbf20c5fb1542eb3bd76cc1c4d6d39e0 |
|
MD5 | d7576d1d65b257a4781e723119d25a53 |
|
BLAKE2b-256 | 9d2074660008059b8bee3d00164ccedf9592dbe81fa83d1c3e5db39088bd6f4d |