Amar-Aly commited on
Commit
61b6d03
·
verified ·
1 Parent(s): 6299998

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .cache/pip/http-v2/0/0/e/c/f/00ecff9acd52a20e396217085e31e0ceb29ea4ddf87c72de0df5e74c +0 -0
  2. .cache/pip/http-v2/0/3/b/7/e/03b7e31ef41a67b4d5d0212d71d27b02703ce649d01a9d3a622a0976 +0 -0
  3. .cache/pip/http-v2/0/3/b/7/e/03b7e31ef41a67b4d5d0212d71d27b02703ce649d01a9d3a622a0976.body +0 -0
  4. .cache/pip/http-v2/0/4/4/7/c/0447ce2249fdae0f8cf52a43e01f215eacdf7c35d89a248bd4b4ebaa +0 -0
  5. .cache/pip/http-v2/0/4/4/7/c/0447ce2249fdae0f8cf52a43e01f215eacdf7c35d89a248bd4b4ebaa.body +0 -0
  6. .cache/pip/http-v2/0/c/1/9/0/0c1902a50947e5344575b4ef11e0b41b63cc4e3e15eb945e6b0cd91d +0 -0
  7. .cache/pip/http-v2/0/c/1/9/0/0c1902a50947e5344575b4ef11e0b41b63cc4e3e15eb945e6b0cd91d.body +0 -0
  8. .cache/pip/http-v2/1/8/e/c/b/18ecb372789efe49bbe46617b1f5d32a2b0eac245d58cbf930116174 +0 -0
  9. .cache/pip/http-v2/4/4/a/d/5/44ad51ab4fe732177892254938ca19df59a19add805fe17b3b22c658 +0 -0
  10. .cache/pip/http-v2/4/4/a/d/5/44ad51ab4fe732177892254938ca19df59a19add805fe17b3b22c658.body +1595 -0
  11. .cache/pip/http-v2/4/a/5/b/6/4a5b6f0d76201de4cfd4884f5e95617a1848cf81c8357be4d12cbf6a.body +86 -0
  12. .cache/pip/http-v2/5/9/1/a/0/591a0a7ea47d81cffb332bf5e1460e560ce743822558c6f345314d4b +0 -0
  13. .cache/pip/http-v2/5/9/1/a/0/591a0a7ea47d81cffb332bf5e1460e560ce743822558c6f345314d4b.body +0 -0
  14. .cache/pip/http-v2/5/b/4/0/d/5b40d68cf8d927e2221e1237399fe71c3f05e873a098ccc481be149a +0 -0
  15. .cache/pip/http-v2/5/b/4/0/d/5b40d68cf8d927e2221e1237399fe71c3f05e873a098ccc481be149a.body +324 -0
  16. .cache/pip/http-v2/6/4/c/f/c/64cfc03e83f9fad4049b1d2a1d785c9273270a4ab9788b538f5054e3 +0 -0
  17. .cache/pip/http-v2/6/5/1/e/5/651e58859e8db8c99b9e7068d03984cfd4577518ff0e021c717afbf4 +0 -0
  18. .cache/pip/http-v2/6/5/1/e/5/651e58859e8db8c99b9e7068d03984cfd4577518ff0e021c717afbf4.body +78 -0
  19. .cache/pip/http-v2/6/6/e/c/7/66ec76a7b6ed4081044f5c7821af293b63c17bc2ac523ff93d5ca7d5 +0 -0
  20. .cache/pip/http-v2/6/8/0/d/4/680d4dd80dc6a3d2df9b9478dfcc8e81e0e4f130e154a3268b98b877 +0 -0
  21. .cache/pip/http-v2/6/b/5/3/a/6b53a9dd0e4fce887cc28c1a921aa1befe8c1a82e6c213d2542d2acb +0 -0
  22. .cache/pip/http-v2/6/b/5/3/a/6b53a9dd0e4fce887cc28c1a921aa1befe8c1a82e6c213d2542d2acb.body +0 -0
  23. .cache/pip/http-v2/6/b/8/1/e/6b81e7b491d69713c085c9f59d6c9162e9c07ca91d4f2bb5b3cd4b8e +0 -0
  24. .cache/pip/http-v2/6/b/8/1/e/6b81e7b491d69713c085c9f59d6c9162e9c07ca91d4f2bb5b3cd4b8e.body +386 -0
  25. .cache/pip/http-v2/6/c/6/e/e/6c6eeaf6757edbde690577822daacaba826c2b12ce67b57b33e8021d +0 -0
  26. .cache/pip/http-v2/6/c/6/e/e/6c6eeaf6757edbde690577822daacaba826c2b12ce67b57b33e8021d.body +0 -0
  27. .cache/pip/http-v2/6/d/c/b/9/6dcb9049adda15167eed5255a1c411f3de346af4a65c68fd19243d5b +0 -0
  28. .cache/pip/http-v2/6/f/d/e/3/6fde3f0933387b9783cde9fa65fa4e62f7c3b0bf23557229e3f300bf +0 -0
  29. .cache/pip/http-v2/7/2/8/a/2/728a2f33f382f4dacf08f6df77aad6f3d889f819ba4fa3efad5ec7e4 +0 -0
  30. .cache/pip/http-v2/7/7/3/7/4/77374f6555d766d1d452fe4918fb303c49f49a5a37a0986ea4f1b212 +0 -0
  31. .cache/pip/http-v2/7/7/3/7/4/77374f6555d766d1d452fe4918fb303c49f49a5a37a0986ea4f1b212.body +139 -0
  32. .cache/pip/http-v2/7/7/3/b/e/773be4e62f2a7f9be9d2b777b9be56e14e2b6c9666994e8793db52fd +0 -0
  33. .cache/pip/http-v2/7/9/2/1/a/7921ac3318a5cdb592026cc26a94f7a2c1e1f7d3a1dc1e3857fd49f1 +0 -0
  34. .cache/pip/http-v2/7/9/2/1/a/7921ac3318a5cdb592026cc26a94f7a2c1e1f7d3a1dc1e3857fd49f1.body +0 -0
  35. .cache/pip/http-v2/7/b/3/0/7/7b3075adb708114992fb27c6511ef6dfacffdcb852b8e8d037a10c4b +0 -0
  36. .cache/pip/http-v2/8/1/8/8/f/8188f9db6169e57bb653240cc02c629488d0d899420b0725db0f7e4a +0 -0
  37. .cache/pip/http-v2/8/6/1/4/a/8614a6e8a4ad9aa5595a607eb8f7a0d8a8f7a7a34cff9540f443a21f +0 -0
  38. .cache/pip/http-v2/8/6/1/4/a/8614a6e8a4ad9aa5595a607eb8f7a0d8a8f7a7a34cff9540f443a21f.body +0 -0
  39. .cache/pip/http-v2/8/6/e/d/b/86edbe0c05b42c1fe86aacc3cb9eaf8cb8a43c81ec1ba8b34d47241c +0 -0
  40. .cache/pip/http-v2/8/7/9/c/c/879cc1cef8100ac59eeacde5d2539913601d5266658faccb02a20a6f +0 -0
  41. .cache/pip/http-v2/8/a/c/4/d/8ac4d14dc45e27d21da49fb515570b6f875b78707de9b08ce1088d1b +0 -0
  42. .cache/pip/http-v2/8/a/c/4/d/8ac4d14dc45e27d21da49fb515570b6f875b78707de9b08ce1088d1b.body +0 -0
  43. .cache/pip/http-v2/8/d/8/7/b/8d87bf7a308bb8a91752d9c7e9e4d96db27c3fd3d01d3bb4e2dd8afc +0 -0
  44. .cache/pip/http-v2/8/d/8/7/b/8d87bf7a308bb8a91752d9c7e9e4d96db27c3fd3d01d3bb4e2dd8afc.body +0 -0
  45. .cache/pip/http-v2/8/f/0/a/d/8f0ad583652318494c12da41e4d30ff6225ec73d448a0754a0a7e898 +0 -0
  46. .cache/pip/http-v2/b/0/c/3/0/b0c304a2d0d2dd17cd2e818948220da223f52dfe26c6e170a35508ec +0 -0
  47. .cache/pip/http-v2/b/0/c/3/0/b0c304a2d0d2dd17cd2e818948220da223f52dfe26c6e170a35508ec.body +32 -0
  48. .cache/pip/http-v2/b/1/f/5/d/b1f5dc01896eee598e8915be35e61304ad2b16363d00711f8576642c +0 -0
  49. .cache/pip/http-v2/b/3/6/c/0/b36c03663a3f9be503a38ab3381e55a1c5e2392e9271c976f5e2b956 +0 -0
  50. .cache/pip/http-v2/b/3/6/c/0/b36c03663a3f9be503a38ab3381e55a1c5e2392e9271c976f5e2b956.body +479 -0
.cache/pip/http-v2/0/0/e/c/f/00ecff9acd52a20e396217085e31e0ceb29ea4ddf87c72de0df5e74c ADDED
Binary file (1.13 kB). View file
 
.cache/pip/http-v2/0/3/b/7/e/03b7e31ef41a67b4d5d0212d71d27b02703ce649d01a9d3a622a0976 ADDED
Binary file (1.12 kB). View file
 
.cache/pip/http-v2/0/3/b/7/e/03b7e31ef41a67b4d5d0212d71d27b02703ce649d01a9d3a622a0976.body ADDED
Binary file (9.76 kB). View file
 
.cache/pip/http-v2/0/4/4/7/c/0447ce2249fdae0f8cf52a43e01f215eacdf7c35d89a248bd4b4ebaa ADDED
Binary file (1.87 kB). View file
 
.cache/pip/http-v2/0/4/4/7/c/0447ce2249fdae0f8cf52a43e01f215eacdf7c35d89a248bd4b4ebaa.body ADDED
Binary file (20.8 kB). View file
 
.cache/pip/http-v2/0/c/1/9/0/0c1902a50947e5344575b4ef11e0b41b63cc4e3e15eb945e6b0cd91d ADDED
Binary file (1.86 kB). View file
 
.cache/pip/http-v2/0/c/1/9/0/0c1902a50947e5344575b4ef11e0b41b63cc4e3e15eb945e6b0cd91d.body ADDED
Binary file (1.46 kB). View file
 
.cache/pip/http-v2/1/8/e/c/b/18ecb372789efe49bbe46617b1f5d32a2b0eac245d58cbf930116174 ADDED
Binary file (1.16 kB). View file
 
.cache/pip/http-v2/4/4/a/d/5/44ad51ab4fe732177892254938ca19df59a19add805fe17b3b22c658 ADDED
Binary file (1.2 kB). View file
 
