summaryrefslogtreecommitdiffhomepage
path: root/libs/tqdm/contrib/bells.py
diff options
context:
space:
mode:
Diffstat (limited to 'libs/tqdm/contrib/bells.py')
-rw-r--r--libs/tqdm/contrib/bells.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/libs/tqdm/contrib/bells.py b/libs/tqdm/contrib/bells.py
new file mode 100644
index 000000000..be2276884
--- /dev/null
+++ b/libs/tqdm/contrib/bells.py
@@ -0,0 +1,24 @@
+"""
+Even more features than `tqdm.auto` (all the bells & whistles):
+
+- `tqdm.auto`
+- `tqdm.tqdm.pandas`
+- `tqdm.contrib.telegram`
+ + uses `${TQDM_TELEGRAM_TOKEN}` and `${TQDM_TELEGRAM_CHAT_ID}`
+- `tqdm.contrib.discord`
+ + uses `${TQDM_DISCORD_TOKEN}` and `${TQDM_DISCORD_CHANNEL_ID}`
+"""
+__all__ = ['tqdm', 'trange']
+import warnings
+from os import getenv
+
+if getenv("TQDM_TELEGRAM_TOKEN") and getenv("TQDM_TELEGRAM_CHAT_ID"):
+ from .telegram import tqdm, trange
+elif getenv("TQDM_DISCORD_TOKEN") and getenv("TQDM_DISCORD_CHANNEL_ID"):
+ from .discord import tqdm, trange
+else:
+ from ..auto import tqdm, trange
+
+with warnings.catch_warnings():
+ warnings.simplefilter("ignore", category=FutureWarning)
+ tqdm.pandas()