Skip to main content

Basic progress bar and discord progress bar

Project description

Basic Progress Bar

Progress bar for console and discord

Pypi PyPI PyPI - Python Version


installation:

pip install basicprogressbar        # for basic features
pip install basicprogressbar[timer] # for pretty time support
pip install basicprogressbar[all]   # for all features
from basicprogressbar import BasicProgressBar

Arguments:

    current:float = 0       # current progress
    total:float = -1        # total progress '-1' for unlimited
    posttext:str=""         # text behind the bar
    pretext:str="Progress:" # text before the bar
    length:int=60           # length of the bar
    endtext:str=""          # text after the bar when done
    endline:str='\r'        # endline character to rewite same line
    showtime:bool=False     # show remaining time

Basic Examples:

prog = BasicProgressBar(1, 50, pretext="Before bar:", showtimer=True)
for i in range(51):
    time.sleep(0.1)
    prog.current = i
    prog.endtext = (f"I ended on {i}")
    prog.bar(True)

for i in range(11):
    time.sleep(0.1)
    BasicProgressBar(i, 10).bar(True)

prog = BasicProgressBar(1, 10)
for i in range(11):
    time.sleep(0.1)
    prog.current = i
    prog.posttext = f"processing {i}"
    print(prog.bar(), end=prog.endline)

prog = BasicProgressBar()
for i in range(25):
    time.sleep(0.1)
    print(prog.next(), end="\r")
print()

Discord Progress Bar:

Progress bar for discord

installation:

pip install basicprogressbar[discord]
from basicprogressbar import DiscordProgressBar

Arguments:

    # All the arguments of from BasicProgressBar first
    idtoken:str=""              # discord id token
    disuser:str="Progress Bar"  # name of discord user
    throttle:float=0.5          # time between messages
    # shouldnt have to edit the ones below
    messtime:float=0.0          # time used for waiting between messages
    messid:str=""               # message id to edit line
    timeout:float=10.0          # discord timeout
# all examples from BasicProgressBar apply
token = "23135245523/f43faDSAF-FEAfe24f3qfq-2yfbB-agdagADGA-g334t34gqarGS"

prog = DiscordProgressBar(1,100,idtoken=token)
for i in range(1,101):
    time.sleep(0.1)
    prog.current = i
    prog.send()

prog = DiscordProgressBar(idtoken=token)
for i in range(1,101):
    time.sleep(0.1)
    prog.current = i
    prog.send()

prog = DiscordProgressBar(total=100, idtoken=token)
for i in range(1,101):
    time.sleep(0.1)
    prog.next()

For Async use:

Dependencies: httpx, asyncio
pip install basicprogressbar[async]
from basicprogressbar import class DiscordProgressBarAsync
# Async Examples
import asyncio

token = "23135245523/f43faDSAF-FEAfe24f3qfq-2yfbB-agdagADGA-g334t34gqarGS"

prog = basicprogressbar.DiscordProgressBarAsync(1,100, idtoken=token)

async def sending():
    for i in range(1, 51):
        prog.current = i
        await prog.send()
        await asyncio.sleep(1)

asyncio.run(sending())

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

basicprogressbar-1.1.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

basicprogressbar-1.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file basicprogressbar-1.1.1.tar.gz.

File metadata

  • Download URL: basicprogressbar-1.1.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for basicprogressbar-1.1.1.tar.gz
Algorithm Hash digest
SHA256 062b675e5f8d7b69d43e0bf3613d855e86b09a1dec26596917a67667ecde6cff
MD5 0407fb45fd028616c4b2019f192ae453
BLAKE2b-256 74429919a7872f0fe34c7fbf4c8ba5bb3ffee53e4b05e35d1d0bf56d28cf3fe0

See more details on using hashes here.

Provenance

The following attestation bundles were made for basicprogressbar-1.1.1.tar.gz:

Publisher: python-publish.yml on Sumiza/basicprogressbar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file basicprogressbar-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for basicprogressbar-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4c83de4647719058adafeefc21a3c3c1e6d97ab883feedd43d714d45364e86e6
MD5 a67e57bd29ac50706179eaaf03fc9929
BLAKE2b-256 43264a4bc64995f73cda3e2c0db5d503e7b9ec0e544a968609a483e5db80d523

See more details on using hashes here.

Provenance

The following attestation bundles were made for basicprogressbar-1.1.1-py3-none-any.whl:

Publisher: python-publish.yml on Sumiza/basicprogressbar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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