Skip to main content

Quick Dirty Scripts

Project description

qds

qds (Quick Dirty Scripts) is a CLI tool that lets you create and run quick Python scripts from the command line with minimal setup.

Installation

Install via pip:

pip install qds-run

Overview

When you first run any qds command, it initializes a directory in your home folder:

  • ~/.qds/qds.toml A TOML file containing metadata about your scripts.

  • ~/.qds/<script>.py Python files where each script’s code lives.

You can then add, edit, list, rename, run, and delete these scripts directly from your terminal.

Basic Usage

  1. Initialize your workspace The first time you invoke any command, ~/.qds/qds.toml and the ~/.qds/ folder will be created automatically.

  2. Create a new script skeleton

    qds add <script_name>
    

    For example:

    qds add base64conv
    

    You’ll be prompted to enter a description; after confirming, a file named ~/.qds/base64conv.py is created.

  3. Edit your script Open ~/.qds/base64conv.py in your editor. By default, it will contain a template like this:

    from qds import qds
    
    @qds(
        args=[("text", str, "Sample text to be provided")],
    )
    def run(text: str) -> str:
        pass
    
    • @qds decorator

      • args: a list of (name, type, description) tuples defining the arguments your script accepts.
    • run function

      • The entry point; return a string to be printed.
  4. Run your script

    You will be prompted to fill in the arguments.

    qds run base64conv
    

Example: Text to Base64 Converter

  1. Add the script:

    qds add base64conv
    
  2. Edit ~/.qds/base64conv.py so that run looks like this:

    import base64
    from qds import qds
    
    @qds(
        args=[("text", str, "Text to encode to Base64")],
    )
    def run(text: str) -> str:
        encoded = base64.b64encode(text.encode("utf-8")).decode("utf-8")
        return encoded
    
  3. Use it:

    $ qds run base64
    

Available Commands

Command Description
qds add Create a new script skeleton
qds delete Delete an existing script
qds list List all available scripts
qds rename Rename a script
qds run Run a script with the given arguments
qds update Update the description of a script
qds view Show the source code of a script
qds --help Display help message
qds --version Display application version

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

qds_run-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qds_run-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file qds_run-0.1.0.tar.gz.

File metadata

  • Download URL: qds_run-0.1.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.9 Windows/10

File hashes

Hashes for qds_run-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0092afabcbbc8f0182dae3ddb6e4015c1ef69d75dece9b3c6ca6460f765fb02f
MD5 008fefba57543142364648d36a185e3f
BLAKE2b-256 8d2bd29d531cc57df240e3570029418f11fae286c439127b05d15af6c66c7b40

See more details on using hashes here.

File details

Details for the file qds_run-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qds_run-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.9 Windows/10

File hashes

Hashes for qds_run-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b25e863d7b4e6c5861c577500d880ea2de0d4f6c16af98c8b163c484b43f479
MD5 c36591f6388456fc4223c4eff1ec803a
BLAKE2b-256 a7c59278b135cfb1bae35e16df635cd9aa3ed2f11ff6461c4afbfa9f567ab398

See more details on using hashes here.

Supported by

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