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

Uploaded Python 3

File details

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

File metadata

  • Download URL: scriptx-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 192c2cf779b5fee9e12479fd2b378c14de57d58d4fa54001ef807beeedc5e9c5
MD5 067f26e219f1ad1c36dbe417dc3e5eb7
BLAKE2b-256 b33445debf962bd195f5f722c858a9fd30e7bd6f62f466229068cae5adc1e3dd

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: scriptx-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e0f021cbfc784002f122c7a03bba9027ec2d4ac199a42e44666b1c3bef3db27d
MD5 f55036bc427399ab0800e2ff244a590e
BLAKE2b-256 5cf91f79817593532f5ba7b28b9081a707802682ff0f90bf70c5e36da7b0522f

See more details on using hashes here.

Provenance

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