Skip to content

tqdm.contrib.discord#

[view source]

Sends updates to a Discord bot.

Usage:

>>> from tqdm.contrib.discord import tqdm, trange
>>> for i in tqdm(iterable, token='{token}', channel_id='{channel_id}'):
...     ...

screenshot

tqdm_discord Objects#

[view source]

class tqdm_discord(tqdm_auto)

Standard tqdm.auto.tqdm but also sends updates to a Discord Bot. May take a few seconds to create (__init__).

>>> from tqdm.contrib.discord import tqdm, trange
>>> for i in tqdm(iterable, token='{token}', channel_id='{channel_id}'):
...     ...

__init__#

[view source]

def __init__(*args, **kwargs)

Parameters

  • token: str, required. Discord token
    [default: ${TQDM_DISCORD_TOKEN}].
  • channel_id: int, required. Discord channel ID
    [default: ${TQDM_DISCORD_CHANNEL_ID}].
  • mininterval: float, optional.
    Minimum of [default: 1.5] to avoid rate limit.

See tqdm.auto.tqdm.__init__ for other parameters.

tdrange#

[view source]

def tdrange(*args, **kwargs)

A shortcut for tqdm.contrib.discord.tqdm(xrange(*args), **kwargs). On Python3+, range is used instead of xrange.