Smashi is a python3 library with some useful utilities.
- cmd.py - Running commands from python
- copy.py - Copy recursively for e.g.
- file.py - Some file manipulation routines
- gui.py - Terminal whiptail gui for things like install scripts
- log.py - Some basic logging
- module.py - Load modules from script files
- net.py - Get your host ip, check internet
- password.py - Generate passwords
- proxmox.py - Provision proxmox lxc containers
Install via pip3 using this git repo
pip3 install git+https://[email protected]/charlmert/smashi.git@master#egg=smashi
Running shell commands
import smashi.cmd
smashi.cmd.output('ls -1')
# example output: (0, 'assets\nbuild\ndist\nreadme.md\nsetup.py\nsmashi\nsmashi.egg-info\n', '')
# You can also tail command output
smashi.cmd.tail('ls -1')
Generating passwords
import smashi.password
print(smashi.password.generate())
# example output: kb637a9QZvKQ
Converting bytes to string Avoiding UnicodeDecodeError and UnicodeEncodeError exceptions
import smashi.str
smashi.str.bytesToString(b'hello\xe5hi')
# example output: "b'hello\\xe5hi'"
If you would like to fork this package and build your own based off it
sudo python3 -m pip install --upgrade pip setuptools wheel
sudo python3 -m pip install tqdm
sudo python3 -m pip install --user --upgrade twine
To build
python3 setup.py bdist_wheel