.cache/pip/http-v2/4/4/a/d/5/44ad51ab4fe732177892254938ca19df59a19add805fe17b3b22c658.body ADDED
@@ -0,0 +1,1595 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: tqdm
3
+ Version: 4.67.3
4
+ Summary: Fast, Extensible Progress Meter
5
+ Maintainer-email: tqdm developers <devs@tqdm.ml>
6
+ License: MPL-2.0 AND MIT
7
+ Project-URL: homepage, https://tqdm.github.io
8
+ Project-URL: repository, https://github.com/tqdm/tqdm
9
+ Project-URL: changelog, https://tqdm.github.io/releases
10
+ Project-URL: wiki, https://github.com/tqdm/tqdm/wiki
11
+ Keywords: progressbar,progressmeter,progress,bar,meter,rate,eta,console,terminal,time
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Environment :: Console
14
+ Classifier: Environment :: MacOS X
15
+ Classifier: Environment :: Other Environment
16
+ Classifier: Environment :: Win32 (MS Windows)
17
+ Classifier: Environment :: X11 Applications
18
+ Classifier: Framework :: IPython
19
+ Classifier: Framework :: Jupyter
20
+ Classifier: Intended Audience :: Developers
21
+ Classifier: Intended Audience :: Education
22
+ Classifier: Intended Audience :: End Users/Desktop
23
+ Classifier: Intended Audience :: Other Audience
24
+ Classifier: Intended Audience :: System Administrators
25
+ Classifier: Operating System :: MacOS
26
+ Classifier: Operating System :: MacOS :: MacOS X
27
+ Classifier: Operating System :: Microsoft
28
+ Classifier: Operating System :: Microsoft :: MS-DOS
29
+ Classifier: Operating System :: Microsoft :: Windows
30
+ Classifier: Operating System :: POSIX
31
+ Classifier: Operating System :: POSIX :: BSD
32
+ Classifier: Operating System :: POSIX :: BSD :: FreeBSD
33
+ Classifier: Operating System :: POSIX :: Linux
34
+ Classifier: Operating System :: POSIX :: SunOS/Solaris
35
+ Classifier: Operating System :: Unix
36
+ Classifier: Programming Language :: Python
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.7
39
+ Classifier: Programming Language :: Python :: 3.8
40
+ Classifier: Programming Language :: Python :: 3.9
41
+ Classifier: Programming Language :: Python :: 3.10
42
+ Classifier: Programming Language :: Python :: 3.11
43
+ Classifier: Programming Language :: Python :: 3.12
44
+ Classifier: Programming Language :: Python :: 3.13
45
+ Classifier: Programming Language :: Python :: 3 :: Only
46
+ Classifier: Programming Language :: Python :: Implementation
47
+ Classifier: Programming Language :: Python :: Implementation :: IronPython
48
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
49
+ Classifier: Programming Language :: Unix Shell
50
+ Classifier: Topic :: Desktop Environment
51
+ Classifier: Topic :: Education :: Computer Aided Instruction (CAI)
52
+ Classifier: Topic :: Education :: Testing
53
+ Classifier: Topic :: Office/Business
54
+ Classifier: Topic :: Other/Nonlisted Topic
55
+ Classifier: Topic :: Software Development :: Build Tools
56
+ Classifier: Topic :: Software Development :: Libraries
57
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
58
+ Classifier: Topic :: Software Development :: Pre-processors
59
+ Classifier: Topic :: Software Development :: User Interfaces
60
+ Classifier: Topic :: System :: Installation/Setup
61
+ Classifier: Topic :: System :: Logging
62
+ Classifier: Topic :: System :: Monitoring
63
+ Classifier: Topic :: System :: Shells
64
+ Classifier: Topic :: Terminals
65
+ Classifier: Topic :: Utilities
66
+ Requires-Python: >=3.7
67
+ Description-Content-Type: text/x-rst
68
+ License-File: LICENCE
69
+ Requires-Dist: colorama; platform_system == "Windows"
70
+ Requires-Dist: importlib_metadata; python_version < "3.8"
71
+ Provides-Extra: dev
72
+ Requires-Dist: pytest>=6; extra == "dev"
73
+ Requires-Dist: pytest-cov; extra == "dev"
74
+ Requires-Dist: pytest-timeout; extra == "dev"
75
+ Requires-Dist: pytest-asyncio>=0.24; extra == "dev"
76
+ Requires-Dist: nbval; extra == "dev"
77
+ Provides-Extra: discord
78
+ Requires-Dist: requests; extra == "discord"
79
+ Provides-Extra: slack
80
+ Requires-Dist: slack-sdk; extra == "slack"
81
+ Provides-Extra: telegram
82
+ Requires-Dist: requests; extra == "telegram"
83
+ Provides-Extra: notebook
84
+ Requires-Dist: ipywidgets>=6; extra == "notebook"
85
+ Dynamic: license-file
86
+
87
+ |Logo|
88
+
89
+ tqdm
90
+ ====
91
+
92
+ |Py-Versions| |Versions| |Conda-Forge-Status| |Docker| |Snapcraft|
93
+
94
+ |Build-Status| |Coverage-Status| |Branch-Coverage-Status| |Codacy-Grade| |Libraries-Rank| |PyPI-Downloads|
95
+
96
+ |LICENCE| |OpenHub-Status| |binder-demo| |awesome-python|
97
+
98
+ ``tqdm`` derives from the Arabic word *taqaddum* (تقدّم) which can mean "progress,"
99
+ and is an abbreviation for "I love you so much" in Spanish (*te quiero demasiado*).
100
+
101
+ Instantly make your loops show a smart progress meter - just wrap any
102
+ iterable with ``tqdm(iterable)``, and you're done!
103
+
104
+ .. code:: python
105
+
106
+ from tqdm import tqdm
107
+ for i in tqdm(range(10000)):
108
+ ...
109
+
110
+ ``76%|████████████████████████        | 7568/10000 [00:33<00:10, 229.00it/s]``
111
+
112
+ ``trange(N)`` can be also used as a convenient shortcut for
113
+ ``tqdm(range(N))``.
114
+
115
+ |Screenshot|
116
+ |Video| |Slides| |Merch|
117
+
118
+ It can also be executed as a module with pipes:
119
+
120
+ .. code:: sh
121
+
122
+ $ seq 9999999 | tqdm --bytes | wc -l
123
+ 75.2MB [00:00, 217MB/s]
124
+ 9999999
125
+
126
+ $ tar -zcf - docs/ | tqdm --bytes --total `du -sb docs/ | cut -f1` \
127
+ > backup.tgz
128
+ 32%|██████████▍ | 8.89G/27.9G [00:42<01:31, 223MB/s]
129
+
130
+ Overhead is low -- about 60ns per iteration (80ns with ``tqdm.gui``), and is
131
+ unit tested against performance regression.
132
+ By comparison, the well-established
133
+ `ProgressBar <https://github.com/niltonvolpato/python-progressbar>`__ has
134
+ an 800ns/iter overhead.
135
+
136
+ In addition to its low overhead, ``tqdm`` uses smart algorithms to predict
137
+ the remaining time and to skip unnecessary iteration displays, which allows
138
+ for a negligible overhead in most cases.
139
+
140
+ ``tqdm`` works on any platform
141
+ (Linux, Windows, Mac, FreeBSD, NetBSD, Solaris/SunOS),
142
+ in any console or in a GUI, and is also friendly with IPython/Jupyter notebooks.
143
+
144
+ ``tqdm`` does not require any dependencies (not even ``curses``!), just
145
+ Python and an environment supporting ``carriage return \r`` and
146
+ ``line feed \n`` control characters.
147
+
148
+ ------------------------------------------
149
+
150
+ .. contents:: Table of contents
151
+ :backlinks: top
152
+ :local:
153
+
154
+
155
+ Installation
156
+ ------------
157
+
158
+ Latest PyPI stable release
159
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
160
+
161
+ |Versions| |PyPI-Downloads| |Libraries-Dependents|
162
+
163
+ .. code:: sh
164
+
165
+ pip install tqdm
166
+
167
+ Latest development release on GitHub
168
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
169
+
170
+ |GitHub-Status| |GitHub-Stars| |GitHub-Commits| |GitHub-Forks| |GitHub-Updated|
171
+
172
+ Pull and install pre-release ``devel`` branch:
173
+
174
+ .. code:: sh
175
+
176
+ pip install "git+https://github.com/tqdm/tqdm.git@devel#egg=tqdm"
177
+
178
+ Latest Conda release
179
+ ~~~~~~~~~~~~~~~~~~~~
180
+
181
+ |Conda-Forge-Status|
182
+
183
+ .. code:: sh
184
+
185
+ conda install -c conda-forge tqdm
186
+
187
+ Latest Snapcraft release
188
+ ~~~~~~~~~~~~~~~~~~~~~~~~
189
+
190
+ |Snapcraft|
191
+
192
+ There are 3 channels to choose from:
193
+
194
+ .. code:: sh
195
+
196
+ snap install tqdm # implies --stable, i.e. latest tagged release
197
+ snap install tqdm --candidate # master branch
198
+ snap install tqdm --edge # devel branch
199
+
200
+ Note that ``snap`` binaries are purely for CLI use (not ``import``-able), and
201
+ automatically set up ``bash`` tab-completion.
202
+
203
+ Latest Docker release
204
+ ~~~~~~~~~~~~~~~~~~~~~
205
+
206
+ |Docker|
207
+
208
+ .. code:: sh
209
+
210
+ docker pull tqdm/tqdm
211
+ docker run -i --rm tqdm/tqdm --help
212
+
213
+ Other
214
+ ~~~~~
215
+
216
+ There are other (unofficial) places where ``tqdm`` may be downloaded, particularly for CLI use:
217
+
218
+ |Repology|
219
+
220
+ .. |Repology| image:: https://repology.org/badge/tiny-repos/python:tqdm.svg
221
+ :target: https://repology.org/project/python:tqdm/versions
222
+
223
+ Changelog
224
+ ---------
225
+
226
+ The list of all changes is available either on GitHub's Releases:
227
+ |GitHub-Status|, on the
228
+ `wiki <https://github.com/tqdm/tqdm/wiki/Releases>`__, or on the
229
+ `website <https://tqdm.github.io/releases>`__.
230
+
231
+
232
+ Usage
233
+ -----
234
+
235
+ ``tqdm`` is very versatile and can be used in a number of ways.
236
+ The three main ones are given below.
237
+
238
+ Iterable-based
239
+ ~~~~~~~~~~~~~~
240
+
241
+ Wrap ``tqdm()`` around any iterable:
242
+
243
+ .. code:: python
244
+
245
+ from tqdm import tqdm
246
+ from time import sleep
247
+
248
+ text = ""
249
+ for char in tqdm(["a", "b", "c", "d"]):
250
+ sleep(0.25)
251
+ text = text + char
252
+
253
+ ``trange(i)`` is a special optimised instance of ``tqdm(range(i))``:
254
+
255
+ .. code:: python
256
+
257
+ from tqdm import trange
258
+
259
+ for i in trange(100):
260
+ sleep(0.01)
261
+
262
+ Instantiation outside of the loop allows for manual control over ``tqdm()``:
263
+
264
+ .. code:: python
265
+
266
+ pbar = tqdm(["a", "b", "c", "d"])
267
+ for char in pbar:
268
+ sleep(0.25)
269
+ pbar.set_description("Processing %s" % char)
270
+
271
+ Manual
272
+ ~~~~~~
273
+
274
+ Manual control of ``tqdm()`` updates using a ``with`` statement:
275
+
276
+ .. code:: python
277
+
278
+ with tqdm(total=100) as pbar:
279
+ for i in range(10):
280
+ sleep(0.1)
281
+ pbar.update(10)
282
+
283
+ If the optional variable ``total`` (or an iterable with ``len()``) is
284
+ provided, predictive stats are displayed.
285
+
286
+ ``with`` is also optional (you can just assign ``tqdm()`` to a variable,
287
+ but in this case don't forget to ``del`` or ``close()`` at the end:
288
+
289
+ .. code:: python
290
+
291
+ pbar = tqdm(total=100)
292
+ for i in range(10):
293
+ sleep(0.1)
294
+ pbar.update(10)
295
+ pbar.close()
296
+
297
+ Module
298
+ ~~~~~~
299
+
300
+ Perhaps the most wonderful use of ``tqdm`` is in a script or on the command
301
+ line. Simply inserting ``tqdm`` (or ``python -m tqdm``) between pipes will pass
302
+ through all ``stdin`` to ``stdout`` while printing progress to ``stderr``.
303
+
304
+ The example below demonstrate counting the number of lines in all Python files
305
+ in the current directory, with timing information included.
306
+
307
+ .. code:: sh
308
+
309
+ $ time find . -name '*.py' -type f -exec cat \{} \; | wc -l
310
+ 857365
311
+
312
+ real 0m3.458s
313
+ user 0m0.274s
314
+ sys 0m3.325s
315
+
316
+ $ time find . -name '*.py' -type f -exec cat \{} \; | tqdm | wc -l
317
+ 857366it [00:03, 246471.31it/s]
318
+ 857365
319
+
320
+ real 0m3.585s
321
+ user 0m0.862s
322
+ sys 0m3.358s
323
+
324
+ Note that the usual arguments for ``tqdm`` can also be specified.
325
+
326
+ .. code:: sh
327
+
328
+ $ find . -name '*.py' -type f -exec cat \{} \; |
329
+ tqdm --unit loc --unit_scale --total 857366 >> /dev/null
330
+ 100%|█████████████████████████████████| 857K/857K [00:04<00:00, 246Kloc/s]
331
+
332
+ Backing up a large directory?
333
+
334
+ .. code:: sh
335
+
336
+ $ tar -zcf - docs/ | tqdm --bytes --total `du -sb docs/ | cut -f1` \
337
+ > backup.tgz
338
+ 44%|██████████████▊ | 153M/352M [00:14<00:18, 11.0MB/s]
339
+
340
+ This can be beautified further:
341
+
342
+ .. code:: sh
343
+
344
+ $ BYTES=$(du -sb docs/ | cut -f1)
345
+ $ tar -cf - docs/ \
346
+ | tqdm --bytes --total "$BYTES" --desc Processing | gzip \
347
+ | tqdm --bytes --total "$BYTES" --desc Compressed --position 1 \
348
+ > ~/backup.tgz
349
+ Processing: 100%|██████████████████████| 352M/352M [00:14<00:00, 30.2MB/s]
350
+ Compressed: 42%|█████████▎ | 148M/352M [00:14<00:19, 10.9MB/s]
351
+
352
+ Or done on a file level using 7-zip:
353
+
354
+ .. code:: sh
355
+
356
+ $ 7z a -bd -r backup.7z docs/ | grep Compressing \
357
+ | tqdm --total $(find docs/ -type f | wc -l) --unit files \
358
+ | grep -v Compressing
359
+ 100%|██████████████████████████▉| 15327/15327 [01:00<00:00, 712.96files/s]
360
+
361
+ Pre-existing CLI programs already outputting basic progress information will
362
+ benefit from ``tqdm``'s ``--update`` and ``--update_to`` flags:
363
+
364
+ .. code:: sh
365
+
366
+ $ seq 3 0.1 5 | tqdm --total 5 --update_to --null
367
+ 100%|████████████████████████████████████| 5.0/5 [00:00<00:00, 9673.21it/s]
368
+ $ seq 10 | tqdm --update --null # 1 + 2 + ... + 10 = 55 iterations
369
+ 55it [00:00, 90006.52it/s]
370
+
371
+ FAQ and Known Issues
372
+ --------------------
373
+
374
+ |GitHub-Issues|
375
+
376
+ The most common issues relate to excessive output on multiple lines, instead
377
+ of a neat one-line progress bar.
378
+
379
+ - Consoles in general: require support for carriage return (``CR``, ``\r``).
380
+
381
+ * Some cloud logging consoles which don't support ``\r`` properly
382
+ (`cloudwatch <https://github.com/tqdm/tqdm/issues/966>`__,
383
+ `K8s <https://github.com/tqdm/tqdm/issues/1319>`__) may benefit from
384
+ ``export TQDM_POSITION=-1``.
385
+
386
+ - Nested progress bars:
387
+
388
+ * Consoles in general: require support for moving cursors up to the
389
+ previous line. For example,
390
+ `IDLE <https://github.com/tqdm/tqdm/issues/191#issuecomment-230168030>`__,
391
+ `ConEmu <https://github.com/tqdm/tqdm/issues/254>`__ and
392
+ `PyCharm <https://github.com/tqdm/tqdm/issues/203>`__ (also
393
+ `here <https://github.com/tqdm/tqdm/issues/208>`__,
394
+ `here <https://github.com/tqdm/tqdm/issues/307>`__, and
395
+ `here <https://github.com/tqdm/tqdm/issues/454#issuecomment-335416815>`__)
396
+ lack full support.
397
+ * Windows: additionally may require the Python module ``colorama``
398
+ to ensure nested bars stay within their respective lines.
399
+
400
+ - Unicode:
401
+
402
+ * Environments which report that they support unicode will have solid smooth
403
+ progressbars. The fallback is an ``ascii``-only bar.
404
+ * Windows consoles often only partially support unicode and thus
405
+ `often require explicit ascii=True <https://github.com/tqdm/tqdm/issues/454#issuecomment-335416815>`__
406
+ (also `here <https://github.com/tqdm/tqdm/issues/499>`__). This is due to
407
+ either normal-width unicode characters being incorrectly displayed as
408
+ "wide", or some unicode characters not rendering.
409
+
410
+ - Wrapping generators:
411
+
412
+ * Generator wrapper functions tend to hide the length of iterables.
413
+ ``tqdm`` does not.
414
+ * Replace ``tqdm(enumerate(...))`` with ``enumerate(tqdm(...))`` or
415
+ ``tqdm(enumerate(x), total=len(x), ...)``.
416
+ The same applies to ``numpy.ndenumerate``.
417
+ * Replace ``tqdm(zip(a, b))`` with ``zip(tqdm(a), b)`` or even
418
+ ``zip(tqdm(a), tqdm(b))``.
419
+ * The same applies to ``itertools``.
420
+ * Some useful convenience functions can be found under ``tqdm.contrib``.
421
+
422
+ - `No intermediate output in docker-compose <https://github.com/tqdm/tqdm/issues/771>`__:
423
+ use ``docker-compose run`` instead of ``docker-compose up`` and ``tty: true``.
424
+
425
+ - Overriding defaults via environment variables:
426
+ e.g. in CI/cloud jobs, ``export TQDM_MININTERVAL=5`` to avoid log spam.
427
+ This override logic is handled by the ``tqdm.utils.envwrap`` decorator
428
+ (useful independent of ``tqdm``).
429
+
430
+ If you come across any other difficulties, browse and file |GitHub-Issues|.
431
+
432
+ Documentation
433
+ -------------
434
+
435
+ |Py-Versions| |README-Hits| (Since 19 May 2016)
436
+
437
+ .. code:: python
438
+
439
+ class tqdm():
440
+ """
441
+ Decorate an iterable object, returning an iterator which acts exactly
442
+ like the original iterable, but prints a dynamically updating
443
+ progressbar every time a value is requested.
444
+ """
445
+
446
+ @envwrap("TQDM_") # override defaults via env vars
447
+ def __init__(self, iterable=None, desc=None, total=None, leave=True,
448
+ file=None, ncols=None, mininterval=0.1,
449
+ maxinterval=10.0, miniters=None, ascii=None, disable=False,
450
+ unit='it', unit_scale=False, dynamic_ncols=False,
451
+ smoothing=0.3, bar_format=None, initial=0, position=None,
452
+ postfix=None, unit_divisor=1000, write_bytes=False,
453
+ lock_args=None, nrows=None, colour=None, delay=0):
454
+
455
+ Parameters
456
+ ~~~~~~~~~~
457
+
458
+ * iterable : iterable, optional
459
+ Iterable to decorate with a progressbar.
460
+ Leave blank to manually manage the updates.
461
+ * desc : str, optional
462
+ Prefix for the progressbar.
463
+ * total : int or float, optional
464
+ The number of expected iterations. If unspecified,
465
+ len(iterable) is used if possible. If float("inf") or as a last
466
+ resort, only basic progress statistics are displayed
467
+ (no ETA, no progressbar).
468
+ If ``gui`` is True and this parameter needs subsequent updating,
469
+ specify an initial arbitrary large positive number,
470
+ e.g. 9e9.
471
+ * leave : bool, optional
472
+ If [default: True], keeps all traces of the progressbar
473
+ upon termination of iteration.
474
+ If ``None``, will leave only if ``position`` is ``0``.
475
+ * file : ``io.TextIOWrapper`` or ``io.StringIO``, optional
476
+ Specifies where to output the progress messages
477
+ (default: sys.stderr). Uses ``file.write(str)`` and ``file.flush()``
478
+ methods. For encoding, see ``write_bytes``.
479
+ * ncols : int, optional
480
+ The width of the entire output message. If specified,
481
+ dynamically resizes the progressbar to stay within this bound.
482
+ If unspecified, attempts to use environment width. The
483
+ fallback is a meter width of 10 and no limit for the counter and
484
+ statistics. If 0, will not print any meter (only stats).
485
+ * mininterval : float, optional
486
+ Minimum progress display update interval [default: 0.1] seconds.
487
+ * maxinterval : float, optional
488
+ Maximum progress display update interval [default: 10] seconds.
489
+ Automatically adjusts ``miniters`` to correspond to ``mininterval``
490
+ after long display update lag. Only works if ``dynamic_miniters``
491
+ or monitor thread is enabled.
492
+ * miniters : int or float, optional
493
+ Minimum progress display update interval, in iterations.
494
+ If 0 and ``dynamic_miniters``, will automatically adjust to equal
495
+ ``mininterval`` (more CPU efficient, good for tight loops).
496
+ If > 0, will skip display of specified number of iterations.
497
+ Tweak this and ``mininterval`` to get very efficient loops.
498
+ If your progress is erratic with both fast and slow iterations
499
+ (network, skipping items, etc) you should set miniters=1.
500
+ * ascii : bool or str, optional
501
+ If unspecified or False, use unicode (smooth blocks) to fill
502
+ the meter. The fallback is to use ASCII characters " 123456789#".
503
+ * disable : bool, optional
504
+ Whether to disable the entire progressbar wrapper
505
+ [default: False]. If set to None, disable on non-TTY.
506
+ * unit : str, optional
507
+ String that will be used to define the unit of each iteration
508
+ [default: it].
509
+ * unit_scale : bool or int or float, optional
510
+ If 1 or True, the number of iterations will be reduced/scaled
511
+ automatically and a metric prefix following the
512
+ International System of Units standard will be added
513
+ (kilo, mega, etc.) [default: False]. If any other non-zero
514
+ number, will scale ``total`` and ``n``.
515
+ * dynamic_ncols : bool, optional
516
+ If set, constantly alters ``ncols`` and ``nrows`` to the
517
+ environment (allowing for window resizes) [default: False].
518
+ * smoothing : float, optional
519
+ Exponential moving average smoothing factor for speed estimates
520
+ (ignored in GUI mode). Ranges from 0 (average speed) to 1
521
+ (current/instantaneous speed) [default: 0.3].
522
+ * bar_format : str, optional
523
+ Specify a custom bar string formatting. May impact performance.
524
+ [default: '{l_bar}{bar}{r_bar}'], where
525
+ l_bar='{desc}: {percentage:3.0f}%|' and
526
+ r_bar='| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, '
527
+ '{rate_fmt}{postfix}]'
528
+ Possible vars: l_bar, bar, r_bar, n, n_fmt, total, total_fmt,
529
+ percentage, elapsed, elapsed_s, ncols, nrows, desc, unit,
530
+ rate, rate_fmt, rate_noinv, rate_noinv_fmt,
531
+ rate_inv, rate_inv_fmt, postfix, unit_divisor,
532
+ remaining, remaining_s, eta.
533
+ Note that a trailing ": " is automatically removed after {desc}
534
+ if the latter is empty.
535
+ * initial : int or float, optional
536
+ The initial counter value. Useful when restarting a progress
537
+ bar [default: 0]. If using float, consider specifying ``{n:.3f}``
538
+ or similar in ``bar_format``, or specifying ``unit_scale``.
539
+ * position : int, optional
540
+ Specify the line offset to print this bar (starting from 0)
541
+ Automatic if unspecified.
542
+ Useful to manage multiple bars at once (eg, from threads).
543
+ * postfix : dict or ``*``, optional
544
+ Specify additional stats to display at the end of the bar.
545
+ Calls ``set_postfix(**postfix)`` if possible (dict).
546
+ * unit_divisor : float, optional
547
+ [default: 1000], ignored unless ``unit_scale`` is True.
548
+ * write_bytes : bool, optional
549
+ Whether to write bytes. If (default: False) will write unicode.
550
+ * lock_args : tuple, optional
551
+ Passed to ``refresh`` for intermediate output
552
+ (initialisation, iterating, and updating).
553
+ * nrows : int, optional
554
+ The screen height. If specified, hides nested bars outside this
555
+ bound. If unspecified, attempts to use environment height.
556
+ The fallback is 20.
557
+ * colour : str, optional
558
+ Bar colour (e.g. 'green', '#00ff00').
559
+ * delay : float, optional
560
+ Don't display until [default: 0] seconds have elapsed.
561
+
562
+ Extra CLI Options
563
+ ~~~~~~~~~~~~~~~~~
564
+
565
+ * delim : chr, optional
566
+ Delimiting character [default: '\n']. Use '\0' for null.
567
+ N.B.: on Windows systems, Python converts '\n' to '\r\n'.
568
+ * buf_size : int, optional
569
+ String buffer size in bytes [default: 256]
570
+ used when ``delim`` is specified.
571
+ * bytes : bool, optional
572
+ If true, will count bytes, ignore ``delim``, and default
573
+ ``unit_scale`` to True, ``unit_divisor`` to 1024, and ``unit`` to 'B'.
574
+ * tee : bool, optional
575
+ If true, passes ``stdin`` to both ``stderr`` and ``stdout``.
576
+ * update : bool, optional
577
+ If true, will treat input as newly elapsed iterations,
578
+ i.e. numbers to pass to ``update()``. Note that this is slow
579
+ (~2e5 it/s) since every input must be decoded as a number.
580
+ * update_to : bool, optional
581
+ If true, will treat input as total elapsed iterations,
582
+ i.e. numbers to assign to ``self.n``. Note that this is slow
583
+ (~2e5 it/s) since every input must be decoded as a number.
584
+ * null : bool, optional
585
+ If true, will discard input (no stdout).
586
+ * manpath : str, optional
587
+ Directory in which to install tqdm man pages.
588
+ * comppath : str, optional
589
+ Directory in which to place tqdm completion.
590
+ * log : str, optional
591
+ CRITICAL|FATAL|ERROR|WARN(ING)|[default: 'INFO']|DEBUG|NOTSET.
592
+
593
+ Returns
594
+ ~~~~~~~
595
+
596
+ * out : decorated iterator.
597
+
598
+ .. code:: python
599
+
600
+ class tqdm():
601
+ def update(self, n=1):
602
+ """
603
+ Manually update the progress bar, useful for streams
604
+ such as reading files.
605
+ E.g.:
606
+ >>> t = tqdm(total=filesize) # Initialise
607
+ >>> for current_buffer in stream:
608
+ ... ...
609
+ ... t.update(len(current_buffer))
610
+ >>> t.close()
611
+ The last line is highly recommended, but possibly not necessary if
612
+ ``t.update()`` will be called in such a way that ``filesize`` will be
613
+ exactly reached and printed.
614
+
615
+ Parameters
616
+ ----------
617
+ n : int or float, optional
618
+ Increment to add to the internal counter of iterations
619
+ [default: 1]. If using float, consider specifying ``{n:.3f}``
620
+ or similar in ``bar_format``, or specifying ``unit_scale``.
621
+
622
+ Returns
623
+ -------
624
+ out : bool or None
625
+ True if a ``display()`` was triggered.
626
+ """
627
+
628
+ def close(self):
629
+ """Cleanup and (if leave=False) close the progressbar."""
630
+
631
+ def clear(self, nomove=False):
632
+ """Clear current bar display."""
633
+
634
+ def refresh(self):
635
+ """
636
+ Force refresh the display of this bar.
637
+
638
+ Parameters
639
+ ----------
640
+ nolock : bool, optional
641
+ If ``True``, does not lock.
642
+ If [default: ``False``]: calls ``acquire()`` on internal lock.
643
+ lock_args : tuple, optional
644
+ Passed to internal lock's ``acquire()``.
645
+ If specified, will only ``display()`` if ``acquire()`` returns ``True``.
646
+ """
647
+
648
+ def unpause(self):
649
+ """Restart tqdm timer from last print time."""
650
+
651
+ def reset(self, total=None):
652
+ """
653
+ Resets to 0 iterations for repeated use.
654
+
655
+ Consider combining with ``leave=True``.
656
+
657
+ Parameters
658
+ ----------
659
+ total : int or float, optional. Total to use for the new bar.
660
+ """
661
+
662
+ def set_description(self, desc=None, refresh=True):
663
+ """
664
+ Set/modify description of the progress bar.
665
+
666
+ Parameters
667
+ ----------
668
+ desc : str, optional
669
+ refresh : bool, optional
670
+ Forces refresh [default: True].
671
+ """
672
+
673
+ def set_postfix(self, ordered_dict=None, refresh=True, **tqdm_kwargs):
674
+ """
675
+ Set/modify postfix (additional stats)
676
+ with automatic formatting based on datatype.
677
+
678
+ Parameters
679
+ ----------
680
+ ordered_dict : dict or OrderedDict, optional
681
+ refresh : bool, optional
682
+ Forces refresh [default: True].
683
+ kwargs : dict, optional
684
+ """
685
+
686
+ @classmethod
687
+ def write(cls, s, file=sys.stdout, end="\n"):
688
+ """Print a message via tqdm (without overlap with bars)."""
689
+
690
+ @property
691
+ def format_dict(self):
692
+ """Public API for read-only member access."""
693
+
694
+ def display(self, msg=None, pos=None):
695
+ """
696
+ Use ``self.sp`` to display ``msg`` in the specified ``pos``.
697
+
698
+ Consider overloading this function when inheriting to use e.g.:
699
+ ``self.some_frontend(**self.format_dict)`` instead of ``self.sp``.
700
+
701
+ Parameters
702
+ ----------
703
+ msg : str, optional. What to display (default: ``repr(self)``).
704
+ pos : int, optional. Position to ``moveto``
705
+ (default: ``abs(self.pos)``).
706
+ """
707
+
708
+ @classmethod
709
+ @contextmanager
710
+ def wrapattr(cls, stream, method, total=None, bytes=True, **tqdm_kwargs):
711
+ """
712
+ stream : file-like object.
713
+ method : str, "read" or "write". The result of ``read()`` and
714
+ the first argument of ``write()`` should have a ``len()``.
715
+
716
+ >>> with tqdm.wrapattr(file_obj, "read", total=file_obj.size) as fobj:
717
+ ... while True:
718
+ ... chunk = fobj.read(chunk_size)
719
+ ... if not chunk:
720
+ ... break
721
+ """
722
+
723
+ @classmethod
724
+ def pandas(cls, *targs, **tqdm_kwargs):
725
+ """Registers the current `tqdm` class with `pandas`."""
726
+
727
+ def trange(*args, **tqdm_kwargs):
728
+ """Shortcut for `tqdm(range(*args), **tqdm_kwargs)`."""
729
+
730
+ Convenience Functions
731
+ ~~~~~~~~~~~~~~~~~~~~~
732
+
733
+ .. code:: python
734
+
735
+ def tqdm.contrib.tenumerate(iterable, start=0, total=None,
736
+ tqdm_class=tqdm.auto.tqdm, **tqdm_kwargs):
737
+ """Equivalent of `numpy.ndenumerate` or builtin `enumerate`."""
738
+
739
+ def tqdm.contrib.tzip(iter1, *iter2plus, **tqdm_kwargs):
740
+ """Equivalent of builtin `zip`."""
741
+
742
+ def tqdm.contrib.tmap(function, *sequences, **tqdm_kwargs):
743
+ """Equivalent of builtin `map`."""
744
+
745
+ Submodules
746
+ ~~~~~~~~~~
747
+
748
+ .. code:: python
749
+
750
+ class tqdm.notebook.tqdm(tqdm.tqdm):
751
+ """IPython/Jupyter Notebook widget."""
752
+
753
+ class tqdm.auto.tqdm(tqdm.tqdm):
754
+ """Automatically chooses beween `tqdm.notebook` and `tqdm.tqdm`."""
755
+
756
+ class tqdm.asyncio.tqdm(tqdm.tqdm):
757
+ """Asynchronous version."""
758
+ @classmethod
759
+ def as_completed(cls, fs, *, loop=None, timeout=None, total=None,
760
+ **tqdm_kwargs):
761
+ """Wrapper for `asyncio.as_completed`."""
762
+
763
+ class tqdm.gui.tqdm(tqdm.tqdm):
764
+ """Matplotlib GUI version."""
765
+
766
+ class tqdm.tk.tqdm(tqdm.tqdm):
767
+ """Tkinter GUI version."""
768
+
769
+ class tqdm.rich.tqdm(tqdm.tqdm):
770
+ """`rich.progress` version."""
771
+
772
+ class tqdm.keras.TqdmCallback(keras.callbacks.Callback):
773
+ """Keras callback for epoch and batch progress."""
774
+
775
+ class tqdm.dask.TqdmCallback(dask.callbacks.Callback):
776
+ """Dask callback for task progress."""
777
+
778
+
779
+ ``contrib``
780
+ +++++++++++
781
+
782
+ The ``tqdm.contrib`` package also contains experimental modules:
783
+
784
+ - ``tqdm.contrib.itertools``: Thin wrappers around ``itertools``
785
+ - ``tqdm.contrib.concurrent``: Thin wrappers around ``concurrent.futures``
786
+ - ``tqdm.contrib.slack``: Posts to `Slack <https://slack.com>`__ bots
787
+ - ``tqdm.contrib.discord``: Posts to `Discord <https://discord.com>`__ bots
788
+ - ``tqdm.contrib.telegram``: Posts to `Telegram <https://telegram.org>`__ bots
789
+ - ``tqdm.contrib.bells``: Automagically enables all optional features
790
+
791
+ * ``auto``, ``pandas``, ``slack``, ``discord``, ``telegram``
792
+
793
+ Examples and Advanced Usage
794
+ ---------------------------
795
+
796
+ - See the `examples <https://github.com/tqdm/tqdm/tree/master/examples>`__
797
+ folder;
798
+ - import the module and run ``help()``;
799
+ - consult the `wiki <https://github.com/tqdm/tqdm/wiki>`__;
800
+
801
+ * this has an
802
+ `excellent article <https://github.com/tqdm/tqdm/wiki/How-to-make-a-great-Progress-Bar>`__
803
+ on how to make a **great** progressbar;
804
+
805
+ - check out the `slides from PyData London <https://tqdm.github.io/PyData2019/slides.html>`__, or
806
+ - run the |binder-demo|.
807
+
808
+ Description and additional stats
809
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
810
+
811
+ Custom information can be displayed and updated dynamically on ``tqdm`` bars
812
+ with the ``desc`` and ``postfix`` arguments:
813
+
814
+ .. code:: python
815
+
816
+ from tqdm import tqdm, trange
817
+ from random import random, randint
818
+ from time import sleep
819
+
820
+ with trange(10) as t:
821
+ for i in t:
822
+ # Description will be displayed on the left
823
+ t.set_description('GEN %i' % i)
824
+ # Postfix will be displayed on the right,
825
+ # formatted automatically based on argument's datatype
826
+ t.set_postfix(loss=random(), gen=randint(1,999), str='h',
827
+ lst=[1, 2])
828
+ sleep(0.1)
829
+
830
+ with tqdm(total=10, bar_format="{postfix[0]} {postfix[1][value]:>8.2g}",
831
+ postfix=["Batch", {"value": 0}]) as t:
832
+ for i in range(10):
833
+ sleep(0.1)
834
+ t.postfix[1]["value"] = i / 2
835
+ t.update()
836
+
837
+ Points to remember when using ``{postfix[...]}`` in the ``bar_format`` string:
838
+
839
+ - ``postfix`` also needs to be passed as an initial argument in a compatible
840
+ format, and
841
+ - ``postfix`` will be auto-converted to a string if it is a ``dict``-like
842
+ object. To prevent this behaviour, insert an extra item into the dictionary
843
+ where the key is not a string.
844
+
845
+ Additional ``bar_format`` parameters may also be defined by overriding
846
+ ``format_dict``, and the bar itself may be modified using ``ascii``:
847
+
848
+ .. code:: python
849
+
850
+ from tqdm import tqdm
851
+ class TqdmExtraFormat(tqdm):
852
+ """Provides a `total_time` format parameter"""
853
+ @property
854
+ def format_dict(self):
855
+ d = super().format_dict
856
+ total_time = d["elapsed"] * (d["total"] or 0) / max(d["n"], 1)
857
+ d.update(total_time=self.format_interval(total_time) + " in total")
858
+ return d
859
+
860
+ for i in TqdmExtraFormat(
861
+ range(9), ascii=" .oO0",
862
+ bar_format="{total_time}: {percentage:.0f}%|{bar}{r_bar}"):
863
+ if i == 4:
864
+ break
865
+
866
+ .. code::
867
+
868
+ 00:00 in total: 44%|0000. | 4/9 [00:00<00:00, 962.93it/s]
869
+
870
+ Note that ``{bar}`` also supports a format specifier ``[width][type]``.
871
+
872
+ - ``width``
873
+
874
+ * unspecified (default): automatic to fill ``ncols``
875
+ * ``int >= 0``: fixed width overriding ``ncols`` logic
876
+ * ``int < 0``: subtract from the automatic default
877
+
878
+ - ``type``
879
+
880
+ * ``a``: ascii (``ascii=True`` override)
881
+ * ``u``: unicode (``ascii=False`` override)
882
+ * ``b``: blank (``ascii=" "`` override)
883
+
884
+ This means a fixed bar with right-justified text may be created by using:
885
+ ``bar_format="{l_bar}{bar:10}|{bar:-10b}right-justified"``
886
+
887
+ Nested progress bars
888
+ ~~~~~~~~~~~~~~~~~~~~
889
+
890
+ ``tqdm`` supports nested progress bars. Here's an example:
891
+
892
+ .. code:: python
893
+
894
+ from tqdm.auto import trange
895
+ from time import sleep
896
+
897
+ for i in trange(4, desc='1st loop'):
898
+ for j in trange(5, desc='2nd loop'):
899
+ for k in trange(50, desc='3rd loop', leave=False):
900
+ sleep(0.01)
901
+
902
+ For manual control over positioning (e.g. for multi-processing use),
903
+ you may specify ``position=n`` where ``n=0`` for the outermost bar,
904
+ ``n=1`` for the next, and so on.
905
+ However, it's best to check if ``tqdm`` can work without manual ``position``
906
+ first.
907
+
908
+ .. code:: python
909
+
910
+ from time import sleep
911
+ from tqdm import trange, tqdm
912
+ from multiprocessing import Pool, RLock, freeze_support
913
+
914
+ L = list(range(9))
915
+
916
+ def progresser(n):
917
+ interval = 0.001 / (n + 2)
918
+ total = 5000
919
+ text = f"#{n}, est. {interval * total:<04.2}s"
920
+ for _ in trange(total, desc=text, position=n):
921
+ sleep(interval)
922
+
923
+ if __name__ == '__main__':
924
+ freeze_support() # for Windows support
925
+ tqdm.set_lock(RLock()) # for managing output contention
926
+ p = Pool(initializer=tqdm.set_lock, initargs=(tqdm.get_lock(),))
927
+ p.map(progresser, L)
928
+
929
+ Note that in Python 3, ``tqdm.write`` is thread-safe:
930
+
931
+ .. code:: python
932
+
933
+ from time import sleep
934
+ from tqdm import tqdm, trange
935
+ from concurrent.futures import ThreadPoolExecutor
936
+
937
+ L = list(range(9))
938
+
939
+ def progresser(n):
940
+ interval = 0.001 / (n + 2)
941
+ total = 5000
942
+ text = f"#{n}, est. {interval * total:<04.2}s"
943
+ for _ in trange(total, desc=text):
944
+ sleep(interval)
945
+ if n == 6:
946
+ tqdm.write("n == 6 completed.")
947
+ tqdm.write("`tqdm.write()` is thread-safe in py3!")
948
+
949
+ if __name__ == '__main__':
950
+ with ThreadPoolExecutor() as p:
951
+ p.map(progresser, L)
952
+
953
+ Hooks and callbacks
954
+ ~~~~~~~~~~~~~~~~~~~
955
+
956
+ ``tqdm`` can easily support callbacks/hooks and manual updates.
957
+ Here's an example with ``urllib``:
958
+
959
+ **``urllib.urlretrieve`` documentation**
960
+
961
+ | [...]
962
+ | If present, the hook function will be called once
963
+ | on establishment of the network connection and once after each block read
964
+ | thereafter. The hook will be passed three arguments; a count of blocks
965
+ | transferred so far, a block size in bytes, and the total size of the file.
966
+ | [...]
967
+
968
+ .. code:: python
969
+
970
+ import urllib, os
971
+ from tqdm import tqdm
972
+ urllib = getattr(urllib, 'request', urllib)
973
+
974
+ class TqdmUpTo(tqdm):
975
+ """Provides `update_to(n)` which uses `tqdm.update(delta_n)`."""
976
+ def update_to(self, b=1, bsize=1, tsize=None):
977
+ """
978
+ b : int, optional
979
+ Number of blocks transferred so far [default: 1].
980
+ bsize : int, optional
981
+ Size of each block (in tqdm units) [default: 1].
982
+ tsize : int, optional
983
+ Total size (in tqdm units). If [default: None] remains unchanged.
984
+ """
985
+ if tsize is not None:
986
+ self.total = tsize
987
+ return self.update(b * bsize - self.n) # also sets self.n = b * bsize
988
+
989
+ eg_link = "https://caspersci.uk.to/matryoshka.zip"
990
+ with TqdmUpTo(unit='B', unit_scale=True, unit_divisor=1024, miniters=1,
991
+ desc=eg_link.split('/')[-1]) as t: # all optional kwargs
992
+ urllib.urlretrieve(eg_link, filename=os.devnull,
993
+ reporthook=t.update_to, data=None)
994
+ t.total = t.n
995
+
996
+ Inspired by `twine#242 <https://github.com/pypa/twine/pull/242>`__.
997
+ Functional alternative in
998
+ `examples/tqdm_wget.py <https://github.com/tqdm/tqdm/blob/master/examples/tqdm_wget.py>`__.
999
+
1000
+ It is recommend to use ``miniters=1`` whenever there is potentially
1001
+ large differences in iteration speed (e.g. downloading a file over
1002
+ a patchy connection).
1003
+
1004
+ **Wrapping read/write methods**
1005
+
1006
+ To measure throughput through a file-like object's ``read`` or ``write``
1007
+ methods, use ``CallbackIOWrapper``:
1008
+
1009
+ .. code:: python
1010
+
1011
+ from tqdm.auto import tqdm
1012
+ from tqdm.utils import CallbackIOWrapper
1013
+
1014
+ with tqdm(total=file_obj.size,
1015
+ unit='B', unit_scale=True, unit_divisor=1024) as t:
1016
+ fobj = CallbackIOWrapper(t.update, file_obj, "read")
1017
+ while True:
1018
+ chunk = fobj.read(chunk_size)
1019
+ if not chunk:
1020
+ break
1021
+ t.reset()
1022
+ # ... continue to use `t` for something else
1023
+
1024
+ Alternatively, use the even simpler ``wrapattr`` convenience function,
1025
+ which would condense both the ``urllib`` and ``CallbackIOWrapper`` examples
1026
+ down to:
1027
+
1028
+ .. code:: python
1029
+
1030
+ import urllib, os
1031
+ from tqdm import tqdm
1032
+
1033
+ eg_link = "https://caspersci.uk.to/matryoshka.zip"
1034
+ response = getattr(urllib, 'request', urllib).urlopen(eg_link)
1035
+ with tqdm.wrapattr(open(os.devnull, "wb"), "write",
1036
+ miniters=1, desc=eg_link.split('/')[-1],
1037
+ total=getattr(response, 'length', None)) as fout:
1038
+ for chunk in response:
1039
+ fout.write(chunk)
1040
+
1041
+ The ``requests`` equivalent is nearly identical:
1042
+
1043
+ .. code:: python
1044
+
1045
+ import requests, os
1046
+ from tqdm import tqdm
1047
+
1048
+ eg_link = "https://caspersci.uk.to/matryoshka.zip"
1049
+ response = requests.get(eg_link, stream=True)
1050
+ with tqdm.wrapattr(open(os.devnull, "wb"), "write",
1051
+ miniters=1, desc=eg_link.split('/')[-1],
1052
+ total=int(response.headers.get('content-length', 0))) as fout:
1053
+ for chunk in response.iter_content(chunk_size=4096):
1054
+ fout.write(chunk)
1055
+
1056
+ **Custom callback**
1057
+
1058
+ ``tqdm`` is known for intelligently skipping unnecessary displays. To make a
1059
+ custom callback take advantage of this, simply use the return value of
1060
+ ``update()``. This is set to ``True`` if a ``display()`` was triggered.
1061
+
1062
+ .. code:: python
1063
+
1064
+ from tqdm.auto import tqdm as std_tqdm
1065
+
1066
+ def external_callback(*args, **kwargs):
1067
+ ...
1068
+
1069
+ class TqdmExt(std_tqdm):
1070
+ def update(self, n=1):
1071
+ displayed = super().update(n)
1072
+ if displayed:
1073
+ external_callback(**self.format_dict)
1074
+ return displayed
1075
+
1076
+ ``asyncio``
1077
+ ~~~~~~~~~~~
1078
+
1079
+ Note that ``break`` isn't currently caught by asynchronous iterators.
1080
+ This means that ``tqdm`` cannot clean up after itself in this case:
1081
+
1082
+ .. code:: python
1083
+
1084
+ from tqdm.asyncio import tqdm
1085
+
1086
+ async for i in tqdm(range(9)):
1087
+ if i == 2:
1088
+ break
1089
+
1090
+ Instead, either call ``pbar.close()`` manually or use the context manager syntax:
1091
+
1092
+ .. code:: python
1093
+
1094
+ from tqdm.asyncio import tqdm
1095
+
1096
+ with tqdm(range(9)) as pbar:
1097
+ async for i in pbar:
1098
+ if i == 2:
1099
+ break
1100
+
1101
+ Pandas Integration
1102
+ ~~~~~~~~~~~~~~~~~~
1103
+
1104
+ Due to popular demand we've added support for ``pandas`` -- here's an example
1105
+ for ``DataFrame.progress_apply`` and ``DataFrameGroupBy.progress_apply``:
1106
+
1107
+ .. code:: python
1108
+
1109
+ import pandas as pd
1110
+ import numpy as np
1111
+ from tqdm import tqdm
1112
+
1113
+ df = pd.DataFrame(np.random.randint(0, 100, (100000, 6)))
1114
+
1115
+ # Register `pandas.progress_apply` and `pandas.Series.map_apply` with `tqdm`
1116
+ # (can use `tqdm.gui.tqdm`, `tqdm.notebook.tqdm`, optional kwargs, etc.)
1117
+ tqdm.pandas(desc="my bar!")
1118
+
1119
+ # Now you can use `progress_apply` instead of `apply`
1120
+ # and `progress_map` instead of `map`
1121
+ df.progress_apply(lambda x: x**2)
1122
+ # can also groupby:
1123
+ # df.groupby(0).progress_apply(lambda x: x**2)
1124
+
1125
+ In case you're interested in how this works (and how to modify it for your
1126
+ own callbacks), see the
1127
+ `examples <https://github.com/tqdm/tqdm/tree/master/examples>`__
1128
+ folder or import the module and run ``help()``.
1129
+
1130
+ Keras Integration
1131
+ ~~~~~~~~~~~~~~~~~
1132
+
1133
+ A ``keras`` callback is also available:
1134
+
1135
+ .. code:: python
1136
+
1137
+ from tqdm.keras import TqdmCallback
1138
+
1139
+ ...
1140
+
1141
+ model.fit(..., verbose=0, callbacks=[TqdmCallback()])
1142
+
1143
+ Dask Integration
1144
+ ~~~~~~~~~~~~~~~~
1145
+
1146
+ A ``dask`` callback is also available:
1147
+
1148
+ .. code:: python
1149
+
1150
+ from tqdm.dask import TqdmCallback
1151
+
1152
+ with TqdmCallback(desc="compute"):
1153
+ ...
1154
+ arr.compute()
1155
+
1156
+ # or use callback globally
1157
+ cb = TqdmCallback(desc="global")
1158
+ cb.register()
1159
+ arr.compute()
1160
+
1161
+ IPython/Jupyter Integration
1162
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1163
+
1164
+ IPython/Jupyter is supported via the ``tqdm.notebook`` submodule:
1165
+
1166
+ .. code:: python
1167
+
1168
+ from tqdm.notebook import trange, tqdm
1169
+ from time import sleep
1170
+
1171
+ for i in trange(3, desc='1st loop'):
1172
+ for j in tqdm(range(100), desc='2nd loop'):
1173
+ sleep(0.01)
1174
+
1175
+ In addition to ``tqdm`` features, the submodule provides a native Jupyter
1176
+ widget (compatible with IPython v1-v4 and Jupyter), fully working nested bars
1177
+ and colour hints (blue: normal, green: completed, red: error/interrupt,
1178
+ light blue: no ETA); as demonstrated below.
1179
+
1180
+ |Screenshot-Jupyter1|
1181
+ |Screenshot-Jupyter2|
1182
+ |Screenshot-Jupyter3|
1183
+
1184
+ The ``notebook`` version supports percentage or pixels for overall width
1185
+ (e.g.: ``ncols='100%'`` or ``ncols='480px'``).
1186
+
1187
+ It is also possible to let ``tqdm`` automatically choose between
1188
+ console or notebook versions by using the ``autonotebook`` submodule:
1189
+
1190
+ .. code:: python
1191
+
1192
+ from tqdm.autonotebook import tqdm
1193
+ tqdm.pandas()
1194
+
1195
+ Note that this will issue a ``TqdmExperimentalWarning`` if run in a notebook
1196
+ since it is not meant to be possible to distinguish between ``jupyter notebook``
1197
+ and ``jupyter console``. Use ``auto`` instead of ``autonotebook`` to suppress
1198
+ this warning.
1199
+
1200
+ Note that notebooks will display the bar in the cell where it was created.
1201
+ This may be a different cell from the one where it is used.
1202
+ If this is not desired, either
1203
+
1204
+ - delay the creation of the bar to the cell where it must be displayed, or
1205
+ - create the bar with ``display=False``, and in a later cell call
1206
+ ``display(bar.container)``:
1207
+
1208
+ .. code:: python
1209
+
1210
+ from tqdm.notebook import tqdm
1211
+ pbar = tqdm(..., display=False)
1212
+
1213
+ .. code:: python
1214
+
1215
+ # different cell
1216
+ display(pbar.container)
1217
+
1218
+ The ``keras`` callback has a ``display()`` method which can be used likewise:
1219
+
1220
+ .. code:: python
1221
+
1222
+ from tqdm.keras import TqdmCallback
1223
+ cbk = TqdmCallback(display=False)
1224
+
1225
+ .. code:: python
1226
+
1227
+ # different cell
1228
+ cbk.display()
1229
+ model.fit(..., verbose=0, callbacks=[cbk])
1230
+
1231
+ Another possibility is to have a single bar (near the top of the notebook)
1232
+ which is constantly re-used (using ``reset()`` rather than ``close()``).
1233
+ For this reason, the notebook version (unlike the CLI version) does not
1234
+ automatically call ``close()`` upon ``Exception``.
1235
+
1236
+ .. code:: python
1237
+
1238
+ from tqdm.notebook import tqdm
1239
+ pbar = tqdm()
1240
+
1241
+ .. code:: python
1242
+
1243
+ # different cell
1244
+ iterable = range(100)
1245
+ pbar.reset(total=len(iterable)) # initialise with new `total`
1246
+ for i in iterable:
1247
+ pbar.update()
1248
+ pbar.refresh() # force print final status but don't `close()`
1249
+
1250
+ Custom Integration
1251
+ ~~~~~~~~~~~~~~~~~~
1252
+
1253
+ To change the default arguments (such as making ``dynamic_ncols=True``),
1254
+ simply use built-in Python magic:
1255
+
1256
+ .. code:: python
1257
+
1258
+ from functools import partial
1259
+ from tqdm import tqdm as std_tqdm
1260
+ tqdm = partial(std_tqdm, dynamic_ncols=True)
1261
+
1262
+ For further customisation,
1263
+ ``tqdm`` may be inherited from to create custom callbacks (as with the
1264
+ ``TqdmUpTo`` example `above <#hooks-and-callbacks>`__) or for custom frontends
1265
+ (e.g. GUIs such as notebook or plotting packages). In the latter case:
1266
+
1267
+ 1. ``def __init__()`` to call ``super().__init__(..., gui=True)`` to disable
1268
+ terminal ``status_printer`` creation.
1269
+ 2. Redefine: ``close()``, ``clear()``, ``display()``.
1270
+
1271
+ Consider overloading ``display()`` to use e.g.
1272
+ ``self.frontend(**self.format_dict)`` instead of ``self.sp(repr(self))``.
1273
+
1274
+ Some submodule examples of inheritance:
1275
+
1276
+ - `tqdm/notebook.py <https://github.com/tqdm/tqdm/blob/master/tqdm/notebook.py>`__
1277
+ - `tqdm/gui.py <https://github.com/tqdm/tqdm/blob/master/tqdm/gui.py>`__
1278
+ - `tqdm/tk.py <https://github.com/tqdm/tqdm/blob/master/tqdm/tk.py>`__
1279
+ - `tqdm/contrib/slack.py <https://github.com/tqdm/tqdm/blob/master/tqdm/contrib/slack.py>`__
1280
+ - `tqdm/contrib/discord.py <https://github.com/tqdm/tqdm/blob/master/tqdm/contrib/discord.py>`__
1281
+ - `tqdm/contrib/telegram.py <https://github.com/tqdm/tqdm/blob/master/tqdm/contrib/telegram.py>`__
1282
+
1283
+ Dynamic Monitor/Meter
1284
+ ~~~~~~~~~~~~~~~~~~~~~
1285
+
1286
+ You can use a ``tqdm`` as a meter which is not monotonically increasing.
1287
+ This could be because ``n`` decreases (e.g. a CPU usage monitor) or ``total``
1288
+ changes.
1289
+
1290
+ One example would be recursively searching for files. The ``total`` is the
1291
+ number of objects found so far, while ``n`` is the number of those objects which
1292
+ are files (rather than folders):
1293
+
1294
+ .. code:: python
1295
+
1296
+ from tqdm import tqdm
1297
+ import os.path
1298
+
1299
+ def find_files_recursively(path, show_progress=True):
1300
+ files = []
1301
+ # total=1 assumes `path` is a file
1302
+ t = tqdm(total=1, unit="file", disable=not show_progress)
1303
+ if not os.path.exists(path):
1304
+ raise IOError("Cannot find:" + path)
1305
+
1306
+ def append_found_file(f):
1307
+ files.append(f)
1308
+ t.update()
1309
+
1310
+ def list_found_dir(path):
1311
+ """returns os.listdir(path) assuming os.path.isdir(path)"""
1312
+ listing = os.listdir(path)
1313
+ # subtract 1 since a "file" we found was actually this directory
1314
+ t.total += len(listing) - 1
1315
+ # fancy way to give info without forcing a refresh
1316
+ t.set_postfix(dir=path[-10:], refresh=False)
1317
+ t.update(0) # may trigger a refresh
1318
+ return listing
1319
+
1320
+ def recursively_search(path):
1321
+ if os.path.isdir(path):
1322
+ for f in list_found_dir(path):
1323
+ recursively_search(os.path.join(path, f))
1324
+ else:
1325
+ append_found_file(path)
1326
+
1327
+ recursively_search(path)
1328
+ t.set_postfix(dir=path)
1329
+ t.close()
1330
+ return files
1331
+
1332
+ Using ``update(0)`` is a handy way to let ``tqdm`` decide when to trigger a
1333
+ display refresh to avoid console spamming.
1334
+
1335
+ Writing messages
1336
+ ~~~~~~~~~~~~~~~~
1337
+
1338
+ This is a work in progress (see
1339
+ `#737 <https://github.com/tqdm/tqdm/issues/737>`__).
1340
+
1341
+ Since ``tqdm`` uses a simple printing mechanism to display progress bars,
1342
+ you should not write any message in the terminal using ``print()`` while
1343
+ a progressbar is open.
1344
+
1345
+ To write messages in the terminal without any collision with ``tqdm`` bar
1346
+ display, a ``.write()`` method is provided:
1347
+
1348
+ .. code:: python
1349
+
1350
+ from tqdm.auto import tqdm, trange
1351
+ from time import sleep
1352
+
1353
+ bar = trange(10)
1354
+ for i in bar:
1355
+ # Print using tqdm class method .write()
1356
+ sleep(0.1)
1357
+ if not (i % 3):
1358
+ tqdm.write("Done task %i" % i)
1359
+ # Can also use bar.write()
1360
+
1361
+ By default, this will print to standard output ``sys.stdout``. but you can
1362
+ specify any file-like object using the ``file`` argument. For example, this
1363
+ can be used to redirect the messages writing to a log file or class.
1364
+
1365
+ Redirecting writing
1366
+ ~~~~~~~~~~~~~~~~~~~
1367
+
1368
+ If using a library that can print messages to the console, editing the library
1369
+ by replacing ``print()`` with ``tqdm.write()`` may not be desirable.
1370
+ In that case, redirecting ``sys.stdout`` to ``tqdm.write()`` is an option.
1371
+
1372
+ To redirect ``sys.stdout``, create a file-like class that will write
1373
+ any input string to ``tqdm.write()``, and supply the arguments
1374
+ ``file=sys.stdout, dynamic_ncols=True``.
1375
+
1376
+ A reusable canonical example is given below:
1377
+
1378
+ .. code:: python
1379
+
1380
+ from time import sleep
1381
+ import contextlib
1382
+ import sys
1383
+ from tqdm import tqdm
1384
+ from tqdm.contrib import DummyTqdmFile
1385
+
1386
+
1387
+ @contextlib.contextmanager
1388
+ def std_out_err_redirect_tqdm():
1389
+ orig_out_err = sys.stdout, sys.stderr
1390
+ try:
1391
+ sys.stdout, sys.stderr = map(DummyTqdmFile, orig_out_err)
1392
+ yield orig_out_err[0]
1393
+ # Relay exceptions
1394
+ except Exception as exc:
1395
+ raise exc
1396
+ # Always restore sys.stdout/err if necessary
1397
+ finally:
1398
+ sys.stdout, sys.stderr = orig_out_err
1399
+
1400
+ def some_fun(i):
1401
+ print("Fee, fi, fo,".split()[i])
1402
+
1403
+ # Redirect stdout to tqdm.write() (don't forget the `as save_stdout`)
1404
+ with std_out_err_redirect_tqdm() as orig_stdout:
1405
+ # tqdm needs the original stdout
1406
+ # and dynamic_ncols=True to autodetect console width
1407
+ for i in tqdm(range(3), file=orig_stdout, dynamic_ncols=True):
1408
+ sleep(.5)
1409
+ some_fun(i)
1410
+
1411
+ # After the `with`, printing is restored
1412
+ print("Done!")
1413
+
1414
+ Redirecting ``logging``
1415
+ ~~~~~~~~~~~~~~~~~~~~~~~
1416
+
1417
+ Similar to ``sys.stdout``/``sys.stderr`` as detailed above, console ``logging``
1418
+ may also be redirected to ``tqdm.write()``.
1419
+
1420
+ Warning: if also redirecting ``sys.stdout``/``sys.stderr``, make sure to
1421
+ redirect ``logging`` first if needed.
1422
+
1423
+ Helper methods are available in ``tqdm.contrib.logging``. For example:
1424
+
1425
+ .. code:: python
1426
+
1427
+ import logging
1428
+ from tqdm import trange
1429
+ from tqdm.contrib.logging import logging_redirect_tqdm
1430
+
1431
+ LOG = logging.getLogger(__name__)
1432
+
1433
+ if __name__ == '__main__':
1434
+ logging.basicConfig(level=logging.INFO)
1435
+ with logging_redirect_tqdm():
1436
+ for i in trange(9):
1437
+ if i == 4:
1438
+ LOG.info("console logging redirected to `tqdm.write()`")
1439
+ # logging restored
1440
+
1441
+ Monitoring thread, intervals and miniters
1442
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1443
+
1444
+ ``tqdm`` implements a few tricks to increase efficiency and reduce overhead.
1445
+
1446
+ - Avoid unnecessary frequent bar refreshing: ``mininterval`` defines how long
1447
+ to wait between each refresh. ``tqdm`` always gets updated in the background,
1448
+ but it will display only every ``mininterval``.
1449
+ - Reduce number of calls to check system clock/time.
1450
+ - ``mininterval`` is more intuitive to configure than ``miniters``.
1451
+ A clever adjustment system ``dynamic_miniters`` will automatically adjust
1452
+ ``miniters`` to the amount of iterations that fit into time ``mininterval``.
1453
+ Essentially, ``tqdm`` will check if it's time to print without actually
1454
+ checking time. This behaviour can be still be bypassed by manually setting
1455
+ ``miniters``.
1456
+
1457
+ However, consider a case with a combination of fast and slow iterations.
1458
+ After a few fast iterations, ``dynamic_miniters`` will set ``miniters`` to a
1459
+ large number. When iteration rate subsequently slows, ``miniters`` will
1460
+ remain large and thus reduce display update frequency. To address this:
1461
+
1462
+ - ``maxinterval`` defines the maximum time between display refreshes.
1463
+ A concurrent monitoring thread checks for overdue updates and forces one
1464
+ where necessary.
1465
+
1466
+ The monitoring thread should not have a noticeable overhead, and guarantees
1467
+ updates at least every 10 seconds by default.
1468
+ This value can be directly changed by setting the ``monitor_interval`` of
1469
+ any ``tqdm`` instance (i.e. ``t = tqdm.tqdm(...); t.monitor_interval = 2``).
1470
+ The monitor thread may be disabled application-wide by setting
1471
+ ``tqdm.tqdm.monitor_interval = 0`` before instantiation of any ``tqdm`` bar.
1472
+
1473
+
1474
+ Merch
1475
+ -----
1476
+
1477
+ You can buy `tqdm branded merch <https://tqdm.github.io/merch>`__ now!
1478
+
1479
+ Contributions
1480
+ -------------
1481
+
1482
+ |GitHub-Commits| |GitHub-Issues| |GitHub-PRs| |OpenHub-Status| |GitHub-Contributions| |CII Best Practices|
1483
+
1484
+ All source code is hosted on `GitHub <https://github.com/tqdm/tqdm>`__.
1485
+ Contributions are welcome.
1486
+
1487
+ See the
1488
+ `CONTRIBUTING <https://github.com/tqdm/tqdm/blob/master/CONTRIBUTING.md>`__
1489
+ file for more information.
1490
+
1491
+ Developers who have made significant contributions, ranked by *SLoC*
1492
+ (surviving lines of code,
1493
+ `git fame <https://github.com/casperdcl/git-fame>`__ ``-wMC --excl '\.(png|gif|jpg)$'``),
1494
+ are:
1495
+
1496
+ ==================== ======================================================== ==== ================================
1497
+ Name ID SLoC Notes
1498
+ ==================== ======================================================== ==== ================================
1499
+ Casper da Costa-Luis `casperdcl <https://github.com/casperdcl>`__ ~80% primary maintainer |Gift-Casper|
1500
+ Stephen Larroque `lrq3000 <https://github.com/lrq3000>`__ ~9% team member
1501
+ Martin Zugnoni `martinzugnoni <https://github.com/martinzugnoni>`__ ~3%
1502
+ Daniel Ecer `de-code <https://github.com/de-code>`__ ~2%
1503
+ Richard Sheridan `richardsheridan <https://github.com/richardsheridan>`__ ~1%
1504
+ Guangshuo Chen `chengs <https://github.com/chengs>`__ ~1%
1505
+ Helio Machado `0x2b3bfa0 <https://github.com/0x2b3bfa0>`__ ~1%
1506
+ Kyle Altendorf `altendky <https://github.com/altendky>`__ <1%
1507
+ Noam Yorav-Raphael `noamraph <https://github.com/noamraph>`__ <1% original author
1508
+ Matthew Stevens `mjstevens777 <https://github.com/mjstevens777>`__ <1%
1509
+ Hadrien Mary `hadim <https://github.com/hadim>`__ <1% team member
1510
+ Mikhail Korobov `kmike <https://github.com/kmike>`__ <1% team member
1511
+ ==================== ======================================================== ==== ================================
1512
+
1513
+ Ports to Other Languages
1514
+ ~~~~~~~~~~~~~~~~~~~~~~~~
1515
+
1516
+ A list is available on
1517
+ `this wiki page <https://github.com/tqdm/tqdm/wiki/tqdm-ports>`__.
1518
+
1519
+
1520
+ LICENCE
1521
+ -------
1522
+
1523
+ Open Source (OSI approved): |LICENCE|
1524
+
1525
+ Citation information: |DOI|
1526
+
1527
+ |README-Hits| (Since 19 May 2016)
1528
+
1529
+ .. |Logo| image:: https://tqdm.github.io/img/logo.gif
1530
+ .. |Screenshot| image:: https://tqdm.github.io/img/tqdm.gif
1531
+ .. |Video| image:: https://tqdm.github.io/img/video.jpg
1532
+ :target: https://tqdm.github.io/video
1533
+ .. |Slides| image:: https://tqdm.github.io/img/slides.jpg
1534
+ :target: https://tqdm.github.io/PyData2019/slides.html
1535
+ .. |Merch| image:: https://tqdm.github.io/img/merch.jpg
1536
+ :target: https://tqdm.github.io/merch
1537
+ .. |Build-Status| image:: https://img.shields.io/github/actions/workflow/status/tqdm/tqdm/test.yml?branch=master&label=tqdm&logo=GitHub
1538
+ :target: https://github.com/tqdm/tqdm/actions/workflows/test.yml
1539
+ .. |Coverage-Status| image:: https://img.shields.io/coveralls/github/tqdm/tqdm/master?logo=coveralls
1540
+ :target: https://coveralls.io/github/tqdm/tqdm
1541
+ .. |Branch-Coverage-Status| image:: https://codecov.io/gh/tqdm/tqdm/branch/master/graph/badge.svg
1542
+ :target: https://codecov.io/gh/tqdm/tqdm
1543
+ .. |Codacy-Grade| image:: https://app.codacy.com/project/badge/Grade/3f965571598f44549c7818f29cdcf177
1544
+ :target: https://www.codacy.com/gh/tqdm/tqdm/dashboard
1545
+ .. |CII Best Practices| image:: https://bestpractices.coreinfrastructure.org/projects/3264/badge
1546
+ :target: https://bestpractices.coreinfrastructure.org/projects/3264
1547
+ .. |GitHub-Status| image:: https://img.shields.io/github/tag/tqdm/tqdm.svg?maxAge=86400&logo=github&logoColor=white
1548
+ :target: https://github.com/tqdm/tqdm/releases
1549
+ .. |GitHub-Forks| image:: https://img.shields.io/github/forks/tqdm/tqdm.svg?logo=github&logoColor=white
1550
+ :target: https://github.com/tqdm/tqdm/network
1551
+ .. |GitHub-Stars| image:: https://img.shields.io/github/stars/tqdm/tqdm.svg?logo=github&logoColor=white
1552
+ :target: https://github.com/tqdm/tqdm/stargazers
1553
+ .. |GitHub-Commits| image:: https://img.shields.io/github/commit-activity/y/tqdm/tqdm.svg?logo=git&logoColor=white
1554
+ :target: https://github.com/tqdm/tqdm/graphs/commit-activity
1555
+ .. |GitHub-Issues| image:: https://img.shields.io/github/issues-closed/tqdm/tqdm.svg?logo=github&logoColor=white
1556
+ :target: https://github.com/tqdm/tqdm/issues?q=
1557
+ .. |GitHub-PRs| image:: https://img.shields.io/github/issues-pr-closed/tqdm/tqdm.svg?logo=github&logoColor=white
1558
+ :target: https://github.com/tqdm/tqdm/pulls
1559
+ .. |GitHub-Contributions| image:: https://img.shields.io/github/contributors/tqdm/tqdm.svg?logo=github&logoColor=white
1560
+ :target: https://github.com/tqdm/tqdm/graphs/contributors
1561
+ .. |GitHub-Updated| image:: https://img.shields.io/github/last-commit/tqdm/tqdm/master.svg?logo=github&logoColor=white&label=pushed
1562
+ :target: https://github.com/tqdm/tqdm/pulse
1563
+ .. |Gift-Casper| image:: https://img.shields.io/badge/dynamic/json.svg?color=ff69b4&label=gifts%20received&prefix=%C2%A3&query=%24..sum&url=https%3A%2F%2Fcaspersci.uk.to%2Fgifts.json
1564
+ :target: https://cdcl.ml/sponsor
1565
+ .. |Versions| image:: https://img.shields.io/pypi/v/tqdm.svg
1566
+ :target: https://tqdm.github.io/releases
1567
+ .. |PyPI-Downloads| image:: https://img.shields.io/pypi/dm/tqdm.svg?label=pypi%20downloads&logo=PyPI&logoColor=white
1568
+ :target: https://pepy.tech/project/tqdm
1569
+ .. |Py-Versions| image:: https://img.shields.io/pypi/pyversions/tqdm.svg?logo=python&logoColor=white
1570
+ :target: https://pypi.org/project/tqdm
1571
+ .. |Conda-Forge-Status| image:: https://img.shields.io/conda/v/conda-forge/tqdm.svg?label=conda-forge&logo=conda-forge
1572
+ :target: https://anaconda.org/conda-forge/tqdm
1573
+ .. |Snapcraft| image:: https://img.shields.io/badge/snap-install-82BEA0.svg?logo=snapcraft
1574
+ :target: https://snapcraft.io/tqdm
1575
+ .. |Docker| image:: https://img.shields.io/badge/docker-pull-blue.svg?logo=docker&logoColor=white
1576
+ :target: https://hub.docker.com/r/tqdm/tqdm
1577
+ .. |Libraries-Rank| image:: https://img.shields.io/librariesio/sourcerank/pypi/tqdm.svg?logo=koding&logoColor=white
1578
+ :target: https://libraries.io/pypi/tqdm
1579
+ .. |Libraries-Dependents| image:: https://img.shields.io/librariesio/dependent-repos/pypi/tqdm.svg?logo=koding&logoColor=white
1580
+ :target: https://github.com/tqdm/tqdm/network/dependents
1581
+ .. |OpenHub-Status| image:: https://www.openhub.net/p/tqdm/widgets/project_thin_badge?format=gif
1582
+ :target: https://www.openhub.net/p/tqdm?ref=Thin+badge
1583
+ .. |awesome-python| image:: https://awesome.re/mentioned-badge.svg
1584
+ :target: https://github.com/vinta/awesome-python
1585
+ .. |LICENCE| image:: https://img.shields.io/pypi/l/tqdm.svg
1586
+ :target: https://raw.githubusercontent.com/tqdm/tqdm/master/LICENCE
1587
+ .. |DOI| image:: https://img.shields.io/badge/DOI-10.5281/zenodo.595120-blue.svg
1588
+ :target: https://doi.org/10.5281/zenodo.595120
1589
+ .. |binder-demo| image:: https://mybinder.org/badge_logo.svg
1590
+ :target: https://mybinder.org/v2/gh/tqdm/tqdm/master?filepath=DEMO.ipynb
1591
+ .. |Screenshot-Jupyter1| image:: https://tqdm.github.io/img/jupyter-1.gif
1592
+ .. |Screenshot-Jupyter2| image:: https://tqdm.github.io/img/jupyter-2.gif
1593
+ .. |Screenshot-Jupyter3| image:: https://tqdm.github.io/img/jupyter-3.gif
1594
+ .. |README-Hits| image:: https://cgi.cdcl.ml/hits?q=tqdm&style=social&r=https://github.com/tqdm/tqdm&l=https://tqdm.github.io/img/favicon.png&f=https://tqdm.github.io/img/logo.gif
1595
+ :target: https://cgi.cdcl.ml/hits?q=tqdm&a=plot&r=https://github.com/tqdm/tqdm&l=https://tqdm.github.io/img/favicon.png&f=https://tqdm.github.io/img/logo.gif&style=social
.cache/pip/http-v2/4/a/5/b/6/4a5b6f0d76201de4cfd4884f5e95617a1848cf81c8357be4d12cbf6a.body ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.1
2
+ Name: openpyxl
3
+ Version: 3.1.5
4
+ Summary: A Python library to read/write Excel 2010 xlsx/xlsm files
5
+ Home-page: https://openpyxl.readthedocs.io
6
+ Author: See AUTHORS
7
+ Author-email: charlie.clark@clark-consulting.eu
8
+ License: MIT
9
+ Project-URL: Documentation, https://openpyxl.readthedocs.io/en/stable/
10
+ Project-URL: Source, https://foss.heptapod.net/openpyxl/openpyxl
11
+ Project-URL: Tracker, https://foss.heptapod.net/openpyxl/openpyxl/-/issues
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Operating System :: MacOS :: MacOS X
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Operating System :: POSIX
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3.6
19
+ Classifier: Programming Language :: Python :: 3.7
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Requires-Python: >=3.8
25
+ License-File: LICENCE.rst
26
+ Requires-Dist: et-xmlfile
27
+
28
+ .. image:: https://coveralls.io/repos/bitbucket/openpyxl/openpyxl/badge.svg?branch=default
29
+ :target: https://coveralls.io/bitbucket/openpyxl/openpyxl?branch=default
30
+ :alt: coverage status
31
+
32
+ Introduction
33
+ ------------
34
+
35
+ openpyxl is a Python library to read/write Excel 2010 xlsx/xlsm/xltx/xltm files.
36
+
37
+ It was born from lack of existing library to read/write natively from Python
38
+ the Office Open XML format.
39
+
40
+ All kudos to the PHPExcel team as openpyxl was initially based on PHPExcel.
41
+
42
+
43
+ Security
44
+ --------
45
+
46
+ By default openpyxl does not guard against quadratic blowup or billion laughs
47
+ xml attacks. To guard against these attacks install defusedxml.
48
+
49
+ Mailing List
50
+ ------------
51
+
52
+ The user list can be found on http://groups.google.com/group/openpyxl-users
53
+
54
+
55
+ Sample code::
56
+
57
+ from openpyxl import Workbook
58
+ wb = Workbook()
59
+
60
+ # grab the active worksheet
61
+ ws = wb.active
62
+
63
+ # Data can be assigned directly to cells
64
+ ws['A1'] = 42
65
+
66
+ # Rows can also be appended
67
+ ws.append([1, 2, 3])
68
+
69
+ # Python types will automatically be converted
70
+ import datetime
71
+ ws['A2'] = datetime.datetime.now()
72
+
73
+ # Save the file
74
+ wb.save("sample.xlsx")
75
+
76
+
77
+ Documentation
78
+ -------------
79
+
80
+ The documentation is at: https://openpyxl.readthedocs.io
81
+
82
+ * installation methods
83
+ * code examples
84
+ * instructions for contributing
85
+
86
+ Release notes: https://openpyxl.readthedocs.io/en/stable/changes.html
.cache/pip/http-v2/5/9/1/a/0/591a0a7ea47d81cffb332bf5e1460e560ce743822558c6f345314d4b ADDED
Binary file (1.16 kB). View file
 
