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.1.tar.gz (11.5 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.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scriptx-0.1.1.tar.gz
  • Upload date:
  • Size: 11.5 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.1.tar.gz
Algorithm Hash digest
SHA256 61f9fa3901870efcc04e0c0c0ce82ac8e58fea82bb5e3c0b9f5c2fcf408c7fea
MD5 b968f9af24489af23de31dca8e1dbf7c
BLAKE2b-256 43e559e2415bc81bd56f8c4c2f29b1f355ee0873de402d17aff247e00f611c87

See more details on using hashes here.

Provenance

The following attestation bundles were made for scriptx-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: scriptx-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 536881bcbbac57827aca5a30de04b229c72b743e534e75326db25d8cd29bd099
MD5 6c61b9f9b8788e74b9e6269f1e9298ab
BLAKE2b-256 fc94c584081c730045670aea4f9671c1a0d1dfad541f00c660e793b304fed5ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for scriptx-0.1.1-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