Skip to main content

Lightning fast super customizable progress bar & indicator library for Python

Project description

Introduction

Supersonic is an Open-Source library for creating progress indicators (e.g. progress bars). It is super fast and super customizable.

Getting Started

Installation

Use this command to install Supersonic: pip install supersonic

After you have installed Supersonic, you can test if it has been successfully installed by running import supersonic in python. If Supersonic was installed successfully, it should show no errors.

Example

import supersonic as ss
import time

## Arguments
### t (the first argument) - Prefix text
### total - Total
### pdigits - Number of digits of the percentage to show
### ascii - True: Ascii, False: Unicode
### bar_length - Progress bar length
# Supersonic 1.2 now supports context managers!
with ss.sonic("Testing", total=1000, pdigits=1, ascii=False, bar_length=20) as p:
	for i in range(1000):
		p.progress() #or p.stat(i+1)
		time.sleep(0.01)

Making Extensions

A great thing about Supersonic is that you can extend it's capability with Extensions. You can find out more about Extensions here: supersonic/exts/README.md

Documentation

supersonic. supersonic(total=100, pdigits=1, ascii=True, bar_length=15)
supersonic. sonic(total=100, pdigits=1, ascii=True, bar_length=15)

supersonic.supersonic is a wrapper around supersonic.custom that let's you create progress bars without creating your own layout. If you want full control over the final product, checkout supersonic.custom.

Parameters

total (Default: 100)

Number of things or tasks you need to process.

pdigits (Default: 1)

How many digits to show in the percentage of completion.

ascii (Default: True)

Encoding of the Progress Indicator. Supersonic will use Ascii if this is True and use Unicode if this is False.

bar_length (Default: 15)

How long the progress bar should be.

supersonic. custom(*arrangement, total=100)

Parameters

*arrangement

The arrangement(or layout) of the progress indicator. It can contain both Strings and Extensions.

Example:
supersonic.custom(Percentage(), " |", Bar(), "| done")
# Result: 
# 50% |##########          | done

total (Default: 100)

Number of things or tasks you need to process.

Properties

current

Current progress.

Methods

show(), update()

Clear last status and show.

clear()

Clear last status.

stat(stat)

Set status to a specific value stat.

progress(by=1)

Increase the current status by a specific value by.

done()

Finished task!


supersonic.ext. Extension()

The base class for all Supersonic Extensions. If you want to make your own extensions, see here: supersonic/exts/README.md


Checkout my website at http://www.WhatsYourIdea.com/

Project details


Download files

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

Files for supersonic, version 1.3
Filename, size File type Python version Upload date Hashes
Filename, size supersonic-1.3-py2-none-any.whl (19.6 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size supersonic-1.3-py3-none-any.whl (19.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size supersonic-1.3.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page