Skip to main content

Python Bash Utils

Author: Tim Santor tsantor@xstudios.com

Overview

Bash color management and log system for Python users.

Requirements

  • Python 3.8.x

Installation

You can install directly via pip:

pip install python-bash-utils

Usage

logmsg

Import:

from bashutils import logmsg

Functions:

logmsg.divline()             # ----------
logmsg.header('header')      # ==> header
logmsg.success('success')    # [OK] success
logmsg.error('error')        # [ERROR] error
logmsg.warning('warning')    # [WARNING] warning
logmsg.info('info')          # [INFO] info
logmsg.note('note')          # note

logmsg.prompt('What is your name?)  # [?] What is your name?
lomgsg.confirm('Confirm this')  # [?] Confirm this? (y/n)

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

Issues

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

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
  • 0.3.0 - Simplified code base and now rely on colorama for cross-platform terminal color support
  • 0.3.1 - Added cooler icons for success/error for Linux/Mac
  • 0.3.2 - Remove unicode chars that cause issues when writing to file
  • 0.3.3 - Updated packaging method, updated setup.py

Metadata

Release files for python-bash-utils 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for python-bash-utils 0.4.0
File Interpreter ABI Platform
python_bash_utils-0.4.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / python_bash_utils-0.4.0-py2.py3-none-any.whl

Download URL python_bash_utils-0.4.0-py2.py3-none-any.whl
Size 5.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
00ea8f9f75ae4d9f7cba0884531514f76e24f77ee0fa537ac33fe21e24397bfb
BLAKE2b-256 checksum
How to use checksums
5394b04c93e8ba88ffd9023a277023752bea69ab37c20e2828dde848852bbbd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.11

Release history Release notifications | RSS feed

This release

0.4.0 This release

1 release file

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.5

3 release files

0.1.4

3 release files

0.1.3

3 release files

0.1.2

3 release files

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page