Skip to main content

A package which allows making bash style command line scripts easier.

Project description

Latest Version Downloads Development Status License

Overview

Bash color management and log system for Python users.

Requirements

  • Python 2.7.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')

Version History

  • 0.1.0 - Initial release

Issues

If you experience any issues, please create an issue on Bitbucket.

Project details


Download files

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

Source Distribution

Python-Bash-Utils-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

File details

Details for the file Python-Bash-Utils-0.1.0.tar.gz.

File metadata

File hashes

Hashes for Python-Bash-Utils-0.1.0.tar.gz
Algorithm Hash digest
SHA256 82fd2beda365f1f52dca624026a46dbc5a2954218de23c00192b62f2c2f9e48f
MD5 ed0276d8a4b6e9e3e1baa324d7fa9814
BLAKE2b-256 af0ceab4c3ee515080752ba856fa530b5e6c5b85a46413b2fb11ea7a0c9fa20c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page