A package which allows making bash style command line scripts easier.
Project description
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 bashutils.file_exists('/path/to/file.ext') # True or False bashutils.delete_file('/path/to/file.ext') # True or False bashutils.dir_exists('/path/to/dir') # True or False bashutils.make_dir('/path/to/dir') bashutils.delete_dir('/path/to/dir') b
Version History
0.1.0 - Initial release
0.1.1 - Added some new methods
0.1.2 - Added Python 3.4.x support
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 Distributions
Close
Hashes for Python_Bash_Utils-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b91613519d903a43ca35277cf130c377d539287a24549c937e68fcd1c7edb491 |
|
MD5 | 20734a5009bbcb5df0fecf83898ebf31 |
|
BLAKE2b-256 | f75f9dcf0c5976cc1c306de986e387fa3688927617c78631583767bbc987bb34 |
Close
Hashes for Python_Bash_Utils-0.1.2-py2.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e6a5e539c0374f8c26ae9022d8a6503ce343d5c6b1e10b8d04de4ccebaa0d69 |
|
MD5 | f0b1544050c307bc2d4a976c1350e9db |
|
BLAKE2b-256 | cb58d0625bc7e16bcc4d4931d51196d4a0ec892a26d7a843c0a077e39480d654 |