···
1
1
+
**/.DS_Store
2
2
+
**/.venv
3
3
+
**/__pycache__
···
1
1
+
# colorboy
2
2
+
3
3
+
Easily add color to your strings
4
4
+
5
5
+
# Installation
6
6
+
pip install colorboy
7
7
+
8
8
+
# Usage
9
9
+
```python
10
10
+
import colorboy as cb
11
11
+
print(cb.cyan('Globgogabgalab'))
12
12
+
13
13
+
from colorboy import cyan, red # import a specific colors, bg_colors and styles
14
14
+
print(cyan('Piz')+red('za'))
15
15
+
16
16
+
from colorboy import * # import all colors, bg_colors and styles
17
17
+
print(green('Mayonnaise'))
18
18
+
19
19
+
from colorboy.colors import * # import all colors
20
20
+
print(red('EDEN'))
21
21
+
from colorboy.bg_colors import * # import all bg_colors
22
22
+
print(black_bg('Stephen'))
23
23
+
from colorboy.styles import * # import all styles
24
24
+
print(bright('Crywolf'))
25
25
+
```
26
26
+
27
27
+
# Colors
28
28
+
These are all the color functions available through colorboy:
29
29
+
```python
30
30
+
# colors - available by importing colorboy or colorboy.colors
31
31
+
black
32
32
+
red
33
33
+
green
34
34
+
yellow
35
35
+
blue
36
36
+
magenta
37
37
+
cyan
38
38
+
white
39
39
+
40
40
+
# bg_colors - available by importing colorboy or colorboy.bg_colors
41
41
+
black_bg
42
42
+
red_bg
43
43
+
green_bg
44
44
+
yellow_bg
45
45
+
blue_bg
46
46
+
magenta_bg
47
47
+
cyan_bg
48
48
+
white_bg
49
49
+
50
50
+
# styles - available by importing colorboy or colorboy.styles
51
51
+
dim
52
52
+
bright
53
53
+
54
54
+
```
55
55
+
56
56
+
# Dev Instructions
57
57
+
### Installation
58
58
+
1. Install Python (Python 3.7 works, probably other versions too)
59
59
+
2. Install [Poetry](https://poetry.eustace.io). Poetry is used to manage dependencies, the virtual environment and publishing to PyPI, so it's worth learning.
60
60
+
3. Run `poetry install` to install Python package dependencies.
61
61
+
62
62
+
For VSCode to detect the Python virtual environment that Poetry creates, I ran `poetry config settings.virtualenvs.in-project true`. This command makes Poetry create your Python virtual environment inside the project folder. Now, you can set the `python.pythonPath` setting to `${workspaceFolder}/.venv/bin/python` in your workspace settings (or global if you want this to be the default).
···
1
1
+
from colorboy.styles import *
2
2
+
from colorboy.colors import *
3
3
+
from colorboy.bg_colors import *
···
1
1
+
import colorama
2
2
+
3
3
+
def black_bg(text): return colorama.Back.BLACK +text+colorama.Back.RESET
4
4
+
def red_bg(text): return colorama.Back.RED +text+colorama.Back.RESET
5
5
+
def green_bg(text): return colorama.Back.GREEN +text+colorama.Back.RESET
6
6
+
def yellow_bg(text): return colorama.Back.YELLOW +text+colorama.Back.RESET
7
7
+
def blue_bg(text): return colorama.Back.BLUE +text+colorama.Back.RESET
8
8
+
def magenta_bg(text): return colorama.Back.MAGENTA +text+colorama.Back.RESET
9
9
+
def cyan_bg(text): return colorama.Back.CYAN +text+colorama.Back.RESET
10
10
+
def white_bg(text): return colorama.Back.WHITE +text+colorama.Back.RESET
11
11
+
12
12
+
__all__ = [
13
13
+
'black_bg',
14
14
+
'red_bg',
15
15
+
'green_bg',
16
16
+
'yellow_bg',
17
17
+
'blue_bg',
18
18
+
'magenta_bg',
19
19
+
'cyan_bg',
20
20
+
'white_bg'
21
21
+
]
···
1
1
+
import colorama
2
2
+
3
3
+
def black(text): return colorama.Fore.BLACK +text+colorama.Fore.RESET
4
4
+
def red(text): return colorama.Fore.RED +text+colorama.Fore.RESET
5
5
+
def green(text): return colorama.Fore.GREEN +text+colorama.Fore.RESET
6
6
+
def yellow(text): return colorama.Fore.YELLOW +text+colorama.Fore.RESET
7
7
+
def blue(text): return colorama.Fore.BLUE +text+colorama.Fore.RESET
8
8
+
def magenta(text): return colorama.Fore.MAGENTA +text+colorama.Fore.RESET
9
9
+
def cyan(text): return colorama.Fore.CYAN +text+colorama.Fore.RESET
10
10
+
def white(text): return colorama.Fore.WHITE +text+colorama.Fore.RESET
11
11
+
12
12
+
__all__ = [
13
13
+
'black',
14
14
+
'red',
15
15
+
'green',
16
16
+
'yellow',
17
17
+
'blue',
18
18
+
'magenta',
19
19
+
'cyan',
20
20
+
'white'
21
21
+
]
···
1
1
+
import colorama
2
2
+
3
3
+
def dim(text): return colorama.Style.DIM +text+colorama.Style.NORMAL
4
4
+
def bright(text): return colorama.Style.BRIGHT +text+colorama.Style.NORMAL
5
5
+
6
6
+
__all__ = [
7
7
+
'dim',
8
8
+
'bright'
9
9
+
]
···
1
1
+
[[package]]
2
2
+
category = "dev"
3
3
+
description = "An abstract syntax tree for Python with inference support."
4
4
+
name = "astroid"
5
5
+
optional = false
6
6
+
platform = "*"
7
7
+
python-versions = ">=3.4.*"
8
8
+
version = "2.0.4"
9
9
+
10
10
+
[package.dependencies]
11
11
+
lazy-object-proxy = "*"
12
12
+
six = "*"
13
13
+
wrapt = "*"
14
14
+
15
15
+
[package.dependencies.typed-ast]
16
16
+
python = "<3.7"
17
17
+
version = "*"
18
18
+
19
19
+
[package.dependencies.typing]
20
20
+
python = "<3.5"
21
21
+
version = "*"
22
22
+
23
23
+
[[package]]
24
24
+
category = "main"
25
25
+
description = "Cross-platform colored terminal text."
26
26
+
name = "colorama"
27
27
+
optional = false
28
28
+
platform = "UNKNOWN"
29
29
+
python-versions = "*"
30
30
+
version = "0.3.9"
31
31
+
32
32
+
[[package]]
33
33
+
category = "dev"
34
34
+
description = "Backport of the concurrent.futures package from Python 3"
35
35
+
name = "futures"
36
36
+
optional = false
37
37
+
platform = "*"
38
38
+
python-versions = ">=2.6, <3"
39
39
+
version = "3.2.0"
40
40
+
41
41
+
[package.requirements]
42
42
+
python = ">=2.7,<2.8"
43
43
+
44
44
+
[[package]]
45
45
+
category = "dev"
46
46
+
description = "A Python utility / library to sort Python imports."
47
47
+
name = "isort"
48
48
+
optional = false
49
49
+
platform = "*"
50
50
+
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
51
51
+
version = "4.3.4"
52
52
+
53
53
+
[package.dependencies]
54
54
+
[package.dependencies.futures]
55
55
+
python = ">=2.7,<2.8"
56
56
+
version = "*"
57
57
+
58
58
+
[[package]]
59
59
+
category = "dev"
60
60
+
description = "A fast and thorough lazy object proxy."
61
61
+
name = "lazy-object-proxy"
62
62
+
optional = false
63
63
+
platform = "*"
64
64
+
python-versions = "*"
65
65
+
version = "1.3.1"
66
66
+
67
67
+
[[package]]
68
68
+
category = "dev"
69
69
+
description = "McCabe checker, plugin for flake8"
70
70
+
name = "mccabe"
71
71
+
optional = false
72
72
+
platform = "*"
73
73
+
python-versions = "*"
74
74
+
version = "0.6.1"
75
75
+
76
76
+
[[package]]
77
77
+
category = "dev"
78
78
+
description = "python code static checker"
79
79
+
name = "pylint"
80
80
+
optional = false
81
81
+
platform = "*"
82
82
+
python-versions = ">=3.4.*"
83
83
+
version = "2.1.1"
84
84
+
85
85
+
[package.dependencies]
86
86
+
astroid = ">=2.0.0"
87
87
+
isort = ">=4.2.5"
88
88
+
mccabe = "*"
89
89
+
90
90
+
[package.dependencies.colorama]
91
91
+
platform = "win32"
92
92
+
version = "*"
93
93
+
94
94
+
[[package]]
95
95
+
category = "dev"
96
96
+
description = "Python 2 and 3 compatibility utilities"
97
97
+
name = "six"
98
98
+
optional = false
99
99
+
platform = "*"
100
100
+
python-versions = "*"
101
101
+
version = "1.11.0"
102
102
+
103
103
+
[[package]]
104
104
+
category = "dev"
105
105
+
description = "a fork of Python 2 and 3 ast modules with type comment support"
106
106
+
name = "typed-ast"
107
107
+
optional = false
108
108
+
platform = "POSIX"
109
109
+
python-versions = "*"
110
110
+
version = "1.1.0"
111
111
+
112
112
+
[package.requirements]
113
113
+
python = "<3.7"
114
114
+
115
115
+
[[package]]
116
116
+
category = "dev"
117
117
+
description = "Type Hints for Python"
118
118
+
name = "typing"
119
119
+
optional = false
120
120
+
platform = "*"
121
121
+
python-versions = "*"
122
122
+
version = "3.6.6"
123
123
+
124
124
+
[package.requirements]
125
125
+
python = "<3.5"
126
126
+
127
127
+
[[package]]
128
128
+
category = "dev"
129
129
+
description = "Module for decorators, wrappers and monkey patching."
130
130
+
name = "wrapt"
131
131
+
optional = false
132
132
+
platform = "*"
133
133
+
python-versions = "*"
134
134
+
version = "1.10.11"
135
135
+
136
136
+
[metadata]
137
137
+
content-hash = "314af9a2da720c0ed12f8b8a9a0f395b9073915cf3accfcceb7b2ba673f65df9"
138
138
+
platform = "*"
139
139
+
python-versions = "*"
140
140
+
141
141
+
[metadata.hashes]
142
142
+
astroid = ["292fa429e69d60e4161e7612cb7cc8fa3609e2e309f80c224d93a76d5e7b58be", "c7013d119ec95eb626f7a2011f0b63d0c9a095df9ad06d8507b37084eada1a8d"]
143
143
+
colorama = ["463f8483208e921368c9f306094eb6f725c6ca42b0f97e313cb5d5512459feda", "48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1"]
144
144
+
futures = ["9ec02aa7d674acb8618afb127e27fde7fc68994c0437ad759fa094a574adb265", "ec0a6cb848cc212002b9828c3e34c675e0c9ff6741dc445cab6fdd4e1085d1f1"]
145
145
+
isort = ["1153601da39a25b14ddc54955dbbacbb6b2d19135386699e2ad58517953b34af", "b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8", "ec9ef8f4a9bc6f71eec99e1806bfa2de401650d996c59330782b89a5555c1497"]
146
146
+
lazy-object-proxy = ["0ce34342b419bd8f018e6666bfef729aec3edf62345a53b537a4dcc115746a33", "1b668120716eb7ee21d8a38815e5eb3bb8211117d9a90b0f8e21722c0758cc39", "209615b0fe4624d79e50220ce3310ca1a9445fd8e6d3572a896e7f9146bbf019", "27bf62cb2b1a2068d443ff7097ee33393f8483b570b475db8ebf7e1cba64f088", "27ea6fd1c02dcc78172a82fc37fcc0992a94e4cecf53cb6d73f11749825bd98b", "2c1b21b44ac9beb0fc848d3993924147ba45c4ebc24be19825e57aabbe74a99e", "2df72ab12046a3496a92476020a1a0abf78b2a7db9ff4dc2036b8dd980203ae6", "320ffd3de9699d3892048baee45ebfbbf9388a7d65d832d7e580243ade426d2b", "50e3b9a464d5d08cc5227413db0d1c4707b6172e4d4d915c1c70e4de0bbff1f5", "5276db7ff62bb7b52f77f1f51ed58850e315154249aceb42e7f4c611f0f847ff", "61a6cf00dcb1a7f0c773ed4acc509cb636af2d6337a08f362413c76b2b47a8dd", "6ae6c4cb59f199d8827c5a07546b2ab7e85d262acaccaacd49b62f53f7c456f7", "7661d401d60d8bf15bb5da39e4dd72f5d764c5aff5a86ef52a042506e3e970ff", "7bd527f36a605c914efca5d3d014170b2cb184723e423d26b1fb2fd9108e264d", "7cb54db3535c8686ea12e9535eb087d32421184eacc6939ef15ef50f83a5e7e2", "7f3a2d740291f7f2c111d86a1c4851b70fb000a6c8883a59660d95ad57b9df35", "81304b7d8e9c824d058087dcb89144842c8e0dea6d281c031f59f0acf66963d4", "933947e8b4fbe617a51528b09851685138b49d511af0b6c0da2539115d6d4514", "94223d7f060301b3a8c09c9b3bc3294b56b2188e7d8179c762a1cda72c979252", "ab3ca49afcb47058393b0122428358d2fbe0408cf99f1b58b295cfeb4ed39109", "bd6292f565ca46dee4e737ebcc20742e3b5be2b01556dafe169f6c65d088875f", "cb924aa3e4a3fb644d0c463cad5bc2572649a6a3f68a7f8e4fbe44aaa6d77e4c", "d0fc7a286feac9077ec52a927fc9fe8fe2fabab95426722be4c953c9a8bede92", "ddc34786490a6e4ec0a855d401034cbd1242ef186c20d79d2166d6a4bd449577", "e34b155e36fa9da7e1b7c738ed7767fc9491a62ec6af70fe9da4a057759edc2d", "e5b9e8f6bda48460b7b143c3821b21b452cb3a835e6bbd5dd33aa0c8d3f5137d", "e81ebf6c5ee9684be8f2c87563880f93eedd56dd2b6146d8a725b50b7e5adb0f", "eb91be369f945f10d3a49f5f9be8b3d0b93a4c2be8f8a5b83b0571b8123e0a7a", "f460d1ceb0e4a5dcb2a652db0904224f367c9b3c1470d5a7683c0480e582468b"]
147
147
+
mccabe = ["ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", "dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"]
148
148
+
pylint = ["1d6d3622c94b4887115fe5204982eee66fdd8a951cf98635ee5caee6ec98c3ec", "31142f764d2a7cd41df5196f9933b12b7ee55e73ef12204b648ad7e556c119fb"]
149
149
+
six = ["70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", "832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"]
150
150
+
typed-ast = ["0948004fa228ae071054f5208840a1e88747a357ec1101c17217bfe99b299d58", "10703d3cec8dcd9eef5a630a04056bbc898abc19bac5691612acba7d1325b66d", "1f6c4bd0bdc0f14246fd41262df7dfc018d65bb05f6e16390b7ea26ca454a291", "25d8feefe27eb0303b73545416b13d108c6067b846b543738a25ff304824ed9a", "29464a177d56e4e055b5f7b629935af7f49c196be47528cc94e0a7bf83fbc2b9", "2e214b72168ea0275efd6c884b114ab42e316de3ffa125b267e732ed2abda892", "3e0d5e48e3a23e9a4d1a9f698e32a542a4a288c871d33ed8df1b092a40f3a0f9", "519425deca5c2b2bdac49f77b2c5625781abbaf9a809d727d3a5596b30bb4ded", "57fe287f0cdd9ceaf69e7b71a2e94a24b5d268b35df251a88fef5cc241bf73aa", "668d0cec391d9aed1c6a388b0d5b97cd22e6073eaa5fbaa6d2946603b4871efe", "68ba70684990f59497680ff90d18e756a47bf4863c604098f10de9716b2c0bdd", "6de012d2b166fe7a4cdf505eee3aaa12192f7ba365beeefaca4ec10e31241a85", "79b91ebe5a28d349b6d0d323023350133e927b4de5b651a8aa2db69c761420c6", "8550177fa5d4c1f09b5e5f524411c44633c80ec69b24e0e98906dd761941ca46", "898f818399cafcdb93cbbe15fc83a33d05f18e29fb498ddc09b0214cdfc7cd51", "94b091dc0f19291adcb279a108f5d38de2430411068b219f41b343c03b28fb1f", "a26863198902cda15ab4503991e8cf1ca874219e0118cbf07c126bce7c4db129", "a8034021801bc0440f2e027c354b4eafd95891b573e12ff0418dec385c76785c", "bc978ac17468fe868ee589c795d06777f75496b1ed576d308002c8a5756fb9ea", "c05b41bc1deade9f90ddc5d988fe506208019ebba9f2578c622516fd201f5863", "c9b060bd1e5a26ab6e8267fd46fc9e02b54eb15fffb16d112d4c7b1c12987559", "edb04bdd45bfd76c8292c4d9654568efaedf76fe78eb246dde69bdb13b2dad87", "f19f2a4f547505fe9072e15f6f4ae714af51b5a681a97f187971f50c283193b6"]
151
151
+
typing = ["4027c5f6127a6267a435201981ba156de91ad0d1d98e9ddc2aa173453453492d", "57dcf675a99b74d64dacf6fba08fb17cf7e3d5fdff53d4a30ea2a5e7e52543d4", "a4c8473ce11a65999c8f59cb093e70686b6c84c98df58c1dae9b3b196089858a"]
152
152
+
wrapt = ["d4d560d479f2c21e1b5443bbd15fe7ec4b37fe7e53d335d3b9b0a7b1226fe3c6"]
···
1
1
+
[tool.poetry]
2
2
+
name = "colorboy"
3
3
+
version = "1.0.0"
4
4
+
description = "Easily add color to your strings"
5
5
+
authors = ["KH <kasperkh.kh@gmail.com>"]
6
6
+
readme = 'README.md'
7
7
+
repository = "https://github.com/spectralkh/colorboy-py"
8
8
+
keywords = ['colorboy', 'color', 'terminal', 'chalk', 'colorama', 'termcolor']
9
9
+
10
10
+
[tool.poetry.dependencies]
11
11
+
python = "*"
12
12
+
colorama = "^0.3.9"
13
13
+
14
14
+
[tool.poetry.dev-dependencies]
15
15
+
pylint = "^2.1"