.cache/pip/http-v2/5/9/1/a/0/591a0a7ea47d81cffb332bf5e1460e560ce743822558c6f345314d4b.body ADDED
Binary file (18.1 kB). View file
 
.cache/pip/http-v2/5/b/4/0/d/5b40d68cf8d927e2221e1237399fe71c3f05e873a098ccc481be149a ADDED
Binary file (1.21 kB). View file
 
.cache/pip/http-v2/5/b/4/0/d/5b40d68cf8d927e2221e1237399fe71c3f05e873a098ccc481be149a.body ADDED
@@ -0,0 +1,324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: huggingface_hub
3
+ Version: 1.10.1
4
+ Summary: Client library to download and publish models, datasets and other repos on the huggingface.co hub
5
+ Home-page: https://github.com/huggingface/huggingface_hub
6
+ Author: Hugging Face, Inc.
7
+ Author-email: julien@huggingface.co
8
+ License: Apache-2.0
9
+ Keywords: model-hub machine-learning models natural-language-processing deep-learning pytorch pretrained-models
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Education
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Requires-Python: >=3.10.0
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: filelock>=3.10.0
27
+ Requires-Dist: fsspec>=2023.5.0
28
+ Requires-Dist: hf-xet<2.0.0,>=1.4.3; platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "arm64" or platform_machine == "aarch64"
29
+ Requires-Dist: httpx<1,>=0.23.0
30
+ Requires-Dist: packaging>=20.9
31
+ Requires-Dist: pyyaml>=5.1
32
+ Requires-Dist: tqdm>=4.42.1
33
+ Requires-Dist: typer
34
+ Requires-Dist: typing-extensions>=4.1.0
35
+ Provides-Extra: oauth
36
+ Requires-Dist: authlib>=1.3.2; extra == "oauth"
37
+ Requires-Dist: fastapi; extra == "oauth"
38
+ Requires-Dist: httpx; extra == "oauth"
39
+ Requires-Dist: itsdangerous; extra == "oauth"
40
+ Provides-Extra: torch
41
+ Requires-Dist: torch; extra == "torch"
42
+ Requires-Dist: safetensors[torch]; extra == "torch"
43
+ Provides-Extra: fastai
44
+ Requires-Dist: toml; extra == "fastai"
45
+ Requires-Dist: fastai>=2.4; extra == "fastai"
46
+ Requires-Dist: fastcore>=1.3.27; extra == "fastai"
47
+ Provides-Extra: hf-xet
48
+ Requires-Dist: hf-xet<2.0.0,>=1.4.3; extra == "hf-xet"
49
+ Provides-Extra: mcp
50
+ Requires-Dist: mcp>=1.8.0; extra == "mcp"
51
+ Provides-Extra: testing
52
+ Requires-Dist: authlib>=1.3.2; extra == "testing"
53
+ Requires-Dist: fastapi; extra == "testing"
54
+ Requires-Dist: httpx; extra == "testing"
55
+ Requires-Dist: itsdangerous; extra == "testing"
56
+ Requires-Dist: jedi; extra == "testing"
57
+ Requires-Dist: Jinja2; extra == "testing"
58
+ Requires-Dist: pytest>=8.4.2; extra == "testing"
59
+ Requires-Dist: pytest-cov; extra == "testing"
60
+ Requires-Dist: pytest-env; extra == "testing"
61
+ Requires-Dist: pytest-xdist; extra == "testing"
62
+ Requires-Dist: pytest-vcr; extra == "testing"
63
+ Requires-Dist: pytest-asyncio; extra == "testing"
64
+ Requires-Dist: pytest-rerunfailures<16.0; extra == "testing"
65
+ Requires-Dist: pytest-mock; extra == "testing"
66
+ Requires-Dist: urllib3<2.0; extra == "testing"
67
+ Requires-Dist: soundfile; extra == "testing"
68
+ Requires-Dist: Pillow; extra == "testing"
69
+ Requires-Dist: numpy; extra == "testing"
70
+ Requires-Dist: duckdb; extra == "testing"
71
+ Requires-Dist: fastapi; extra == "testing"
72
+ Provides-Extra: gradio
73
+ Requires-Dist: gradio>=5.0.0; extra == "gradio"
74
+ Requires-Dist: requests; extra == "gradio"
75
+ Provides-Extra: typing
76
+ Requires-Dist: typing-extensions>=4.8.0; extra == "typing"
77
+ Requires-Dist: types-PyYAML; extra == "typing"
78
+ Requires-Dist: types-simplejson; extra == "typing"
79
+ Requires-Dist: types-toml; extra == "typing"
80
+ Requires-Dist: types-tqdm; extra == "typing"
81
+ Requires-Dist: types-urllib3; extra == "typing"
82
+ Provides-Extra: quality
83
+ Requires-Dist: ruff>=0.9.0; extra == "quality"
84
+ Requires-Dist: mypy==1.15.0; extra == "quality"
85
+ Requires-Dist: libcst>=1.4.0; extra == "quality"
86
+ Requires-Dist: ty; extra == "quality"
87
+ Provides-Extra: all
88
+ Requires-Dist: authlib>=1.3.2; extra == "all"
89
+ Requires-Dist: fastapi; extra == "all"
90
+ Requires-Dist: httpx; extra == "all"
91
+ Requires-Dist: itsdangerous; extra == "all"
92
+ Requires-Dist: jedi; extra == "all"
93
+ Requires-Dist: Jinja2; extra == "all"
94
+ Requires-Dist: pytest>=8.4.2; extra == "all"
95
+ Requires-Dist: pytest-cov; extra == "all"
96
+ Requires-Dist: pytest-env; extra == "all"
97
+ Requires-Dist: pytest-xdist; extra == "all"
98
+ Requires-Dist: pytest-vcr; extra == "all"
99
+ Requires-Dist: pytest-asyncio; extra == "all"
100
+ Requires-Dist: pytest-rerunfailures<16.0; extra == "all"
101
+ Requires-Dist: pytest-mock; extra == "all"
102
+ Requires-Dist: urllib3<2.0; extra == "all"
103
+ Requires-Dist: soundfile; extra == "all"
104
+ Requires-Dist: Pillow; extra == "all"
105
+ Requires-Dist: numpy; extra == "all"
106
+ Requires-Dist: duckdb; extra == "all"
107
+ Requires-Dist: fastapi; extra == "all"
108
+ Requires-Dist: ruff>=0.9.0; extra == "all"
109
+ Requires-Dist: mypy==1.15.0; extra == "all"
110
+ Requires-Dist: libcst>=1.4.0; extra == "all"
111
+ Requires-Dist: ty; extra == "all"
112
+ Requires-Dist: typing-extensions>=4.8.0; extra == "all"
113
+ Requires-Dist: types-PyYAML; extra == "all"
114
+ Requires-Dist: types-simplejson; extra == "all"
115
+ Requires-Dist: types-toml; extra == "all"
116
+ Requires-Dist: types-tqdm; extra == "all"
117
+ Requires-Dist: types-urllib3; extra == "all"
118
+ Provides-Extra: dev
119
+ Requires-Dist: authlib>=1.3.2; extra == "dev"
120
+ Requires-Dist: fastapi; extra == "dev"
121
+ Requires-Dist: httpx; extra == "dev"
122
+ Requires-Dist: itsdangerous; extra == "dev"
123
+ Requires-Dist: jedi; extra == "dev"
124
+ Requires-Dist: Jinja2; extra == "dev"
125
+ Requires-Dist: pytest>=8.4.2; extra == "dev"
126
+ Requires-Dist: pytest-cov; extra == "dev"
127
+ Requires-Dist: pytest-env; extra == "dev"
128
+ Requires-Dist: pytest-xdist; extra == "dev"
129
+ Requires-Dist: pytest-vcr; extra == "dev"
130
+ Requires-Dist: pytest-asyncio; extra == "dev"
131
+ Requires-Dist: pytest-rerunfailures<16.0; extra == "dev"
132
+ Requires-Dist: pytest-mock; extra == "dev"
133
+ Requires-Dist: urllib3<2.0; extra == "dev"
134
+ Requires-Dist: soundfile; extra == "dev"
135
+ Requires-Dist: Pillow; extra == "dev"
136
+ Requires-Dist: numpy; extra == "dev"
137
+ Requires-Dist: duckdb; extra == "dev"
138
+ Requires-Dist: fastapi; extra == "dev"
139
+ Requires-Dist: ruff>=0.9.0; extra == "dev"
140
+ Requires-Dist: mypy==1.15.0; extra == "dev"
141
+ Requires-Dist: libcst>=1.4.0; extra == "dev"
142
+ Requires-Dist: ty; extra == "dev"
143
+ Requires-Dist: typing-extensions>=4.8.0; extra == "dev"
144
+ Requires-Dist: types-PyYAML; extra == "dev"
145
+ Requires-Dist: types-simplejson; extra == "dev"
146
+ Requires-Dist: types-toml; extra == "dev"
147
+ Requires-Dist: types-tqdm; extra == "dev"
148
+ Requires-Dist: types-urllib3; extra == "dev"
149
+ Dynamic: author
150
+ Dynamic: author-email
151
+ Dynamic: classifier
152
+ Dynamic: description
153
+ Dynamic: description-content-type
154
+ Dynamic: home-page
155
+ Dynamic: keywords
156
+ Dynamic: license
157
+ Dynamic: license-file
158
+ Dynamic: provides-extra
159
+ Dynamic: requires-dist
160
+ Dynamic: requires-python
161
+ Dynamic: summary
162
+
163
+ <p align="center">
164
+ <picture>
165
+ <source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub-dark.svg">
166
+ <source media="(prefers-color-scheme: light)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg">
167
+ <img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="352" height="59" style="max-width: 100%">
168
+ </picture>
169
+ <br/>
170
+ <br/>
171
+ </p>
172
+
173
+ <p align="center">
174
+ <i>The official Python client for the Huggingface Hub.</i>
175
+ </p>
176
+
177
+ <p align="center">
178
+ <a href="https://huggingface.co/docs/huggingface_hub/en/index"><img alt="Documentation" src="https://img.shields.io/website/http/huggingface.co/docs/huggingface_hub/index.svg?down_color=red&down_message=offline&up_message=online&label=doc"></a>
179
+ <a href="https://github.com/huggingface/huggingface_hub/releases"><img alt="GitHub release" src="https://img.shields.io/github/release/huggingface/huggingface_hub.svg"></a>
180
+ <a href="https://github.com/huggingface/huggingface_hub"><img alt="PyPi version" src="https://img.shields.io/pypi/pyversions/huggingface_hub.svg"></a>
181
+ <a href="https://pypi.org/project/huggingface-hub"><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/huggingface_hub"></a>
182
+ <a href="https://codecov.io/gh/huggingface/huggingface_hub"><img alt="Code coverage" src="https://codecov.io/gh/huggingface/huggingface_hub/branch/main/graph/badge.svg?token=RXP95LE2XL"></a>
183
+ </p>
184
+
185
+ <h4 align="center">
186
+ <p>
187
+ <b>English</b> |
188
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_de.md">Deutsch</a> |
189
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_fr.md">Français</a> |
190
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_hi.md">हिंदी</a> |
191
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_ko.md">한국어</a> |
192
+ <a href="https://github.com/huggingface/huggingface_hub/blob/main/i18n/README_cn.md">中文 (简体)</a>
193
+ <p>
194
+ </h4>
195
+
196
+ ---
197
+
198
+ **Documentation**: <a href="https://hf.co/docs/huggingface_hub" target="_blank">https://hf.co/docs/huggingface_hub</a>
199
+
200
+ **Source Code**: <a href="https://github.com/huggingface/huggingface_hub" target="_blank">https://github.com/huggingface/huggingface_hub</a>
201
+
202
+ ---
203
+
204
+ ## Welcome to the huggingface_hub library
205
+
206
+ The `huggingface_hub` library allows you to interact with the [Hugging Face Hub](https://huggingface.co/), a platform democratizing open-source Machine Learning for creators and collaborators. Discover pre-trained models and datasets for your projects or play with the thousands of machine learning apps hosted on the Hub. You can also create and share your own models, datasets and demos with the community. The `huggingface_hub` library provides a simple way to do all these things with Python.
207
+
208
+ ## Key features
209
+
210
+ - [Download files](https://huggingface.co/docs/huggingface_hub/en/guides/download) from the Hub.
211
+ - [Upload files](https://huggingface.co/docs/huggingface_hub/en/guides/upload) to the Hub.
212
+ - [Manage your repositories](https://huggingface.co/docs/huggingface_hub/en/guides/repository).
213
+ - [Run Inference](https://huggingface.co/docs/huggingface_hub/en/guides/inference) on deployed models.
214
+ - [Search](https://huggingface.co/docs/huggingface_hub/en/guides/search) for models, datasets and Spaces.
215
+ - [Share Model Cards](https://huggingface.co/docs/huggingface_hub/en/guides/model-cards) to document your models.
216
+ - [Engage with the community](https://huggingface.co/docs/huggingface_hub/en/guides/community) through PRs and comments.
217
+
218
+ ## Installation
219
+
220
+ Install the `huggingface_hub` package with [pip](https://pypi.org/project/huggingface-hub/):
221
+
222
+ ```bash
223
+ pip install huggingface_hub
224
+ ```
225
+
226
+ If you prefer, you can also install it with [conda](https://huggingface.co/docs/huggingface_hub/en/installation#install-with-conda).
227
+
228
+ In order to keep the package minimal by default, `huggingface_hub` comes with optional dependencies useful for some use cases. For example, if you want to use the MCP module, run:
229
+
230
+ ```bash
231
+ pip install "huggingface_hub[mcp]"
232
+ ```
233
+
234
+ To learn more installation and optional dependencies, check out the [installation guide](https://huggingface.co/docs/huggingface_hub/en/installation).
235
+
236
+ ## Quick start
237
+
238
+ ### Download files
239
+
240
+ Download a single file
241
+
242
+ ```py
243
+ from huggingface_hub import hf_hub_download
244
+
245
+ hf_hub_download(repo_id="tiiuae/falcon-7b-instruct", filename="config.json")
246
+ ```
247
+
248
+ Or an entire repository
249
+
250
+ ```py
251
+ from huggingface_hub import snapshot_download
252
+
253
+ snapshot_download("stabilityai/stable-diffusion-2-1")
254
+ ```
255
+
256
+ Files will be downloaded in a local cache folder. More details in [this guide](https://huggingface.co/docs/huggingface_hub/en/guides/manage-cache).
257
+
258
+ ### Login
259
+
260
+ The Hugging Face Hub uses tokens to authenticate applications (see [docs](https://huggingface.co/docs/hub/security-tokens)). To log in your machine, run the following CLI:
261
+
262
+ ```bash
263
+ hf auth login
264
+ # or using an environment variable
265
+ hf auth login --token $HUGGINGFACE_TOKEN
266
+ ```
267
+
268
+ ### Create a repository
269
+
270
+ ```py
271
+ from huggingface_hub import create_repo
272
+
273
+ create_repo(repo_id="super-cool-model")
274
+ ```
275
+
276
+ ### Upload files
277
+
278
+ Upload a single file
279
+
280
+ ```py
281
+ from huggingface_hub import upload_file
282
+
283
+ upload_file(
284
+ path_or_fileobj="/home/lysandre/dummy-test/README.md",
285
+ path_in_repo="README.md",
286
+ repo_id="lysandre/test-model",
287
+ )
288
+ ```
289
+
290
+ Or an entire folder
291
+
292
+ ```py
293
+ from huggingface_hub import upload_folder
294
+
295
+ upload_folder(
296
+ folder_path="/path/to/local/space",
297
+ repo_id="username/my-cool-space",
298
+ repo_type="space",
299
+ )
300
+ ```
301
+
302
+ For details in the [upload guide](https://huggingface.co/docs/huggingface_hub/en/guides/upload).
303
+
304
+ ## Integrating to the Hub.
305
+
306
+ We're partnering with cool open source ML libraries to provide free model hosting and versioning. You can find the existing integrations [here](https://huggingface.co/docs/hub/libraries).
307
+
308
+ The advantages are:
309
+
310
+ - Free model or dataset hosting for libraries and their users.
311
+ - Built-in file versioning, even with very large files, thanks to a git-based approach.
312
+ - In-browser widgets to play with the uploaded models.
313
+ - Anyone can upload a new model for your library, they just need to add the corresponding tag for the model to be discoverable.
314
+ - Fast downloads! We use Cloudfront (a CDN) to geo-replicate downloads so they're blazing fast from anywhere on the globe.
315
+ - Usage stats and more features to come.
316
+
317
+ If you would like to integrate your library, feel free to open an issue to begin the discussion. We wrote a [step-by-step guide](https://huggingface.co/docs/hub/adding-a-library) with ❤️ showing how to do this integration.
318
+
319
+ ## Contributions (feature requests, bugs, etc.) are super welcome 💙💚💛💜🧡❤️
320
+
321
+ Everyone is welcome to contribute, and we value everybody's contribution. Code is not the only way to help the community.
322
+ Answering questions, helping others, reaching out and improving the documentations are immensely valuable to the community.
323
+ We wrote a [contribution guide](https://github.com/huggingface/huggingface_hub/blob/main/CONTRIBUTING.md) to summarize
324
+ how to get started to contribute to this repository.
.cache/pip/http-v2/6/4/c/f/c/64cfc03e83f9fad4049b1d2a1d785c9273270a4ab9788b538f5054e3 ADDED
Binary file (1.87 kB). View file
 
.cache/pip/http-v2/6/5/1/e/5/651e58859e8db8c99b9e7068d03984cfd4577518ff0e021c717afbf4 ADDED
Binary file (1.2 kB). View file
 
.cache/pip/http-v2/6/5/1/e/5/651e58859e8db8c99b9e7068d03984cfd4577518ff0e021c717afbf4.body ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.1
2
+ Name: cycler
3
+ Version: 0.12.1
4
+ Summary: Composable style cycles
5
+ Author-email: Thomas A Caswell <matplotlib-users@python.org>
6
+ License: Copyright (c) 2015, matplotlib project
7
+ All rights reserved.
8
+
9
+ Redistribution and use in source and binary forms, with or without
10
+ modification, are permitted provided that the following conditions are met:
11
+
12
+ * Redistributions of source code must retain the above copyright notice, this
13
+ list of conditions and the following disclaimer.
14
+
15
+ * Redistributions in binary form must reproduce the above copyright notice,
16
+ this list of conditions and the following disclaimer in the documentation
17
+ and/or other materials provided with the distribution.
18
+
19
+ * Neither the name of the matplotlib project nor the names of its
20
+ contributors may be used to endorse or promote products derived from
21
+ this software without specific prior written permission.
22
+
23
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
27
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+ Project-URL: homepage, https://matplotlib.org/cycler/
34
+ Project-URL: repository, https://github.com/matplotlib/cycler
35
+ Keywords: cycle kwargs
36
+ Classifier: License :: OSI Approved :: BSD License
37
+ Classifier: Development Status :: 4 - Beta
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3.8
40
+ Classifier: Programming Language :: Python :: 3.9
41
+ Classifier: Programming Language :: Python :: 3.10
42
+ Classifier: Programming Language :: Python :: 3.11
43
+ Classifier: Programming Language :: Python :: 3.12
44
+ Classifier: Programming Language :: Python :: 3 :: Only
45
+ Requires-Python: >=3.8
46
+ Description-Content-Type: text/x-rst
47
+ License-File: LICENSE
48
+ Provides-Extra: docs
49
+ Requires-Dist: ipython ; extra == 'docs'
50
+ Requires-Dist: matplotlib ; extra == 'docs'
51
+ Requires-Dist: numpydoc ; extra == 'docs'
52
+ Requires-Dist: sphinx ; extra == 'docs'
53
+ Provides-Extra: tests
54
+ Requires-Dist: pytest ; extra == 'tests'
55
+ Requires-Dist: pytest-cov ; extra == 'tests'
56
+ Requires-Dist: pytest-xdist ; extra == 'tests'
57
+
58
+ |PyPi|_ |Conda|_ |Supported Python versions|_ |GitHub Actions|_ |Codecov|_
59
+
60
+ .. |PyPi| image:: https://img.shields.io/pypi/v/cycler.svg?style=flat
61
+ .. _PyPi: https://pypi.python.org/pypi/cycler
62
+
63
+ .. |Conda| image:: https://img.shields.io/conda/v/conda-forge/cycler
64
+ .. _Conda: https://anaconda.org/conda-forge/cycler
65
+
66
+ .. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/cycler.svg
67
+ .. _Supported Python versions: https://pypi.python.org/pypi/cycler
68
+
69
+ .. |GitHub Actions| image:: https://github.com/matplotlib/cycler/actions/workflows/tests.yml/badge.svg
70
+ .. _GitHub Actions: https://github.com/matplotlib/cycler/actions
71
+
72
+ .. |Codecov| image:: https://codecov.io/github/matplotlib/cycler/badge.svg?branch=main&service=github
73
+ .. _Codecov: https://codecov.io/github/matplotlib/cycler?branch=main
74
+
75
+ cycler: composable cycles
76
+ =========================
77
+
78
+ Docs: https://matplotlib.org/cycler/
.cache/pip/http-v2/6/6/e/c/7/66ec76a7b6ed4081044f5c7821af293b63c17bc2ac523ff93d5ca7d5 ADDED
Binary file (1.87 kB). View file
 
.cache/pip/http-v2/6/8/0/d/4/680d4dd80dc6a3d2df9b9478dfcc8e81e0e4f130e154a3268b98b877 ADDED
Binary file (1.87 kB). View file
 
.cache/pip/http-v2/6/b/5/3/a/6b53a9dd0e4fce887cc28c1a921aa1befe8c1a82e6c213d2542d2acb ADDED
Binary file (1.86 kB). View file
 
.cache/pip/http-v2/6/b/5/3/a/6b53a9dd0e4fce887cc28c1a921aa1befe8c1a82e6c213d2542d2acb.body ADDED
Binary file (14.8 kB). View file
 
.cache/pip/http-v2/6/b/8/1/e/6b81e7b491d69713c085c9f59d6c9162e9c07ca91d4f2bb5b3cd4b8e ADDED
Binary file (1.17 kB). View file
 
.cache/pip/http-v2/6/b/8/1/e/6b81e7b491d69713c085c9f59d6c9162e9c07ca91d4f2bb5b3cd4b8e.body ADDED
@@ -0,0 +1,386 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: optuna
3
+ Version: 4.8.0
4
+ Summary: A hyperparameter optimization framework
5
+ Author: Takuya Akiba
6
+ Project-URL: homepage, https://optuna.org/
7
+ Project-URL: repository, https://github.com/optuna/optuna
8
+ Project-URL: documentation, https://optuna.readthedocs.io
9
+ Project-URL: bugtracker, https://github.com/optuna/optuna/issues
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Programming Language :: Python :: 3 :: Only
22
+ Classifier: Topic :: Scientific/Engineering
23
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
24
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
25
+ Classifier: Topic :: Software Development
26
+ Classifier: Topic :: Software Development :: Libraries
27
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
+ Requires-Python: >=3.9
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ License-File: LICENSE_THIRD_PARTY
32
+ Requires-Dist: alembic>=1.5.0
33
+ Requires-Dist: colorlog
34
+ Requires-Dist: numpy
35
+ Requires-Dist: packaging>=20.0
36
+ Requires-Dist: sqlalchemy>=1.4.2
37
+ Requires-Dist: tqdm
38
+ Requires-Dist: PyYAML
39
+ Provides-Extra: checking
40
+ Requires-Dist: mypy; extra == "checking"
41
+ Requires-Dist: mypy_boto3_s3; extra == "checking"
42
+ Requires-Dist: ruff; extra == "checking"
43
+ Requires-Dist: scipy-stubs; python_version >= "3.10" and extra == "checking"
44
+ Requires-Dist: types-PyYAML; extra == "checking"
45
+ Requires-Dist: types-redis; extra == "checking"
46
+ Requires-Dist: types-setuptools; extra == "checking"
47
+ Requires-Dist: types-tqdm; extra == "checking"
48
+ Requires-Dist: typing_extensions>=3.10.0.0; extra == "checking"
49
+ Provides-Extra: document
50
+ Requires-Dist: ase; extra == "document"
51
+ Requires-Dist: cmaes>=0.12.0; extra == "document"
52
+ Requires-Dist: fvcore; extra == "document"
53
+ Requires-Dist: kaleido<0.4; extra == "document"
54
+ Requires-Dist: lightgbm; extra == "document"
55
+ Requires-Dist: matplotlib!=3.6.0; extra == "document"
56
+ Requires-Dist: pandas; extra == "document"
57
+ Requires-Dist: pillow; extra == "document"
58
+ Requires-Dist: plotly>=4.9.0; extra == "document"
59
+ Requires-Dist: scikit-learn; extra == "document"
60
+ Requires-Dist: sphinx; extra == "document"
61
+ Requires-Dist: sphinx-copybutton; extra == "document"
62
+ Requires-Dist: sphinx-gallery; extra == "document"
63
+ Requires-Dist: sphinx-notfound-page; extra == "document"
64
+ Requires-Dist: sphinx_rtd_theme>=1.2.0; extra == "document"
65
+ Requires-Dist: torch; extra == "document"
66
+ Requires-Dist: torchvision; extra == "document"
67
+ Provides-Extra: optional
68
+ Requires-Dist: boto3; extra == "optional"
69
+ Requires-Dist: cmaes>=0.12.0; extra == "optional"
70
+ Requires-Dist: google-cloud-storage; extra == "optional"
71
+ Requires-Dist: matplotlib!=3.6.0; extra == "optional"
72
+ Requires-Dist: pandas; extra == "optional"
73
+ Requires-Dist: plotly>=4.9.0; extra == "optional"
74
+ Requires-Dist: redis; extra == "optional"
75
+ Requires-Dist: scikit-learn>=0.24.2; extra == "optional"
76
+ Requires-Dist: scipy; extra == "optional"
77
+ Requires-Dist: torch; extra == "optional"
78
+ Requires-Dist: greenlet; extra == "optional"
79
+ Requires-Dist: grpcio; extra == "optional"
80
+ Requires-Dist: protobuf>=5.28.1; extra == "optional"
81
+ Provides-Extra: test
82
+ Requires-Dist: fakeredis[lua]; extra == "test"
83
+ Requires-Dist: kaleido<0.4; extra == "test"
84
+ Requires-Dist: moto; extra == "test"
85
+ Requires-Dist: pytest; extra == "test"
86
+ Requires-Dist: pytest-xdist; extra == "test"
87
+ Requires-Dist: scipy>=1.9.2; extra == "test"
88
+ Requires-Dist: torch; extra == "test"
89
+ Requires-Dist: greenlet; extra == "test"
90
+ Requires-Dist: grpcio; extra == "test"
91
+ Requires-Dist: protobuf>=5.28.1; extra == "test"
92
+ Dynamic: license-file
93
+
94
+ <div align="center"><img src="https://raw.githubusercontent.com/optuna/optuna/master/docs/image/optuna-logo.png" width="800"/></div>
95
+
96
+ # Optuna: A hyperparameter optimization framework
97
+
98
+ [![Python](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue)](https://www.python.org)
99
+ [![pypi](https://img.shields.io/pypi/v/optuna.svg)](https://pypi.python.org/pypi/optuna)
100
+ [![conda](https://img.shields.io/conda/vn/conda-forge/optuna.svg)](https://anaconda.org/conda-forge/optuna)
101
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/optuna/optuna)
102
+ [![Read the Docs](https://readthedocs.org/projects/optuna/badge/?version=stable)](https://optuna.readthedocs.io/en/stable/)
103
+
104
+ :link: [**Website**](https://optuna.org/)
105
+ | :page_with_curl: [**Docs**](https://optuna.readthedocs.io/en/stable/)
106
+ | :gear: [**Install Guide**](https://optuna.readthedocs.io/en/stable/installation.html)
107
+ | :pencil: [**Tutorial**](https://optuna.readthedocs.io/en/stable/tutorial/index.html)
108
+ | :bulb: [**Examples**](https://github.com/optuna/optuna-examples)
109
+ | [**Twitter**](https://twitter.com/OptunaAutoML)
110
+ | [**LinkedIn**](https://www.linkedin.com/showcase/optuna/)
111
+ | [**Medium**](https://medium.com/optuna)
112
+
113
+ *Optuna* is an automatic hyperparameter optimization software framework, particularly designed
114
+ for machine learning. It features an imperative, *define-by-run* style user API. Thanks to our
115
+ *define-by-run* API, the code written with Optuna enjoys high modularity, and the user of
116
+ Optuna can dynamically construct the search spaces for the hyperparameters.
117
+
118
+ ## :loudspeaker: News
119
+ Help us create the next version of Optuna!
120
+
121
+ Optuna 5.0 Roadmap published for review. Please take a look at [the planned improvements to Optuna](https://medium.com/optuna/optuna-v5-roadmap-ac7d6935a878), and share your feedback in [the github issues](https://github.com/optuna/optuna/labels/v5). PR contributions also welcome!
122
+
123
+ Please take a few minutes to fill in [this survey](https://forms.gle/wVwLCQ9g6st6AXuq9), and let us know how you use Optuna now and what improvements you'd like.🤔
124
+ All questions are optional. 🙇‍♂️
125
+
126
+ <!-- TODO: when you add a new line, please delete the oldest line -->
127
+ * **Jan 19, 2026**: Optuna 4.7.0 is out! Check out [the release note](https://github.com/optuna/optuna/releases/tag/v4.7.0) for details.
128
+ * **Nov 10, 2025**: A new article [Announcing Optuna 4.6](https://medium.com/optuna/announcing-optuna-4-6-a9e82183ab07) has been published.
129
+ * **Oct 28, 2025**: A new article [AutoSampler: Full Support for Multi-Objective & Constrained Optimization](https://medium.com/optuna/autosampler-full-support-for-multi-objective-constrained-optimization-c1c4fc957ba2) has been published.
130
+ * **Sep 22, 2025**: A new article [[Optuna v4.5] Gaussian Process-Based Sampler (GPSampler) Can Now Perform Constrained Multi-Objective Optimization](https://medium.com/optuna/optuna-v4-5-81e78d8e077a) has been published.
131
+ * **Jun 16, 2025**: Optuna 4.4.0 has been released! Check out [the release blog](https://medium.com/optuna/announcing-optuna-4-4-ece661493126).
132
+ * **May 26, 2025**: Optuna 5.0 roadmap has been published! See [the blog](https://medium.com/optuna/optuna-v5-roadmap-ac7d6935a878) for more details.
133
+
134
+ ## :fire: Key Features
135
+
136
+ Optuna has modern functionalities as follows:
137
+
138
+ - [Lightweight, versatile, and platform agnostic architecture](https://optuna.readthedocs.io/en/stable/tutorial/10_key_features/001_first.html)
139
+ - Handle a wide variety of tasks with a simple installation that has few requirements.
140
+ - [Pythonic search spaces](https://optuna.readthedocs.io/en/stable/tutorial/10_key_features/002_configurations.html)
141
+ - Define search spaces using familiar Python syntax including conditionals and loops.
142
+ - [Efficient optimization algorithms](https://optuna.readthedocs.io/en/stable/tutorial/10_key_features/003_efficient_optimization_algorithms.html)
143
+ - Adopt state-of-the-art algorithms for sampling hyperparameters and efficiently pruning unpromising trials.
144
+ - [Easy parallelization](https://optuna.readthedocs.io/en/stable/tutorial/10_key_features/004_distributed.html)
145
+ - Scale studies to tens or hundreds of workers with little or no changes to the code.
146
+ - [Quick visualization](https://optuna.readthedocs.io/en/stable/tutorial/10_key_features/005_visualization.html)
147
+ - Inspect optimization histories from a variety of plotting functions.
148
+
149
+
150
+ ## Basic Concepts
151
+
152
+ We use the terms *study* and *trial* as follows:
153
+
154
+ - Study: optimization based on an objective function
155
+ - Trial: a single execution of the objective function
156
+
157
+ Please refer to the sample code below. The goal of a *study* is to find out the optimal set of
158
+ hyperparameter values (e.g., `regressor` and `svr_c`) through multiple *trials* (e.g.,
159
+ `n_trials=100`). Optuna is a framework designed for automation and acceleration of
160
+ optimization *studies*.
161
+
162
+ <details open>
163
+ <summary>Sample code with scikit-learn</summary>
164
+
165
+ [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](http://colab.research.google.com/github/optuna/optuna-examples/blob/main/quickstart.ipynb)
166
+
167
+ ```python
168
+ import optuna
169
+ import sklearn
170
+
171
+
172
+ # Define an objective function to be minimized.
173
+ def objective(trial):
174
+
175
+ # Invoke suggest methods of a Trial object to generate hyperparameters.
176
+ regressor_name = trial.suggest_categorical("regressor", ["SVR", "RandomForest"])
177
+ if regressor_name == "SVR":
178
+ svr_c = trial.suggest_float("svr_c", 1e-10, 1e10, log=True)
179
+ regressor_obj = sklearn.svm.SVR(C=svr_c)
180
+ else:
181
+ rf_max_depth = trial.suggest_int("rf_max_depth", 2, 32)
182
+ regressor_obj = sklearn.ensemble.RandomForestRegressor(max_depth=rf_max_depth)
183
+
184
+ X, y = sklearn.datasets.fetch_california_housing(return_X_y=True)
185
+ X_train, X_val, y_train, y_val = sklearn.model_selection.train_test_split(X, y, random_state=0)
186
+
187
+ regressor_obj.fit(X_train, y_train)
188
+ y_pred = regressor_obj.predict(X_val)
189
+
190
+ error = sklearn.metrics.mean_squared_error(y_val, y_pred)
191
+
192
+ return error # An objective value linked with the Trial object.
193
+
194
+
195
+ study = optuna.create_study() # Create a new study.
196
+ study.optimize(objective, n_trials=100) # Invoke optimization of the objective function.
197
+ ```
198
+ </details>
199
+
200
+ > [!NOTE]
201
+ > More examples can be found in [optuna/optuna-examples](https://github.com/optuna/optuna-examples).
202
+ >
203
+ > The examples cover diverse problem setups such as multi-objective optimization, constrained optimization, pruning, and distributed optimization.
204
+
205
+ ## Installation
206
+
207
+ Optuna is available at [the Python Package Index](https://pypi.org/project/optuna/) and on [Anaconda Cloud](https://anaconda.org/conda-forge/optuna).
208
+
209
+ ```bash
210
+ # PyPI
211
+ $ pip install optuna
212
+ ```
213
+
214
+ ```bash
215
+ # Anaconda Cloud
216
+ $ conda install -c conda-forge optuna
217
+ ```
218
+
219
+ > [!IMPORTANT]
220
+ > Optuna supports Python 3.9 or newer.
221
+ >
222
+ > Also, we provide Optuna docker images on [DockerHub](https://hub.docker.com/r/optuna/optuna).
223
+
224
+ ## Integrations
225
+
226
+ Optuna has integration features with various third-party libraries. Integrations can be found in [optuna/optuna-integration](https://github.com/optuna/optuna-integration) and the document is available [here](https://optuna-integration.readthedocs.io/en/stable/index.html).
227
+
228
+ <details>
229
+ <summary>Supported integration libraries</summary>
230
+
231
+ * [Catboost](https://github.com/optuna/optuna-examples/tree/main/catboost/catboost_pruning.py)
232
+ * [Dask](https://github.com/optuna/optuna-examples/tree/main/dask/dask_simple.py)
233
+ * [fastai](https://github.com/optuna/optuna-examples/tree/main/fastai/fastai_simple.py)
234
+ * [Keras](https://github.com/optuna/optuna-examples/tree/main/keras/keras_integration.py)
235
+ * [LightGBM](https://github.com/optuna/optuna-examples/tree/main/lightgbm/lightgbm_integration.py)
236
+ * [MLflow](https://github.com/optuna/optuna-examples/tree/main/mlflow/keras_mlflow.py)
237
+ * [PyTorch](https://github.com/optuna/optuna-examples/tree/main/pytorch/pytorch_simple.py)
238
+ * [PyTorch Ignite](https://github.com/optuna/optuna-examples/tree/main/pytorch/pytorch_ignite_simple.py)
239
+ * [PyTorch Lightning](https://github.com/optuna/optuna-examples/tree/main/pytorch/pytorch_lightning_simple.py)
240
+ * [TensorBoard](https://github.com/optuna/optuna-examples/tree/main/tensorboard/tensorboard_simple.py)
241
+ * [TensorFlow](https://github.com/optuna/optuna-examples/tree/main/tensorflow/tensorflow_estimator_integration.py)
242
+ * [tf.keras](https://github.com/optuna/optuna-examples/tree/main/tfkeras/tfkeras_integration.py)
243
+ * [Weights & Biases](https://github.com/optuna/optuna-examples/tree/main/wandb/wandb_integration.py)
244
+ * [XGBoost](https://github.com/optuna/optuna-examples/tree/main/xgboost/xgboost_integration.py)
245
+ </details>
246
+
247
+ ## Web Dashboard
248
+
249
+ [Optuna Dashboard](https://github.com/optuna/optuna-dashboard) is a real-time web dashboard for Optuna.
250
+ You can check the optimization history, hyperparameter importance, etc. in graphs and tables.
251
+ You don't need to create a Python script to call [Optuna's visualization](https://optuna.readthedocs.io/en/stable/reference/visualization/index.html) functions.
252
+ Feature requests and bug reports are welcome!
253
+
254
+ ![optuna-dashboard](https://user-images.githubusercontent.com/5564044/204975098-95c2cb8c-0fb5-4388-abc4-da32f56cb4e5.gif)
255
+
256
+ `optuna-dashboard` can be installed via pip:
257
+
258
+ ```shell
259
+ $ pip install optuna-dashboard
260
+ ```
261
+
262
+ > [!TIP]
263
+ > Please check out the convenience of Optuna Dashboard using the sample code below.
264
+
265
+ <details>
266
+ <summary>Sample code to launch Optuna Dashboard</summary>
267
+
268
+ Save the following code as `optimize_toy.py`.
269
+
270
+ ```python
271
+ import optuna
272
+
273
+
274
+ def objective(trial):
275
+ x1 = trial.suggest_float("x1", -100, 100)
276
+ x2 = trial.suggest_float("x2", -100, 100)
277
+ return x1**2 + 0.01 * x2**2
278
+
279
+
280
+ study = optuna.create_study(storage="sqlite:///db.sqlite3") # Create a new study with database.
281
+ study.optimize(objective, n_trials=100)
282
+ ```
283
+
284
+ Then try the commands below:
285
+
286
+ ```shell
287
+ # Run the study specified above
288
+ $ python optimize_toy.py
289
+
290
+ # Launch the dashboard based on the storage `sqlite:///db.sqlite3`
291
+ $ optuna-dashboard sqlite:///db.sqlite3
292
+ ...
293
+ Listening on http://localhost:8080/
294
+ Hit Ctrl-C to quit.
295
+ ```
296
+
297
+ </details>
298
+
299
+
300
+ ## OptunaHub
301
+
302
+ [OptunaHub](https://hub.optuna.org/) is a feature-sharing platform for Optuna.
303
+ You can use the registered features and publish your packages.
304
+
305
+ ### Use registered features
306
+
307
+ `optunahub` can be installed via pip:
308
+
309
+ ```shell
310
+ $ pip install optunahub
311
+ # Install AutoSampler dependencies (CPU only is sufficient for PyTorch)
312
+ $ pip install cmaes scipy torch --extra-index-url https://download.pytorch.org/whl/cpu
313
+ ```
314
+
315
+ You can load registered module with `optunahub.load_module`.
316
+
317
+ ```python
318
+ import optuna
319
+ import optunahub
320
+
321
+
322
+ def objective(trial: optuna.Trial) -> float:
323
+ x = trial.suggest_float("x", -5, 5)
324
+ y = trial.suggest_float("y", -5, 5)
325
+ return x**2 + y**2
326
+
327
+
328
+ module = optunahub.load_module(package="samplers/auto_sampler")
329
+ study = optuna.create_study(sampler=module.AutoSampler())
330
+ study.optimize(objective, n_trials=10)
331
+
332
+ print(study.best_trial.value, study.best_trial.params)
333
+ ```
334
+
335
+ For more details, please refer to [the optunahub documentation](https://optuna.github.io/optunahub/).
336
+
337
+ ### Publish your packages
338
+
339
+ You can publish your package via [optunahub-registry](https://github.com/optuna/optunahub-registry).
340
+ See the [Tutorials for Contributors](https://optuna.github.io/optunahub/tutorials_for_contributors.html) in OptunaHub.
341
+
342
+
343
+ ## Communication
344
+
345
+ - [GitHub Discussions] for questions.
346
+ - [GitHub Issues] for bug reports and feature requests.
347
+
348
+ [GitHub Discussions]: https://github.com/optuna/optuna/discussions
349
+ [GitHub issues]: https://github.com/optuna/optuna/issues
350
+
351
+
352
+ ## Contribution
353
+
354
+ Any contributions to Optuna are more than welcome!
355
+
356
+ If you are new to Optuna, please check the [good first issues](https://github.com/optuna/optuna/labels/good%20first%20issue). They are relatively simple, well-defined, and often good starting points for you to get familiar with the contribution workflow and other developers.
357
+
358
+ If you already have contributed to Optuna, we recommend the other [contribution-welcome issues](https://github.com/optuna/optuna/labels/contribution-welcome).
359
+
360
+ For general guidelines on how to contribute to the project, take a look at [CONTRIBUTING.md](./CONTRIBUTING.md).
361
+
362
+
363
+ ## Reference
364
+
365
+ If you use Optuna in one of your research projects, please cite [our KDD paper](https://doi.org/10.1145/3292500.3330701) "Optuna: A Next-generation Hyperparameter Optimization Framework":
366
+
367
+ <details open>
368
+ <summary>BibTeX</summary>
369
+
370
+ ```bibtex
371
+ @inproceedings{akiba2019optuna,
372
+ title={{O}ptuna: A Next-Generation Hyperparameter Optimization Framework},
373
+ author={Akiba, Takuya and Sano, Shotaro and Yanase, Toshihiko and Ohta, Takeru and Koyama, Masanori},
374
+ booktitle={The 25th ACM SIGKDD International Conference on Knowledge Discovery \& Data Mining},
375
+ pages={2623--2631},
376
+ year={2019}
377
+ }
378
+ ```
379
+ </details>
380
+
381
+
382
+ ## License
383
+
384
+ MIT License (see [LICENSE](./LICENSE)).
385
+
386
+ Optuna uses the codes from SciPy and fdlibm projects (see [LICENSE_THIRD_PARTY](./LICENSE_THIRD_PARTY)).
.cache/pip/http-v2/6/c/6/e/e/6c6eeaf6757edbde690577822daacaba826c2b12ce67b57b33e8021d ADDED
Binary file (1.16 kB). View file
 
.cache/pip/http-v2/6/c/6/e/e/6c6eeaf6757edbde690577822daacaba826c2b12ce67b57b33e8021d.body ADDED
Binary file (8.32 kB). View file
 
.cache/pip/http-v2/6/d/c/b/9/6dcb9049adda15167eed5255a1c411f3de346af4a65c68fd19243d5b ADDED
Binary file (1.16 kB). View file
 
.cache/pip/http-v2/6/f/d/e/3/6fde3f0933387b9783cde9fa65fa4e62f7c3b0bf23557229e3f300bf ADDED
Binary file (1.13 kB). View file
 
.cache/pip/http-v2/7/2/8/a/2/728a2f33f382f4dacf08f6df77aad6f3d889f819ba4fa3efad5ec7e4 ADDED
Binary file (1.88 kB). View file
 
.cache/pip/http-v2/7/7/3/7/4/77374f6555d766d1d452fe4918fb303c49f49a5a37a0986ea4f1b212 ADDED
Binary file (1.22 kB). View file
 
.cache/pip/http-v2/7/7/3/7/4/77374f6555d766d1d452fe4918fb303c49f49a5a37a0986ea4f1b212.body ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: alembic
3
+ Version: 1.18.4
4
+ Summary: A database migration tool for SQLAlchemy.
5
+ Author-email: Mike Bayer <mike_mp@zzzcomputing.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://alembic.sqlalchemy.org
8
+ Project-URL: Documentation, https://alembic.sqlalchemy.org/en/latest/
9
+ Project-URL: Changelog, https://alembic.sqlalchemy.org/en/latest/changelog.html
10
+ Project-URL: Source, https://github.com/sqlalchemy/alembic/
11
+ Project-URL: Issue Tracker, https://github.com/sqlalchemy/alembic/issues/
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Environment :: Console
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: Implementation :: CPython
23
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
24
+ Classifier: Topic :: Database :: Front-Ends
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/x-rst
27
+ License-File: LICENSE
28
+ Requires-Dist: SQLAlchemy>=1.4.23
29
+ Requires-Dist: Mako
30
+ Requires-Dist: typing-extensions>=4.12
31
+ Requires-Dist: tomli; python_version < "3.11"
32
+ Provides-Extra: tz
33
+ Requires-Dist: tzdata; extra == "tz"
34
+ Dynamic: license-file
35
+
36
+ Alembic is a database migrations tool written by the author
37
+ of `SQLAlchemy <http://www.sqlalchemy.org>`_. A migrations tool
38
+ offers the following functionality:
39
+
40
+ * Can emit ALTER statements to a database in order to change
41
+ the structure of tables and other constructs
42
+ * Provides a system whereby "migration scripts" may be constructed;
43
+ each script indicates a particular series of steps that can "upgrade" a
44
+ target database to a new version, and optionally a series of steps that can
45
+ "downgrade" similarly, doing the same steps in reverse.
46
+ * Allows the scripts to execute in some sequential manner.
47
+
48
+ The goals of Alembic are:
49
+
50
+ * Very open ended and transparent configuration and operation. A new
51
+ Alembic environment is generated from a set of templates which is selected
52
+ among a set of options when setup first occurs. The templates then deposit a
53
+ series of scripts that define fully how database connectivity is established
54
+ and how migration scripts are invoked; the migration scripts themselves are
55
+ generated from a template within that series of scripts. The scripts can
56
+ then be further customized to define exactly how databases will be
57
+ interacted with and what structure new migration files should take.
58
+ * Full support for transactional DDL. The default scripts ensure that all
59
+ migrations occur within a transaction - for those databases which support
60
+ this (Postgresql, Microsoft SQL Server), migrations can be tested with no
61
+ need to manually undo changes upon failure.
62
+ * Minimalist script construction. Basic operations like renaming
63
+ tables/columns, adding/removing columns, changing column attributes can be
64
+ performed through one line commands like alter_column(), rename_table(),
65
+ add_constraint(). There is no need to recreate full SQLAlchemy Table
66
+ structures for simple operations like these - the functions themselves
67
+ generate minimalist schema structures behind the scenes to achieve the given
68
+ DDL sequence.
69
+ * "auto generation" of migrations. While real world migrations are far more
70
+ complex than what can be automatically determined, Alembic can still
71
+ eliminate the initial grunt work in generating new migration directives
72
+ from an altered schema. The ``--autogenerate`` feature will inspect the
73
+ current status of a database using SQLAlchemy's schema inspection
74
+ capabilities, compare it to the current state of the database model as
75
+ specified in Python, and generate a series of "candidate" migrations,
76
+ rendering them into a new migration script as Python directives. The
77
+ developer then edits the new file, adding additional directives and data
78
+ migrations as needed, to produce a finished migration. Table and column
79
+ level changes can be detected, with constraints and indexes to follow as
80
+ well.
81
+ * Full support for migrations generated as SQL scripts. Those of us who
82
+ work in corporate environments know that direct access to DDL commands on a
83
+ production database is a rare privilege, and DBAs want textual SQL scripts.
84
+ Alembic's usage model and commands are oriented towards being able to run a
85
+ series of migrations into a textual output file as easily as it runs them
86
+ directly to a database. Care must be taken in this mode to not invoke other
87
+ operations that rely upon in-memory SELECTs of rows - Alembic tries to
88
+ provide helper constructs like bulk_insert() to help with data-oriented
89
+ operations that are compatible with script-based DDL.
90
+ * Non-linear, dependency-graph versioning. Scripts are given UUID
91
+ identifiers similarly to a DVCS, and the linkage of one script to the next
92
+ is achieved via human-editable markers within the scripts themselves.
93
+ The structure of a set of migration files is considered as a
94
+ directed-acyclic graph, meaning any migration file can be dependent
95
+ on any other arbitrary set of migration files, or none at
96
+ all. Through this open-ended system, migration files can be organized
97
+ into branches, multiple roots, and mergepoints, without restriction.
98
+ Commands are provided to produce new branches, roots, and merges of
99
+ branches automatically.
100
+ * Provide a library of ALTER constructs that can be used by any SQLAlchemy
101
+ application. The DDL constructs build upon SQLAlchemy's own DDLElement base
102
+ and can be used standalone by any application or script.
103
+ * At long last, bring SQLite and its inability to ALTER things into the fold,
104
+ but in such a way that SQLite's very special workflow needs are accommodated
105
+ in an explicit way that makes the most of a bad situation, through the
106
+ concept of a "batch" migration, where multiple changes to a table can
107
+ be batched together to form a series of instructions for a single, subsequent
108
+ "move-and-copy" workflow. You can even use "move-and-copy" workflow for
109
+ other databases, if you want to recreate a table in the background
110
+ on a busy system.
111
+
112
+ Documentation and status of Alembic is at https://alembic.sqlalchemy.org/
113
+
114
+ The SQLAlchemy Project
115
+ ======================
116
+
117
+ Alembic is part of the `SQLAlchemy Project <https://www.sqlalchemy.org>`_ and
118
+ adheres to the same standards and conventions as the core project.
119
+
120
+ Development / Bug reporting / Pull requests
121
+ ___________________________________________
122
+
123
+ Please refer to the
124
+ `SQLAlchemy Community Guide <https://www.sqlalchemy.org/develop.html>`_ for
125
+ guidelines on coding and participating in this project.
126
+
127
+ Code of Conduct
128
+ _______________
129
+
130
+ Above all, SQLAlchemy places great emphasis on polite, thoughtful, and
131
+ constructive communication between users and developers.
132
+ Please see our current Code of Conduct at
133
+ `Code of Conduct <https://www.sqlalchemy.org/codeofconduct.html>`_.
134
+
135
+ License
136
+ =======
137
+
138
+ Alembic is distributed under the `MIT license
139
+ <https://opensource.org/licenses/MIT>`_.
.cache/pip/http-v2/7/7/3/b/e/773be4e62f2a7f9be9d2b777b9be56e14e2b6c9666994e8793db52fd ADDED
Binary file (1.15 kB). View file
 
.cache/pip/http-v2/7/9/2/1/a/7921ac3318a5cdb592026cc26a94f7a2c1e1f7d3a1dc1e3857fd49f1 ADDED
Binary file (1.86 kB). View file
 
.cache/pip/http-v2/7/9/2/1/a/7921ac3318a5cdb592026cc26a94f7a2c1e1f7d3a1dc1e3857fd49f1.body ADDED
Binary file (1.96 kB). View file
 
.cache/pip/http-v2/7/b/3/0/7/7b3075adb708114992fb27c6511ef6dfacffdcb852b8e8d037a10c4b ADDED
Binary file (1.16 kB). View file
 
.cache/pip/http-v2/8/1/8/8/f/8188f9db6169e57bb653240cc02c629488d0d899420b0725db0f7e4a ADDED
Binary file (1.13 kB). View file
 
.cache/pip/http-v2/8/6/1/4/a/8614a6e8a4ad9aa5595a607eb8f7a0d8a8f7a7a34cff9540f443a21f ADDED
Binary file (1.16 kB). View file
 
.cache/pip/http-v2/8/6/1/4/a/8614a6e8a4ad9aa5595a607eb8f7a0d8a8f7a7a34cff9540f443a21f.body ADDED
Binary file (5.3 kB). View file
 
.cache/pip/http-v2/8/6/e/d/b/86edbe0c05b42c1fe86aacc3cb9eaf8cb8a43c81ec1ba8b34d47241c ADDED
Binary file (1.12 kB). View file
 
.cache/pip/http-v2/8/7/9/c/c/879cc1cef8100ac59eeacde5d2539913601d5266658faccb02a20a6f ADDED
Binary file (1.13 kB). View file
 
.cache/pip/http-v2/8/a/c/4/d/8ac4d14dc45e27d21da49fb515570b6f875b78707de9b08ce1088d1b ADDED
Binary file (1.87 kB). View file
 
.cache/pip/http-v2/8/a/c/4/d/8ac4d14dc45e27d21da49fb515570b6f875b78707de9b08ce1088d1b.body ADDED
Binary file (16.2 kB). View file
 
.cache/pip/http-v2/8/d/8/7/b/8d87bf7a308bb8a91752d9c7e9e4d96db27c3fd3d01d3bb4e2dd8afc ADDED
Binary file (1.2 kB). View file
 
.cache/pip/http-v2/8/d/8/7/b/8d87bf7a308bb8a91752d9c7e9e4d96db27c3fd3d01d3bb4e2dd8afc.body ADDED
The diff for this file is too large to render. See raw diff
 
.cache/pip/http-v2/8/f/0/a/d/8f0ad583652318494c12da41e4d30ff6225ec73d448a0754a0a7e898 ADDED
Binary file (1.88 kB). View file
 
.cache/pip/http-v2/b/0/c/3/0/b0c304a2d0d2dd17cd2e818948220da223f52dfe26c6e170a35508ec ADDED
Binary file (1.17 kB). View file
 
.cache/pip/http-v2/b/0/c/3/0/b0c304a2d0d2dd17cd2e818948220da223f52dfe26c6e170a35508ec.body ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.1
2
+ Name: mdurl
3
+ Version: 0.1.2
4
+ Summary: Markdown URL utilities
5
+ Keywords: markdown,commonmark
6
+ Author-email: Taneli Hukkinen <hukkin@users.noreply.github.com>
7
+ Requires-Python: >=3.7
8
+ Description-Content-Type: text/markdown
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: MacOS
11
+ Classifier: Operating System :: Microsoft :: Windows
12
+ Classifier: Operating System :: POSIX :: Linux
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.7
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: Implementation :: CPython
19
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Typing :: Typed
22
+ Project-URL: Homepage, https://github.com/executablebooks/mdurl
23
+
24
+ # mdurl
25
+
26
+ [![Build Status](https://github.com/executablebooks/mdurl/workflows/Tests/badge.svg?branch=master)](https://github.com/executablebooks/mdurl/actions?query=workflow%3ATests+branch%3Amaster+event%3Apush)
27
+ [![codecov.io](https://codecov.io/gh/executablebooks/mdurl/branch/master/graph/badge.svg)](https://codecov.io/gh/executablebooks/mdurl)
28
+ [![PyPI version](https://img.shields.io/pypi/v/mdurl)](https://pypi.org/project/mdurl)
29
+
30
+ This is a Python port of the JavaScript [mdurl](https://www.npmjs.com/package/mdurl) package.
31
+ See the [upstream README.md file](https://github.com/markdown-it/mdurl/blob/master/README.md) for API documentation.
32
+
.cache/pip/http-v2/b/1/f/5/d/b1f5dc01896eee598e8915be35e61304ad2b16363d00711f8576642c ADDED
Binary file (1.86 kB). View file
 
.cache/pip/http-v2/b/3/6/c/0/b36c03663a3f9be503a38ab3381e55a1c5e2392e9271c976f5e2b956 ADDED
Binary file (1.22 kB). View file
 
.cache/pip/http-v2/b/3/6/c/0/b36c03663a3f9be503a38ab3381e55a1c5e2392e9271c976f5e2b956.body ADDED
@@ -0,0 +1,479 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: rich
3
+ Version: 15.0.0
4
+ Summary: Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal
5
+ License: MIT
6
+ License-File: LICENSE
7
+ Author: Will McGugan
8
+ Author-email: willmcgugan@gmail.com
9
+ Requires-Python: >=3.9.0
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Environment :: Console
12
+ Classifier: Framework :: IPython
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Operating System :: Microsoft :: Windows
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Programming Language :: Python :: 3.14
25
+ Classifier: Typing :: Typed
26
+ Provides-Extra: jupyter
27
+ Requires-Dist: ipywidgets (>=7.5.1,<9) ; extra == "jupyter"
28
+ Requires-Dist: markdown-it-py (>=2.2.0)
29
+ Requires-Dist: pygments (>=2.13.0,<3.0.0)
30
+ Project-URL: Documentation, https://rich.readthedocs.io/en/latest/
31
+ Project-URL: Homepage, https://github.com/Textualize/rich
32
+ Description-Content-Type: text/markdown
33
+
34
+ [![Supported Python Versions](https://img.shields.io/pypi/pyversions/rich)](https://pypi.org/project/rich/) [![PyPI version](https://badge.fury.io/py/rich.svg)](https://badge.fury.io/py/rich)
35
+
36
+ [![Downloads](https://pepy.tech/badge/rich/month)](https://pepy.tech/project/rich)
37
+ [![codecov](https://img.shields.io/codecov/c/github/Textualize/rich?label=codecov&logo=codecov)](https://codecov.io/gh/Textualize/rich)
38
+ [![Rich blog](https://img.shields.io/badge/blog-rich%20news-yellowgreen)](https://www.willmcgugan.com/tag/rich/)
39
+ [![Twitter Follow](https://img.shields.io/twitter/follow/willmcgugan.svg?style=social)](https://twitter.com/willmcgugan)
40
+
41
+ ![Logo](https://github.com/textualize/rich/raw/master/imgs/logo.svg)
42
+
43
+ [English readme](https://github.com/textualize/rich/blob/master/README.md)
44
+ • [简体中文 readme](https://github.com/textualize/rich/blob/master/README.cn.md)
45
+ • [正體中文 readme](https://github.com/textualize/rich/blob/master/README.zh-tw.md)
46
+ • [Lengua española readme](https://github.com/textualize/rich/blob/master/README.es.md)
47
+ • [Deutsche readme](https://github.com/textualize/rich/blob/master/README.de.md)
48
+ • [Läs på svenska](https://github.com/textualize/rich/blob/master/README.sv.md)
49
+ • [日本語 readme](https://github.com/textualize/rich/blob/master/README.ja.md)
50
+ • [한국어 readme](https://github.com/textualize/rich/blob/master/README.kr.md)
51
+ • [Français readme](https://github.com/textualize/rich/blob/master/README.fr.md)
52
+ • [Schwizerdütsch readme](https://github.com/textualize/rich/blob/master/README.de-ch.md)
53
+ • [हिन्दी readme](https://github.com/textualize/rich/blob/master/README.hi.md)
54
+ • [Português brasileiro readme](https://github.com/textualize/rich/blob/master/README.pt-br.md)
55
+ • [Italian readme](https://github.com/textualize/rich/blob/master/README.it.md)
56
+ • [Русский readme](https://github.com/textualize/rich/blob/master/README.ru.md)
57
+ • [Indonesian readme](https://github.com/textualize/rich/blob/master/README.id.md)
58
+ • [فارسی readme](https://github.com/textualize/rich/blob/master/README.fa.md)
59
+ • [Türkçe readme](https://github.com/textualize/rich/blob/master/README.tr.md)
60
+ • [Polskie readme](https://github.com/textualize/rich/blob/master/README.pl.md)
61
+
62
+
63
+ Rich is a Python library for _rich_ text and beautiful formatting in the terminal.
64
+
65
+ The [Rich API](https://rich.readthedocs.io/en/latest/) makes it easy to add color and style to terminal output. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more — out of the box.
66
+
67
+ ![Features](https://github.com/textualize/rich/raw/master/imgs/features.png)
68
+
69
+ For a video introduction to Rich see [calmcode.io](https://calmcode.io/rich/introduction.html) by [@fishnets88](https://twitter.com/fishnets88).
70
+
71
+ See what [people are saying about Rich](https://www.willmcgugan.com/blog/pages/post/rich-tweets/).
72
+
73
+ ## Compatibility
74
+
75
+ Rich works with Linux, macOS and Windows. True color / emoji works with new Windows Terminal, classic terminal is limited to 16 colors. Rich requires Python 3.8 or later.
76
+
77
+ Rich works with [Jupyter notebooks](https://jupyter.org/) with no additional configuration required.
78
+
79
+ ## Installing
80
+
81
+ Install with `pip` or your favorite PyPI package manager.
82
+
83
+ ```sh
84
+ python -m pip install rich
85
+ ```
86
+
87
+ Run the following to test Rich output on your terminal:
88
+
89
+ ```sh
90
+ python -m rich
91
+ ```
92
+
93
+ ## Rich Print
94
+
95
+ To effortlessly add rich output to your application, you can import the [rich print](https://rich.readthedocs.io/en/latest/introduction.html#quick-start) method, which has the same signature as the builtin Python function. Try this:
96
+
97
+ ```python
98
+ from rich import print
99
+
100
+ print("Hello, [bold magenta]World[/bold magenta]!", ":vampire:", locals())
101
+ ```
102
+
103
+ ![Hello World](https://github.com/textualize/rich/raw/master/imgs/print.png)
104
+
105
+ ## Rich REPL
106
+
107
+ Rich can be installed in the Python REPL, so that any data structures will be pretty printed and highlighted.
108
+
109
+ ```python
110
+ >>> from rich import pretty
111
+ >>> pretty.install()
112
+ ```
113
+
114
+ ![REPL](https://github.com/textualize/rich/raw/master/imgs/repl.png)
115
+
116
+ ## Using the Console
117
+
118
+ For more control over rich terminal content, import and construct a [Console](https://rich.readthedocs.io/en/latest/reference/console.html#rich.console.Console) object.
119
+
120
+ ```python
121
+ from rich.console import Console
122
+
123
+ console = Console()
124
+ ```
125
+
126
+ The Console object has a `print` method which has an intentionally similar interface to the builtin `print` function. Here's an example of use:
127
+
128
+ ```python
129
+ console.print("Hello", "World!")
130
+ ```
131
+
132
+ As you might expect, this will print `"Hello World!"` to the terminal. Note that unlike the builtin `print` function, Rich will word-wrap your text to fit within the terminal width.
133
+
134
+ There are a few ways of adding color and style to your output. You can set a style for the entire output by adding a `style` keyword argument. Here's an example:
135
+
136
+ ```python
137
+ console.print("Hello", "World!", style="bold red")
138
+ ```
139
+
140
+ The output will be something like the following:
141
+
142
+ ![Hello World](https://github.com/textualize/rich/raw/master/imgs/hello_world.png)
143
+
144
+ That's fine for styling a line of text at a time. For more finely grained styling, Rich renders a special markup which is similar in syntax to [bbcode](https://en.wikipedia.org/wiki/BBCode). Here's an example:
145
+
146
+ ```python
147
+ console.print("Where there is a [bold cyan]Will[/bold cyan] there [u]is[/u] a [i]way[/i].")
148
+ ```
149
+
150
+ ![Console Markup](https://github.com/textualize/rich/raw/master/imgs/where_there_is_a_will.png)
151
+
152
+ You can use a Console object to generate sophisticated output with minimal effort. See the [Console API](https://rich.readthedocs.io/en/latest/console.html) docs for details.
153
+
154
+ ## Rich Inspect
155
+
156
+ Rich has an [inspect](https://rich.readthedocs.io/en/latest/reference/init.html?highlight=inspect#rich.inspect) function which can produce a report on any Python object, such as class, instance, or builtin.
157
+
158
+ ```python
159
+ >>> my_list = ["foo", "bar"]
160
+ >>> from rich import inspect
161
+ >>> inspect(my_list, methods=True)
162
+ ```
163
+
164
+ ![Log](https://github.com/textualize/rich/raw/master/imgs/inspect.png)
165
+
166
+ See the [inspect docs](https://rich.readthedocs.io/en/latest/reference/init.html#rich.inspect) for details.
167
+
168
+ # Rich Library
169
+
170
+ Rich contains a number of builtin _renderables_ you can use to create elegant output in your CLI and help you debug your code.
171
+
172
+ Click the following headings for details:
173
+
174
+ <details>
175
+ <summary>Log</summary>
176
+
177
+ The Console object has a `log()` method which has a similar interface to `print()`, but also renders a column for the current time and the file and line which made the call. By default Rich will do syntax highlighting for Python structures and for repr strings. If you log a collection (i.e. a dict or a list) Rich will pretty print it so that it fits in the available space. Here's an example of some of these features.
178
+
179
+ ```python
180
+ from rich.console import Console
181
+ console = Console()
182
+
183
+ test_data = [
184
+ {"jsonrpc": "2.0", "method": "sum", "params": [None, 1, 2, 4, False, True], "id": "1",},
185
+ {"jsonrpc": "2.0", "method": "notify_hello", "params": [7]},
186
+ {"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": "2"},
187
+ ]
188
+
189
+ def test_log():
190
+ enabled = False
191
+ context = {
192
+ "foo": "bar",
193
+ }
194
+ movies = ["Deadpool", "Rise of the Skywalker"]
195
+ console.log("Hello from", console, "!")
196
+ console.log(test_data, log_locals=True)
197
+
198
+
199
+ test_log()
200
+ ```
201
+
202
+ The above produces the following output:
203
+
204
+ ![Log](https://github.com/textualize/rich/raw/master/imgs/log.png)
205
+
206
+ Note the `log_locals` argument, which outputs a table containing the local variables where the log method was called.
207
+
208
+ The log method could be used for logging to the terminal for long running applications such as servers, but is also a very nice debugging aid.
209
+
210
+ </details>
211
+ <details>
212
+ <summary>Logging Handler</summary>
213
+
214
+ You can also use the builtin [Handler class](https://rich.readthedocs.io/en/latest/logging.html) to format and colorize output from Python's logging module. Here's an example of the output:
215
+
216
+ ![Logging](https://github.com/textualize/rich/raw/master/imgs/logging.png)
217
+
218
+ </details>
219
+
220
+ <details>
221
+ <summary>Emoji</summary>
222
+
223
+ To insert an emoji in to console output place the name between two colons. Here's an example:
224
+
225
+ ```python
226
+ >>> console.print(":smiley: :vampire: :pile_of_poo: :thumbs_up: :raccoon:")
227
+ 😃 🧛 💩 👍 🦝
228
+ ```
229
+
230
+ Please use this feature wisely.
231
+
232
+ </details>
233
+
234
+ <details>
235
+ <summary>Tables</summary>
236
+
237
+ Rich can render flexible [tables](https://rich.readthedocs.io/en/latest/tables.html) with unicode box characters. There is a large variety of formatting options for borders, styles, cell alignment etc.
238
+
239
+ ![table movie](https://github.com/textualize/rich/raw/master/imgs/table_movie.gif)
240
+
241
+ The animation above was generated with [table_movie.py](https://github.com/textualize/rich/blob/master/examples/table_movie.py) in the examples directory.
242
+
243
+ Here's a simpler table example:
244
+
245
+ ```python
246
+ from rich.console import Console
247
+ from rich.table import Table
248
+
249
+ console = Console()
250
+
251
+ table = Table(show_header=True, header_style="bold magenta")
252
+ table.add_column("Date", style="dim", width=12)
253
+ table.add_column("Title")
254
+ table.add_column("Production Budget", justify="right")
255
+ table.add_column("Box Office", justify="right")
256
+ table.add_row(
257
+ "Dec 20, 2019", "Star Wars: The Rise of Skywalker", "$275,000,000", "$375,126,118"
258
+ )
259
+ table.add_row(
260
+ "May 25, 2018",
261
+ "[red]Solo[/red]: A Star Wars Story",
262
+ "$275,000,000",
263
+ "$393,151,347",
264
+ )
265
+ table.add_row(
266
+ "Dec 15, 2017",
267
+ "Star Wars Ep. VIII: The Last Jedi",
268
+ "$262,000,000",
269
+ "[bold]$1,332,539,889[/bold]",
270
+ )
271
+
272
+ console.print(table)
273
+ ```
274
+
275
+ This produces the following output:
276
+
277
+ ![table](https://github.com/textualize/rich/raw/master/imgs/table.png)
278
+
279
+ Note that console markup is rendered in the same way as `print()` and `log()`. In fact, anything that is renderable by Rich may be included in the headers / rows (even other tables).
280
+
281
+ The `Table` class is smart enough to resize columns to fit the available width of the terminal, wrapping text as required. Here's the same example, with the terminal made smaller than the table above:
282
+
283
+ ![table2](https://github.com/textualize/rich/raw/master/imgs/table2.png)
284
+
285
+ </details>
286
+
287
+ <details>
288
+ <summary>Progress Bars</summary>
289
+
290
+ Rich can render multiple flicker-free [progress](https://rich.readthedocs.io/en/latest/progress.html) bars to track long-running tasks.
291
+
292
+ For basic usage, wrap any sequence in the `track` function and iterate over the result. Here's an example:
293
+
294
+ ```python
295
+ from rich.progress import track
296
+
297
+ for step in track(range(100)):
298
+ do_step(step)
299
+ ```
300
+
301
+ It's not much harder to add multiple progress bars. Here's an example taken from the docs:
302
+
303
+ ![progress](https://github.com/textualize/rich/raw/master/imgs/progress.gif)
304
+
305
+ The columns may be configured to show any details you want. Built-in columns include percentage complete, file size, file speed, and time remaining. Here's another example showing a download in progress:
306
+
307
+ ![progress](https://github.com/textualize/rich/raw/master/imgs/downloader.gif)
308
+
309
+ To try this out yourself, see [examples/downloader.py](https://github.com/textualize/rich/blob/master/examples/downloader.py) which can download multiple URLs simultaneously while displaying progress.
310
+
311
+ </details>
312
+
313
+ <details>
314
+ <summary>Status</summary>
315
+
316
+ For situations where it is hard to calculate progress, you can use the [status](https://rich.readthedocs.io/en/latest/reference/console.html#rich.console.Console.status) method which will display a 'spinner' animation and message. The animation won't prevent you from using the console as normal. Here's an example:
317
+
318
+ ```python
319
+ from time import sleep
320
+ from rich.console import Console
321
+
322
+ console = Console()
323
+ tasks = [f"task {n}" for n in range(1, 11)]
324
+
325
+ with console.status("[bold green]Working on tasks...") as status:
326
+ while tasks:
327
+ task = tasks.pop(0)
328
+ sleep(1)
329
+ console.log(f"{task} complete")
330
+ ```
331
+
332
+ This generates the following output in the terminal.
333
+
334
+ ![status](https://github.com/textualize/rich/raw/master/imgs/status.gif)
335
+
336
+ The spinner animations were borrowed from [cli-spinners](https://www.npmjs.com/package/cli-spinners). You can select a spinner by specifying the `spinner` parameter. Run the following command to see the available values:
337
+
338
+ ```
339
+ python -m rich.spinner
340
+ ```
341
+
342
+ The above command generates the following output in the terminal:
343
+
344
+ ![spinners](https://github.com/textualize/rich/raw/master/imgs/spinners.gif)
345
+
346
+ </details>
347
+
348
+ <details>
349
+ <summary>Tree</summary>
350
+
351
+ Rich can render a [tree](https://rich.readthedocs.io/en/latest/tree.html) with guide lines. A tree is ideal for displaying a file structure, or any other hierarchical data.
352
+
353
+ The labels of the tree can be simple text or anything else Rich can render. Run the following for a demonstration:
354
+
355
+ ```
356
+ python -m rich.tree
357
+ ```
358
+
359
+ This generates the following output:
360
+
361
+ ![markdown](https://github.com/textualize/rich/raw/master/imgs/tree.png)
362
+
363
+ See the [tree.py](https://github.com/textualize/rich/blob/master/examples/tree.py) example for a script that displays a tree view of any directory, similar to the linux `tree` command.
364
+
365
+ </details>
366
+
367
+ <details>
368
+ <summary>Columns</summary>
369
+
370
+ Rich can render content in neat [columns](https://rich.readthedocs.io/en/latest/columns.html) with equal or optimal width. Here's a very basic clone of the (MacOS / Linux) `ls` command which displays a directory listing in columns:
371
+
372
+ ```python
373
+ import os
374
+ import sys
375
+
376
+ from rich import print
377
+ from rich.columns import Columns
378
+
379
+ directory = os.listdir(sys.argv[1])
380
+ print(Columns(directory))
381
+ ```
382
+
383
+ The following screenshot is the output from the [columns example](https://github.com/textualize/rich/blob/master/examples/columns.py) which displays data pulled from an API in columns:
384
+
385
+ ![columns](https://github.com/textualize/rich/raw/master/imgs/columns.png)
386
+
387
+ </details>
388
+
389
+ <details>
390
+ <summary>Markdown</summary>
391
+
392
+ Rich can render [markdown](https://rich.readthedocs.io/en/latest/markdown.html) and does a reasonable job of translating the formatting to the terminal.
393
+
394
+ To render markdown import the `Markdown` class and construct it with a string containing markdown code. Then print it to the console. Here's an example:
395
+
396
+ ```python
397
+ from rich.console import Console
398
+ from rich.markdown import Markdown
399
+
400
+ console = Console()
401
+ with open("README.md") as readme:
402
+ markdown = Markdown(readme.read())
403
+ console.print(markdown)
404
+ ```
405
+
406
+ This will produce output something like the following:
407
+
408
+ ![markdown](https://github.com/textualize/rich/raw/master/imgs/markdown.png)
409
+
410
+ </details>
411
+
412
+ <details>
413
+ <summary>Syntax Highlighting</summary>
414
+
415
+ Rich uses the [pygments](https://pygments.org/) library to implement [syntax highlighting](https://rich.readthedocs.io/en/latest/syntax.html). Usage is similar to rendering markdown; construct a `Syntax` object and print it to the console. Here's an example:
416
+
417
+ ```python
418
+ from rich.console import Console
419
+ from rich.syntax import Syntax
420
+
421
+ my_code = '''
422
+ def iter_first_last(values: Iterable[T]) -> Iterable[Tuple[bool, bool, T]]:
423
+ """Iterate and generate a tuple with a flag for first and last value."""
424
+ iter_values = iter(values)
425
+ try:
426
+ previous_value = next(iter_values)
427
+ except StopIteration:
428
+ return
429
+ first = True
430
+ for value in iter_values:
431
+ yield first, False, previous_value
432
+ first = False
433
+ previous_value = value
434
+ yield first, True, previous_value
435
+ '''
436
+ syntax = Syntax(my_code, "python", theme="monokai", line_numbers=True)
437
+ console = Console()
438
+ console.print(syntax)
439
+ ```
440
+
441
+ This will produce the following output:
442
+
443
+ ![syntax](https://github.com/textualize/rich/raw/master/imgs/syntax.png)
444
+
445
+ </details>
446
+
447
+ <details>
448
+ <summary>Tracebacks</summary>
449
+
450
+ Rich can render [beautiful tracebacks](https://rich.readthedocs.io/en/latest/traceback.html) which are easier to read and show more code than standard Python tracebacks. You can set Rich as the default traceback handler so all uncaught exceptions will be rendered by Rich.
451
+
452
+ Here's what it looks like on OSX (similar on Linux):
453
+
454
+ ![traceback](https://github.com/textualize/rich/raw/master/imgs/traceback.png)
455
+
456
+ </details>
457
+
458
+ All Rich renderables make use of the [Console Protocol](https://rich.readthedocs.io/en/latest/protocol.html), which you can also use to implement your own Rich content.
459
+
460
+ # Rich CLI
461
+
462
+
463
+ See also [Rich CLI](https://github.com/textualize/rich-cli) for a command line application powered by Rich. Syntax highlight code, render markdown, display CSVs in tables, and more, directly from the command prompt.
464
+
465
+
466
+ ![Rich CLI](https://raw.githubusercontent.com/Textualize/rich-cli/main/imgs/rich-cli-splash.jpg)
467
+
468
+ # Textual
469
+
470
+ See also Rich's sister project, [Textual](https://github.com/Textualize/textual), which you can use to build sophisticated User Interfaces in the terminal.
471
+
472
+ ![textual-splash](https://github.com/user-attachments/assets/4caeb77e-48c0-4cf7-b14d-c53ded855ffd)
473
+
474
+ # Toad
475
+
476
+ [Toad](https://github.com/batrachianai/toad) is a unified interface for agentic coding. Built with Rich and Textual.
477
+
478
+ ![toad](https://github.com/user-attachments/assets/6678b707-1aeb-420f-99ad-abfcd4356771)
479
+