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.3.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.3-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scriptx-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 aec18d51fa356152a7423fad6bc7c7ff401d2fbd4cee5fd35bc3d35937a83525
MD5 0863dd20eee20f75d505751641cc4dd5
BLAKE2b-256 95a24c0aaa982430972fc696f8fd5387aff554736196f0d5bca9ac9f200eab58

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: scriptx-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 36205c95e14ceaa7293059bb650f7b345a9243300a1e87776cbde4d8fc17bfeb
MD5 8f923f538a965d52f3604eda75b04d85
BLAKE2b-256 8df4d26341d37fd2c26a0c0319d97e3dee0280fda06fb3a38f0ec4547305b82e

See more details on using hashes here.

Provenance

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