Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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.

Release History

Release History

This version
History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Python_Bash_Utils-0.1.5-py2.7.egg (5.9 kB) Copy SHA256 Checksum SHA256 2.7 Egg Jun 25, 2015
Python_Bash_Utils-0.1.5-py2.py3-none-any.whl (8.2 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Jun 25, 2015
Python-Bash-Utils-0.1.5.tar.gz (5.5 kB) Copy SHA256 Checksum SHA256 Source Jun 25, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting