Skip to main content

A simple framework to help you build scripts faster!

Project description

Scripto

Pylint Build Project

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

  1. Install Scripto. You can install Scripto using pip:

    pip install scripto
    
  2. Decorate your main business logic functions with @script.register().

  3. 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 script 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Scripto-0.0.9.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

Scripto-0.0.9-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file Scripto-0.0.9.tar.gz.

File metadata

  • Download URL: Scripto-0.0.9.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for Scripto-0.0.9.tar.gz
Algorithm Hash digest
SHA256 e7b5296aa5726dd6d77b3c9a05bd853c92baaae4333c9801a707eb59b9f1e3d5
MD5 d592b26bf105bcc2b4e1d44a33f78e11
BLAKE2b-256 ae480d287a266f64e9e4ba870696319cd5a798fd35751eb50c9c1ec0998d9afd

See more details on using hashes here.

File details

Details for the file Scripto-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: Scripto-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for Scripto-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 64b55d96de49b7405ec3484ce6d56c7fc6d62ba3cca150c31b58a371feea4e30
MD5 c475a8c0641cf8d80cdc7b36de00b1b7
BLAKE2b-256 00fe985e731014988918384e3a828955811441edde8a37aba75372eb5224dc6b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page