Skip to content

tqdm.contrib.slack#

Sends updates to a Slack app.

Usage:

>>> from tqdm.contrib.slack import tqdm, trange
>>> for i in trange(10, token='{token}', channel='{channel}'):
...     ...

screenshot

tqdm_slack Objects#

[view source]

class tqdm_slack(tqdm_auto)

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

  • create a Slack app with the chat:write scope & invite it to a channel: https://api.slack.com/authentication/basics
  • copy the bot {token} & {channel} and paste below
    >>> from tqdm.contrib.slack import tqdm, trange
    >>> for i in tqdm(iterable, token='{token}', channel='{channel}'):
    ...     ...
    

__init__#

[view source]

def __init__(*args, **kwargs)

Parameters

  • token: str, required. Slack token
    [default: ${TQDM_SLACK_TOKEN}].
  • channel: int, required. Slack channel
    [default: ${TQDM_SLACK_CHANNEL}].
  • mininterval: float, optional.
    Minimum of [default: 1.5] to avoid rate limit.

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

tsrange#

[view source]

def tsrange(*args, **kwargs)

Shortcut for tqdm.contrib.slack.tqdm(range(*args), **kwargs).