Skip to content

Fast super customizable progress bar & indicator library for Python

License

Notifications You must be signed in to change notification settings

llsupersonic/supersonic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/

About

Fast super customizable progress bar & indicator library for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages