Skip to main content

A simple framework to help you build scripts faster!

Project description

Scripto

Build Project linting: pylint Python Version from PEP 621 TOML PyPI - Version PyPI - Downloads

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 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


Download files

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

Source Distribution

Scripto-1.0.1.tar.gz (43.4 kB view details)

Uploaded Source

Built Distribution

Scripto-1.0.1-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: Scripto-1.0.1.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for Scripto-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e3bb73b281bf014245aaccf45c6f14599998c3842ff34a9139608d0d750d1a3e
MD5 46c577a17c3717ee7b3444a0a7f80727
BLAKE2b-256 89707038e56e26635bbdf9132e1adc4f5264ad801695968d1fc12d51418e11c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Scripto-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for Scripto-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1a5a186374da898b7c566e719d5ffaee37b597ed883e849eeec86b4369f31d8
MD5 5707864e1e3214997852a7deef74dce1
BLAKE2b-256 0791b0b4ed9100cd9e93a6feaac63afb18f6e44203db44314402899795194a94

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