A package which allows making bash style command line scripts easier.
Project description
Python Bash Utils
Author: Tim Santor tsantor@xstudios.agency
Overview
Bash color management and log system for Python users.
Requirements
Python 2.7.x, 3.4.x
NOTE: This has only been tested on a Mac (10.10.2) at this time.
Installation
You can install directly via pip:
pip install python-bash-utils
Or from the BitBucket repository (master branch by default):
git clone https://bitbucket.org/tsantor/python-bash-utils cd python-bash-utils sudo python setup.py install
Usage
colors
Import:
from bashutils import colors
Functions:
colors.color_text(text, color="none")
logmsg
Import:
from bashutils import logmsg
Functions:
logmsg.log_divline() # ---------- logmsg.log_header('header') # ==> header logmsg.log_success('success') # [✓] success logmsg.log_error('error') # [✗] error logmsg.log_warning('warning') # [!] warning logmsg.log_info('info') # [i] info logmsg.log_declined('something') # [✗] something declined. Skipping...
bashutils
Import:
from bashutils import bashutils
Functions:
bashutils.get_os() # OSX, 'Fedora', 'CentOS', 'Debian', 'Ubuntu' status, stdout, stderr = bashutils.exec_cmd('git -h') bashutils.cmd_exists('git') # True or False
Version History
0.1.0 - Initial release
0.1.1 - Added some new methods
0.1.2 - Refactor
0.1.3 - Added Python 3.4.x support
0.1.4 - Added ability to pass logger instance to log message as well
0.1.5 - Added Windows output workaround
0.1.6 - Removed needless declined method, was being overly verbose in output
0.2.0 - Updated for Python 3
Issues
If you experience any issues, please create an issue on Bitbucket.
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
Built Distribution
Hashes for Python_Bash_Utils-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 537504bea0fbe4ed56016fbd324c3983b35a2561a740c2eba74f39680c955cef |
|
MD5 | 1f93c765b850fa63175ecf805adac949 |
|
BLAKE2b-256 | 3d6b698e738c401a365ba73c19242bf5f9963d96037c33534365dd5b8c7538ff |