text-discoloration 1.0.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (shiroko)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.4
2
+ Name: text_discoloration
3
+ Version: 1.0.0
4
+ Summary: Typewriter effect with colorful output, support random color and custom color.
5
+ Author: shiroko
6
+ Author-email: 3207774253@qq.com
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.6
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Dynamic: author
13
+ Dynamic: author-email
14
+ Dynamic: classifier
15
+ Dynamic: description
16
+ Dynamic: description-content-type
17
+ Dynamic: license-file
18
+ Dynamic: requires-python
19
+ Dynamic: summary
20
+
21
+ # text_discoloration
22
+ Simple python library for colorful text and typewriter effect
23
+
24
+ ## Introduction
25
+ Create colored text output and simulated typewriter display on terminal.
26
+ Support random color and personalized custom color.
27
+
28
+ ## Features
29
+ - Character by character typewriter display
30
+ - Auto random text color
31
+ - Manual set fixed color
32
+ - Easy and quick to use
33
+ - Work on personal computer and mobile terminal
@@ -0,0 +1,13 @@
1
+ # text_discoloration
2
+ Simple python library for colorful text and typewriter effect
3
+
4
+ ## Introduction
5
+ Create colored text output and simulated typewriter display on terminal.
6
+ Support random color and personalized custom color.
7
+
8
+ ## Features
9
+ - Character by character typewriter display
10
+ - Auto random text color
11
+ - Manual set fixed color
12
+ - Easy and quick to use
13
+ - Work on personal computer and mobile terminal
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,17 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="text_discoloration",
5
+ version="1.0.0",
6
+ author="shiroko",
7
+ author_email="3207774253@qq.com",
8
+ description="Typewriter effect with colorful output, support random color and custom color.",
9
+ long_description=open("README.md",encoding="utf-8").read(),
10
+ long_description_content_type="text/markdown",
11
+ packages=find_packages(),
12
+ classifiers=[
13
+ "Programming Language :: Python :: 3",
14
+ "Operating System :: OS Independent",
15
+ ],
16
+ python_requires=">=3.6"
17
+ )
@@ -0,0 +1,5 @@
1
+ from .core import slow_print,typewriter,color_typewriter,random_typewriter
2
+ from .core import red_text,green_text,yellow_text,blue_text,purple_text,cyan_text,white_text
3
+ from .core import typewriter_red,typewriter_green,typewriter_yellow
4
+ from .core import typewriter_blue,typewriter_purple,typewriter_cyan
5
+ from .core import typewriter_white
@@ -0,0 +1,179 @@
1
+ import time
2
+ import random
3
+ import sys
4
+ import platform
5
+ import os
6
+
7
+ COLORS = {
8
+ "red": "\033[91m",
9
+ "dark_red": "\033[31m",
10
+ "green": "\033[92m",
11
+ "dark_green": "\033[32m",
12
+ "yellow": "\033[93m",
13
+ "dark_yellow": "\033[33m",
14
+ "blue": "\033[94m",
15
+ "dark_blue": "\033[34m",
16
+ "purple": "\033[95m",
17
+ "dark_purple": "\033[35m",
18
+ "cyan": "\033[96m",
19
+ "dark_cyan": "\033[36m",
20
+ "white": "\033[97m",
21
+ "gray": "\033[90m"
22
+ }
23
+ END = "\033[0m"
24
+ ALL_COLOR_POOL = list(COLORS.values())
25
+
26
+ if platform.system() == "Windows":
27
+ os.system("reg add HKCU\\Console /v VirtualTerminalLevel /t REG_DWORD /d 1 /f")
28
+
29
+
30
+ def slow_print(text, delay=0.5):
31
+ print(text)
32
+ time.sleep(delay)
33
+
34
+
35
+ def typewriter(text, delay=0.05):
36
+ for ch in text:
37
+ sys.stdout.write(ch)
38
+ sys.stdout.flush()
39
+ time.sleep(delay)
40
+ print()
41
+
42
+
43
+ def color_typewriter(text, color="red", delay=0.05):
44
+ use_color = COLORS.get(color, COLORS["white"])
45
+ for ch in text:
46
+ sys.stdout.write(use_color + ch)
47
+ sys.stdout.flush()
48
+ time.sleep(delay)
49
+ print(END)
50
+
51
+
52
+ def random_typewriter(text, delay=0.05):
53
+ for ch in text:
54
+ ran_c = random.choice(ALL_COLOR_POOL)
55
+ sys.stdout.write(ran_c + ch)
56
+ sys.stdout.flush()
57
+ time.sleep(delay)
58
+ print(END)
59
+
60
+
61
+ def typewriter_red(text, delay=0.05):
62
+ color_typewriter(text, color="red", delay=delay)
63
+
64
+ def typewriter_green(text, delay=0.05):
65
+ color_typewriter(text, color="green", delay=delay)
66
+
67
+ def typewriter_yellow(text, delay=0.05):
68
+ color_typewriter(text, color="yellow", delay=delay)
69
+
70
+ def typewriter_blue(text, delay=0.05):
71
+ color_typewriter(text, color="blue", delay=delay)
72
+
73
+ def typewriter_purple(text, delay=0.05):
74
+ color_typewriter(text, color="purple", delay=delay)
75
+
76
+ def typewriter_cyan(text, delay=0.05):
77
+ color_typewriter(text, color="cyan", delay=delay)
78
+
79
+ def typewriter_white(text, delay=0.05):
80
+ color_typewriter(text, color="white", delay=delay)
81
+
82
+ def typewriter_gray(text, delay=0.05):
83
+ color_typewriter(text, color="gray", delay=delay)
84
+
85
+ def typewriter_dark_red(text, delay=0.05):
86
+ color_typewriter(text, color="dark_red", delay=delay)
87
+
88
+ def typewriter_dark_green(text, delay=0.05):
89
+ color_typewriter(text, color="dark_green", delay=delay)
90
+
91
+ def typewriter_dark_yellow(text, delay=0.05):
92
+ color_typewriter(text, color="dark_yellow", delay=delay)
93
+
94
+ def typewriter_dark_blue(text, delay=0.05):
95
+ color_typewriter(text, color="dark_blue", delay=delay)
96
+
97
+ def typewriter_dark_purple(text, delay=0.05):
98
+ color_typewriter(text, color="dark_purple", delay=delay)
99
+
100
+ def typewriter_dark_cyan(text, delay=0.05):
101
+ color_typewriter(text, color="dark_cyan", delay=delay)
102
+
103
+
104
+ def red_text(text):
105
+ print(f"{COLORS['red']}{text}{END}")
106
+
107
+ def green_text(text):
108
+ print(f"{COLORS['green']}{text}{END}")
109
+
110
+ def yellow_text(text):
111
+ print(f"{COLORS['yellow']}{text}{END}")
112
+
113
+ def blue_text(text):
114
+ print(f"{COLORS['blue']}{text}{END}")
115
+
116
+ def purple_text(text):
117
+ print(f"{COLORS['purple']}{text}{END}")
118
+
119
+ def cyan_text(text):
120
+ print(f"{COLORS['cyan']}{text}{END}")
121
+
122
+ def white_text(text):
123
+ print(f"{COLORS['white']}{text}{END}")
124
+
125
+ def gray_text(text):
126
+ print(f"{COLORS['gray']}{text}{END}")
127
+
128
+ def dark_red_text(text):
129
+ print(f"{COLORS['dark_red']}{text}{END}")
130
+
131
+ def dark_green_text(text):
132
+ print(f"{COLORS['dark_green']}{text}{END}")
133
+
134
+ def dark_yellow_text(text):
135
+ print(f"{COLORS['dark_yellow']}{text}{END}")
136
+
137
+ def dark_blue_text(text):
138
+ print(f"{COLORS['dark_blue']}{text}{END}")
139
+
140
+ def dark_purple_text(text):
141
+ print(f"{COLORS['dark_purple']}{text}{END}")
142
+
143
+ def dark_cyan_text(text):
144
+ print(f"{COLORS['dark_cyan']}{text}{END}")
145
+
146
+ __all__ = [
147
+ "slow_print",
148
+ "typewriter",
149
+ "color_typewriter",
150
+ "random_typewriter",
151
+ "typewriter_red",
152
+ "typewriter_green",
153
+ "typewriter_yellow",
154
+ "typewriter_blue",
155
+ "typewriter_purple",
156
+ "typewriter_cyan",
157
+ "typewriter_white",
158
+ "typewriter_gray",
159
+ "typewriter_dark_red",
160
+ "typewriter_dark_green",
161
+ "typewriter_dark_yellow",
162
+ "typewriter_dark_blue",
163
+ "typewriter_dark_purple",
164
+ "typewriter_dark_cyan",
165
+ "red_text",
166
+ "green_text",
167
+ "yellow_text",
168
+ "blue_text",
169
+ "purple_text",
170
+ "cyan_text",
171
+ "white_text",
172
+ "gray_text",
173
+ "dark_red_text",
174
+ "dark_green_text",
175
+ "dark_yellow_text",
176
+ "dark_blue_text",
177
+ "dark_purple_text",
178
+ "dark_cyan_text"
179
+ ]
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.4
2
+ Name: text_discoloration
3
+ Version: 1.0.0
4
+ Summary: Typewriter effect with colorful output, support random color and custom color.
5
+ Author: shiroko
6
+ Author-email: 3207774253@qq.com
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.6
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Dynamic: author
13
+ Dynamic: author-email
14
+ Dynamic: classifier
15
+ Dynamic: description
16
+ Dynamic: description-content-type
17
+ Dynamic: license-file
18
+ Dynamic: requires-python
19
+ Dynamic: summary
20
+
21
+ # text_discoloration
22
+ Simple python library for colorful text and typewriter effect
23
+
24
+ ## Introduction
25
+ Create colored text output and simulated typewriter display on terminal.
26
+ Support random color and personalized custom color.
27
+
28
+ ## Features
29
+ - Character by character typewriter display
30
+ - Auto random text color
31
+ - Manual set fixed color
32
+ - Easy and quick to use
33
+ - Work on personal computer and mobile terminal
@@ -0,0 +1,9 @@
1
+ LICENSE
2
+ README.md
3
+ setup.py
4
+ text_discoloration/__init__.py
5
+ text_discoloration/core.py
6
+ text_discoloration.egg-info/PKG-INFO
7
+ text_discoloration.egg-info/SOURCES.txt
8
+ text_discoloration.egg-info/dependency_links.txt
9
+ text_discoloration.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ text_discoloration