Useful helpers by me, for me.
Project description
mmguero
mmguero is my personal collection of miscellaneous helper functions for Python.
Contents
AskForPassword
- get interactive password (without echoing)AskForString
- get interactive user responseCheckOutputInput
- run command with arguments and return its exit code, stdout, and stderrDoDynamicImport
- attempt dynamic imports, prompting for install via pip if possibleDownloadToFile
- download a URL to a local fileeprint
- print to stderrGitClone
- create a local git cloneLoadStrIfJson
- is this string valid json? if so, load and return itpushd
- chdir to directory as context manager, returning automaticallyRemoveEmptyFolders
- recursively remove empty subfoldersRunProcess
- run command with arguments and return its exit code, stdout, and stderrSizeHumanFormat
- nice human-readable file sizesstr2bool
- convenient boolean argument parsingTestSocket
- test if a remote port is openWhich
- determine if a program/script exists and is executable in the system pathYesOrNo
- get interactive user response to Y/N question
Installation
Using pip
, to install the latest release from PyPI:
python3 -m pip install -U mmguero
Or to install directly from GitHub:
python3 -m pip install -U 'git+https://github.com/mmguero/python-mmguero'
Authors
- Seth Grover - Initial work - mmguero
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mmguero-1.0.3.tar.gz
(7.7 kB
view hashes)