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 bashutils.file_exists('/path/to/file.ext') bashutils.delete_file('/path/to/file.ext') bashutils.dir_exists('/path/to/dir') bashutils.make_dir('/path/to/dir') bashutils.delete_dir('/path/to/dir')
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
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.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a4e7b281f9e7933774a94e7d818ab2ac17913d41d5f7d3c69768b1cc54668cf |
|
MD5 | b81bf2efe946c149848a967cf406efd4 |
|
BLAKE2b-256 | 3de1d8e91ede5f57fb6363d8078ddfd6303fcf95ba11503774927de6f5721a84 |
Close
Hashes for Python_Bash_Utils-0.1.3-py2.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0cc876b038da43a7c5e27aa3a7e8ac2bdb738fc500684d7f933650e3aacbbe0 |
|
MD5 | 3a82328a68acdee0ccc1dac4e82f436e |
|
BLAKE2b-256 | fb9e7d1065655adb27414a2353759a5cb950a9061737f01ba0b7a38d899a45b0 |