Skip to main content

A lightweight manager for PEP 723 Python scripts - install, run, update, and manage standalone scripts with isolated environments.

Project description

scriptx

PyPI - Version PyPI - Python Version pre-commit.ci status

A lightweight manager for PEP 723 Python scripts — install, run, update, and manage standalone scripts with isolated environments.


Table of Contents

Installation

pipx install scriptx
uv tool install scriptx

Usage

[flavio@Mac ~/dev/github.com/FlavioAmurrioCS/scriptx]
$ scriptx --help

 Usage: scriptx [OPTIONS] COMMAND [ARGS]...

╭─ Options ───────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                     │
╰─────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────╮
│ install     Install a script from a local path or URL.                          │
│ uninstall   Uninstall a script by name or source URL/path.                      │
│ list        List all installed scripts.                                         │
│ run         Run an installed script by name, passing any additional arguments.  │
╰─────────────────────────────────────────────────────────────────────────────────╯

Install a tool

Tool will:

  • Download the publicly avaiable url(in this case a github page url) or a file on disk.
  • Create a virtualenv for the script based on the inline script metadata.
  • It will copy the script into the ~/opt/scriptx/bin directory.
  • Update the #! shebang of the script to allow for faster execution.
  • NOTE: You can pass in a alternative name for the script, by default it will use the basename of the SRC.
[flavio@Mac ~/dev/github.com/FlavioAmurrioCS/scriptx][init ]
$ scriptx install --help

 Usage: scriptx install [OPTIONS] SRC

 Install a script from a local path or URL.

╭─ Arguments ──────────────────────────────────────╮
│ *    src      TEXT  [required]                   │
╰──────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────╮
│ --name        TEXT                               │
│ --help              Show this message and exit.  │
╰──────────────────────────────────────────────────╯

[flavio@Mac ~/dev/github.com/FlavioAmurrioCS/scriptx]
$ scriptx install https://flavioamurriocs.github.io/uv-to-pipfile/src/uv_to_pipfile/uv_to_pipfile.py
uv_to_pipfile.py has been installed at: /Users/flavio/opt/scriptx/bin/uv_to_pipfile.py
Warning: /Users/flavio/opt/scriptx/bin is not in your PATH. Please add it to run 'uv_to_pipfile.py' from the command line.

[flavio@Mac ~/dev/github.com/FlavioAmurrioCS/scriptx]
$ head -n2 /Users/flavio/opt/scriptx/bin/uv_to_pipfile.py
#!/Users/flavio/.cache/uv/environments-v2/tmplgn78zuu-f65b2dd2c079bd68/bin/python
# /// script

Display installed scripts

[flavio@Mac ~/dev/github.com/FlavioAmurrioCS/scriptx]
$ scriptx list
{
  "uv_to_pipfile.py": {
    "src": "https://flavioamurriocs.github.io/uv-to-pipfile/src/uv_to_pipfile/uv_to_pipfile.py",
    "install_location": "/Users/flavio/opt/scriptx/bin/uv_to_pipfile.py",
    "venv": "/Users/flavio/.cache/uv/environments-v2/tmplgn78zuu-f65b2dd2c079bd68"
  }
}

Execute the script via the tool

[flavio@Mac ~/dev/github.com/FlavioAmurrioCS/scriptx]
$ scriptx run uv_to_pipfile.py --help
usage: uv_to_pipfile.py [-h] [--uv-lock UV_LOCK] [--pipfile-lock PIPFILE_LOCK]

Convert uv.lock to Pipfile.lock

options:
  -h, --help            show this help message and exit
  --uv-lock UV_LOCK     Path to the uv.lock file (default: ./uv.lock)
  --pipfile-lock PIPFILE_LOCK
                        Path to the Pipfile.lock file (default: ./Pipfile.lock)

Execute script directly

NOTE: You must update your PATH

[flavio@Mac ~/dev/github.com/FlavioAmurrioCS/scriptx]
$ export PATH="/Users/flavio/opt/scriptx/bin:${PATH}"

[flavio@Mac ~/dev/github.com/FlavioAmurrioCS/scriptx]
$ uv_to_pipfile.py --help
usage: uv_to_pipfile.py [-h] [--uv-lock UV_LOCK] [--pipfile-lock PIPFILE_LOCK]

Convert uv.lock to Pipfile.lock

options:
  -h, --help            show this help message and exit
  --uv-lock UV_LOCK     Path to the uv.lock file (default: ./uv.lock)
  --pipfile-lock PIPFILE_LOCK
                        Path to the Pipfile.lock file (default: ./Pipfile.lock)

License

scriptx is distributed under the terms of the MIT license.

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

scriptx-0.1.4.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

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

scriptx-0.1.4-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file scriptx-0.1.4.tar.gz.

File metadata

  • Download URL: scriptx-0.1.4.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scriptx-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2a651e63b339584c7d256695f2d5678312ce35dd61f12bcc7723f3e885b40187
MD5 0e72220fbd4c922bf5ff54fe4cbafce5
BLAKE2b-256 8dc77dd50536be036a8dc04b1723d3c5a1b330368daa801fdde87ef418757acd

See more details on using hashes here.

Provenance

The following attestation bundles were made for scriptx-0.1.4.tar.gz:

Publisher: main.yaml on FlavioAmurrioCS/scriptx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scriptx-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: scriptx-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scriptx-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f72579171a3002e2fbb793124fb777b796bdd8dd0fd18a44653b32c5d1ee87b0
MD5 c250b008f08add10e5ba72439f91b76b
BLAKE2b-256 435b59483ae5ce55aa2d4a285df55ca0d17d2c415a782566d949e92a83fcb144

See more details on using hashes here.

Provenance

The following attestation bundles were made for scriptx-0.1.4-py3-none-any.whl:

Publisher: main.yaml on FlavioAmurrioCS/scriptx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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