PyAnimCLI 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
File without changes
@@ -0,0 +1,21 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyAnimCLI
3
+ Version: 0.1.0
4
+ Summary: Animações de terminal em Python (progress bar, spinner, loaders)
5
+ Author-email: João <joao6ag@gmail.com>
6
+ License: MIT
7
+ Keywords: terminal,animation,progressbar,cli
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Dynamic: license-file
14
+
15
+ # PyAnim
16
+
17
+ Lib de animações para terminal em Python.
18
+
19
+ ## Instalação
20
+ ```bash
21
+ pip install PyAnim
@@ -0,0 +1,2 @@
1
+ from .progressbar import ProgressBar
2
+ from .charani import CharAni
@@ -0,0 +1,32 @@
1
+ import sys
2
+ import time
3
+ import threading
4
+
5
+ class CharAni:
6
+ def __init__(self, sequence, looping=True, speed=0.1):
7
+ self.sequence = sequence
8
+ self.looping = looping
9
+ self.speed = speed
10
+ self._running = False
11
+
12
+ def start(self, text=""):
13
+ self._running = True
14
+
15
+ def run():
16
+ i = 0
17
+ while self._running:
18
+ char = self.sequence[i % len(self.sequence)]
19
+ sys.stdout.write(f"\r{text} {char}")
20
+ sys.stdout.flush()
21
+ i += 1
22
+ time.sleep(self.speed)
23
+ if not self.looping and i >= len(self.sequence):
24
+ break
25
+
26
+ self.thread = threading.Thread(target=run)
27
+ self.thread.start()
28
+
29
+ def stop(self):
30
+ self._running = False
31
+ self.thread.join()
32
+ print()
@@ -0,0 +1,65 @@
1
+ import sys
2
+ import time
3
+ import importlib
4
+
5
+ class ProgressBar:
6
+
7
+ # ===============================
8
+ # 🔹 ImportLib (real)
9
+ # ===============================
10
+ class ImportLib:
11
+ def __init__(self, speed: float, libs: list[str]):
12
+ self.speed = speed
13
+ self.libs = libs
14
+ self.total = len(libs)
15
+
16
+ def _draw(self, current, size=30):
17
+ percent = current / self.total
18
+ filled = int(size * percent)
19
+ bar = "█" * filled + "-" * (size - filled)
20
+ sys.stdout.write(
21
+ f"\r[{bar}] {int(percent*100)}% ({current}/{self.total})"
22
+ )
23
+ sys.stdout.flush()
24
+
25
+ def start(self):
26
+ for i, lib in enumerate(self.libs, 1):
27
+ try:
28
+ importlib.import_module(lib)
29
+ time.sleep(self.speed)
30
+ except Exception as e:
31
+ sys.stdout.write(f"\n❌ {lib}: {e}\n")
32
+ self._draw(i)
33
+
34
+ print("\n✔ Imports concluídos")
35
+
36
+ # ===============================
37
+ # 🔹 Normal (fake)
38
+ # ===============================
39
+ class Normal:
40
+ def __init__(self, style="block", speed=0.05):
41
+ self.style = style
42
+ self.speed = speed
43
+
44
+ self.styles = {
45
+ "block": ("█", "-"),
46
+ "hash": ("#", "-"),
47
+ "line": ("=", " "),
48
+ }
49
+
50
+ def start(self, total=100):
51
+ fill, empty = self.styles.get(
52
+ self.style, self.styles["block"]
53
+ )
54
+
55
+ for i in range(total + 1):
56
+ percent = i / total
57
+ size = 30
58
+ filled = int(size * percent)
59
+ bar = fill * filled + empty * (size - filled)
60
+
61
+ sys.stdout.write(f"\r[{bar}] {int(percent*100)}%")
62
+ sys.stdout.flush()
63
+ time.sleep(self.speed)
64
+
65
+ print("\n✔ Finalizado")
@@ -0,0 +1,21 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyAnimCLI
3
+ Version: 0.1.0
4
+ Summary: Animações de terminal em Python (progress bar, spinner, loaders)
5
+ Author-email: João <joao6ag@gmail.com>
6
+ License: MIT
7
+ Keywords: terminal,animation,progressbar,cli
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Dynamic: license-file
14
+
15
+ # PyAnim
16
+
17
+ Lib de animações para terminal em Python.
18
+
19
+ ## Instalação
20
+ ```bash
21
+ pip install PyAnim
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ PyAni/__init__.py
5
+ PyAni/charani.py
6
+ PyAni/progressbar.py
7
+ PyAnimCLI.egg-info/PKG-INFO
8
+ PyAnimCLI.egg-info/SOURCES.txt
9
+ PyAnimCLI.egg-info/dependency_links.txt
10
+ PyAnimCLI.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ PyAni
@@ -0,0 +1,7 @@
1
+ # PyAnim
2
+
3
+ Lib de animações para terminal em Python.
4
+
5
+ ## Instalação
6
+ ```bash
7
+ pip install PyAnim
@@ -0,0 +1,19 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "PyAnimCLI"
7
+ version = "0.1.0"
8
+ description = "Animações de terminal em Python (progress bar, spinner, loaders)"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ { name="João", email="joao6ag@gmail.com" }
14
+ ]
15
+ keywords = ["terminal", "animation", "progressbar","cli"]
16
+ classifiers = [
17
+ "Programming Language :: Python :: 3",
18
+ "Operating System :: OS Independent"
19
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+