Tooler: Easier, better, faster python devops scripts
Features:
Simple access to local or remote (via asyncssh) shells
Neat legible output from multiple hosts
Simple access to bash:
import shlex
from tooler import Tooler
tooler = Tooler()
@tooler.command
def free(mount='/'):
for result in tooler.bash('df -mah | grep %s' % shell_quote(mount + '$')):
fs, blocks, use, available, use_pct, mnt = shlex.split(result.stdout)
result.host.print('Used %s (%s) of %s [%s]' % (use, use_pct, mnt, fs))
if __name__ == '__main__':
tooler.main()
$ ./disk.py free --mount=/
local$ df -mah | grep '/$'
local> /dev/mapper/ubuntu--vg-root 102G 69G 28G 72% /
local: [✔]
local: Used 69G (72%) of / [/dev/mapper/ubuntu--vg-root]
Subcommands made easy:
from tooler import Tooler
from tooler.library import (named, SshConfig)
import disk
tooler = Tooler()
tooler.add_submodule('disk', disk.tooler)
tooler.add_submodule('named', named.tooler)
if __name__ == '__main__':
named.add_hosts(SshConfig().get_hosts())
tooler.main(hosts=[])
Library of awesome sauce:
$ ./tool.py named:nginx* disk.free
$ s named:nginx* free
nginx1$ df -mah | grep '/$'
nginx2$ df -mah | grep '/$'
nginx3$ df -mah | grep '/$'
nginx3> /dev/sda1 59G 37G 22G 64% /
nginx3: [✔]
nginx1> /dev/sda1 59G 37G 22G 64% /
nginx1: [✔]
nginx2> /dev/sda1 59G 37G 22G 64% /
nginx2: [✔]
nginx1: Used 37G (64%) of / [/dev/sda1]
nginx2: Used 37G (64%) of / [/dev/sda1]
nginx3: Used 37G (64%) of / [/dev/sda1]
Thanks required:
Metadata
Release files for shellby 0.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shellby-0.0.0.tar.gz | 3.2 kB | Without provenance | Details for shellby-0.0.0.tar.gz |
Release files / shellby-0.0.0.tar.gz
| Download URL | shellby-0.0.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
83f31ebdb6ceb0dada930c5e09dae98c3191b3122876df7ee96937d86c44da50
|
|
BLAKE2b-256 checksum How to use checksums |
d390b3d82833bd5fb12490e82e564c8968f711f1d2047e2647c555176278a7f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.8
|
Security for shellby 0.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.