项目概述
A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!
项目地址
https://github.com/rsalmei/alive-progress
项目页面预览

关键指标
- Stars:6216
- 主要语言:Python
- License:MIT License
- 最近更新:2025-10-10T00:39:31Z
- 默认分支:main
本站高速下载(国内可用)
点击下载(本站镜像)
– SHA256:682d434e5ad967869fd2288fdccc57f575baa0d4762cc3cf810a1fd6e641e1bc
安装部署要点(README 精选)
Configuration
There are several options to customize both appearance and behavior!
All of them can be set both directly in the alive_bar or globally in the config_handler!
These are the options – default values in brackets:
title: an optional, always visible bar titlelength: [40] the number of cols to render the animated progress barmax_cols: [80] the maximum cols to use if not possible to fetch it, like in jupyterspinner: the spinner style to be rendered next to the bar
↳ accepts a predefined spinner name, a custom spinner factory, or Nonebar: the bar style to be rendered in known modes
↳ accepts a predefined bar name, a custom bar factory, or Noneunknown: the bar style to be rendered in the unknown mode
↳ accepts a predefined spinner name, or a custom spinner factory (cannot be None)theme: ['smooth'] a set of matching spinner, bar, and unknown
↳ accepts a predefined theme nameforce_tty: [None] forces animations to be on, off, or according to the tty (more details here)
↳ None -> auto select, according to the terminal/Jupyter
↳ True -> unconditionally enables animations, but still auto-detects Jupyter Notebooks
↳ False -> unconditionally disables animations, keeping only the final receiptfile: [sys.stdout] the file object to use:sys.stdout,sys.stderr, or a similarTextIOWrapperdisable: [False] if True, completely disables all output, do not install hooksmanual: [False] set to manually control the bar positionenrich_print: [True] enriches print() and logging messages with the bar positionenrich_offset: [0] the offset to apply to enrich_printreceipt: [True] prints the nice final receipt, disables if Falsereceipt_text: [False] set to repeat the last text message in the final receiptmonitor(bool|str): [True] configures the monitor widget152/200 [76%]
↳ send a string with{count},{total}and{percent}to customize itelapsed(bool|str): [True] configures the elapsed time widgetin 12s
↳ send a string with{elapsed}to customize itstats(bool|str): [True] configures the stats widget(123.4/s, eta: 12s)
↳ send a string with{rate}and{eta}to customize itmonitor_end(bool|str): [True] configures the monitor widget within final receipt
↳ same as monitor, the default format is dynamic, it inheritsmonitor‘s oneelapsed_end(bool|str): [True] configures the elapsed time widget within final receipt
↳ same as elapsed, the default format is dynamic, it inheritselapsed‘s onestats_end(bool|str): [True] configures the stats widget within final receipt
↳ send a string with{rate}to customize it (no relation to stats)title_length: [0] fixes the length of titles, or 0 for unlimited
↳ title will be truncated if longer, and a cool ellipsis “…” will appear at the endspinner_length: [0] forces the spinner length, or0for its natural onerefresh_secs: [0] forces the refresh period to this,0is the reactive visual feedbackctrl_c: [True] if False, disables CTRL+C (captures it)dual_line: [False] if True, places the text below the barunit: any text that labels your entitiesscale: the scaling to apply to units:None,SI,IEC, orSI2
↳ supports aliases:Falseor''->None,True->SI,10or'10'->SI,2or'2'->IECprecision: [1] how many decimals do display when scaling
And there’s also one that can only be set locally in the alive_bar context:
calibrate: maximum theoretical throughput to calibrate the animation speed (more details here)
To set them locally, just send them as keyword arguments to alive_bar:
with alive_bar(total, title='Processing', length=20, bar='halloween') as bar:
...
To use them globally, send them to config_handler, and any alive_bar created after that will include those options! And you can mix and match them, local options always have precedence over global ones:
from alive_progress import config_handler
config_handler.set_global(length=20, spinner='wait')
with alive_bar(total, bar='blocks', spinner='twirls') as bar:
# the length is 20, the bar is 'blocks' and the spinner is 'twirls'.
...
常用命令(从 README 提取)
on 7: fail "H", retry later
on 10: fail "K", retry later
Alphabet |███████████████████████████▊ | ▃▅▇ 18/26 [69%] in 6s (3.2/s, eta: 3s)
-> Teaching the letter: S, please wait...
Download |██████████████████⚠︎ | (!) 45/100 [45%] in 4.8s (9.43/s)
Download 0 |████████▊⚠︎ | (!) 22/100 [22%] in 0.6s (36.40/s)
Download 1 |████████████████▊⚠︎ | (!) 42/100 [42%] in 1.0s (41.43/s)
Download 2 |██████▍⚠︎ | (!) 16/100 [16%] in 0.4s (39.29/s)
Download 3 |█████▋⚠︎ | (!) 14/100 [14%] in 0.4s (33.68/s)
Download 4 |█████████████▎⚠︎ | (!) 33/100 [33%] in 0.8s (39.48/s)
Download 5 |███████▎⚠︎ | (!) 18/100 [18%] in 0.5s (37.69/s)
Download 6 |█████▎⚠︎ | (!) 13/100 [13%] in 0.3s (37.28/s)
Download 7 |████████████⚠︎ | (!) 30/100 [30%] in 0.8s (38.43/s)
Download 8 |██████⚠︎ | (!) 15/100 [15%] in 0.4s (36.26/s)
...
通用部署说明
- 下载源码并阅读 README
- 安装依赖(pip/npm/yarn 等)
- 配置环境变量(API Key、模型路径、数据库等)
- 启动服务并测试访问
- 上线建议:Nginx 反代 + HTTPS + 进程守护(systemd / pm2)
免责声明与版权说明
本文仅做开源项目整理与教程索引,源码版权归原作者所有,请遵循对应 License 合规使用。








暂无评论内容