piecolor 3.1.1__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.
Files changed (32) hide show
  1. piecolor-3.1.1/LICENSE +19 -0
  2. piecolor-3.1.1/PKG-INFO +153 -0
  3. piecolor-3.1.1/README.md +117 -0
  4. piecolor-3.1.1/pyproject.toml +27 -0
  5. piecolor-3.1.1/setup.cfg +4 -0
  6. piecolor-3.1.1/src/piecolor.egg-info/PKG-INFO +153 -0
  7. piecolor-3.1.1/src/piecolor.egg-info/SOURCES.txt +30 -0
  8. piecolor-3.1.1/src/piecolor.egg-info/dependency_links.txt +1 -0
  9. piecolor-3.1.1/src/piecolor.egg-info/requires.txt +2 -0
  10. piecolor-3.1.1/src/piecolor.egg-info/top_level.txt +1 -0
  11. piecolor-3.1.1/src/piethon/__init__.py +1 -0
  12. piecolor-3.1.1/src/piethon/config.py +283 -0
  13. piecolor-3.1.1/src/piethon/pretty/__init__.py +23 -0
  14. piecolor-3.1.1/src/piethon/pretty/argparse_formatter.py +190 -0
  15. piecolor-3.1.1/src/piethon/pretty/formatter.py +129 -0
  16. piecolor-3.1.1/src/piethon/script/argparsecolor.py +365 -0
  17. piecolor-3.1.1/src/piethon/script/dots.py +253 -0
  18. piecolor-3.1.1/src/piethon/script/info.py +227 -0
  19. piecolor-3.1.1/src/piethon/script/object_info.py +96 -0
  20. piecolor-3.1.1/src/piethon/system/__init__.py +118 -0
  21. piecolor-3.1.1/src/piethon/system/processes.py +514 -0
  22. piecolor-3.1.1/src/piethon/system/processes.pyi +527 -0
  23. piecolor-3.1.1/src/piethon/term/__init__.py +1 -0
  24. piecolor-3.1.1/src/piethon/term/colors.py +3336 -0
  25. piecolor-3.1.1/src/piethon/term/colors.pyi +2498 -0
  26. piecolor-3.1.1/src/piethon/term/sgr.py +1175 -0
  27. piecolor-3.1.1/src/piethon/term/sgr.pyi +67 -0
  28. piecolor-3.1.1/src/piethon/term/tee.py +135 -0
  29. piecolor-3.1.1/src/piethon/types/__init__.py +86 -0
  30. piecolor-3.1.1/src/piethon/types/attributes.py +200 -0
  31. piecolor-3.1.1/src/piethon/types/hashable.py +866 -0
  32. piecolor-3.1.1/src/piethon/types/map.py +571 -0
piecolor-3.1.1/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2022 EatingPie
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1,153 @@
1
+ Metadata-Version: 2.4
2
+ Name: piecolor
3
+ Version: 3.1.1
4
+ Summary: Primarily a text colorization library for python3.
5
+ Author-email: EatingPie <eatingpie@gmail.com>
6
+ License: Copyright (c) 2022 EatingPie
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
25
+
26
+ Project-URL: Homepage, https://github.com/EatingPie/piethon_repo
27
+ Classifier: Programming Language :: Python :: 3
28
+ Classifier: License :: OSI Approved :: MIT License
29
+ Classifier: Operating System :: OS Independent
30
+ Requires-Python: >=3.10
31
+ Description-Content-Type: text/markdown
32
+ License-File: LICENSE
33
+ Requires-Dist: typing
34
+ Requires-Dist: typing_extensions
35
+ Dynamic: license-file
36
+
37
+ piethon
38
+ =======
39
+
40
+ Series of tools for python3, releasing to PyPi.
41
+
42
+ ```
43
+ # Install for Testing
44
+ # System
45
+ /usr/bin/python3 -m pip install -e .
46
+ # brew
47
+ python3 -m pip install -e .
48
+ ```
49
+
50
+
51
+ This package currently includes 4 different libraries:
52
+ - A text coloring library, along with argparse colorization (counts as 2).
53
+ - A process listing library (ala `ps` which does NOT work in Windows).
54
+ - A set of routines to pull methods and instance variables from one class into another.
55
+
56
+ Terminal Colors
57
+ ---------------
58
+
59
+ Probably most of most interest: the text coloring and color argparse libraries.
60
+ ```
61
+ import piethon.term.colors as c
62
+ import piethon.script.argparse_color as ColorArgparse
63
+ ```
64
+ The focus here is on simplicity and readability. Instead of cumbersome escape codes, cumbersome color names and the overall cumbersomeness of using color, it's as easy as the proverbial pie.
65
+
66
+ The colors library includes five palettes. They can be used individually, or mixed and matched in the same code.
67
+
68
+ The first three palettes provide different common naming conventions for the xterm 256 color palette.
69
+
70
+ The first 8 base colors all have single-letter counterparts from RGB and CMYK. The delimiter, system and solarized palettes include similarly abbreviated color names. This makes coloring text a _lot_ nicer looking in code.
71
+
72
+ R - red
73
+ G - green
74
+ B - blue
75
+ C - cyan
76
+ M - magenta
77
+ Y - yellow
78
+ K - black
79
+ W - white
80
+ N - reset to system normal
81
+
82
+ Preceding each with 'X' (for "extended" colors) takes us to the 16-color palette.
83
+
84
+ XR - extended red
85
+ XG - extended green
86
+ etc.
87
+
88
+ The Solarized palette includes the exact same 16-color naming, though each color name represents an different _actual_ color.
89
+ It also includes the violet, orange and the special names invented for Solarized itself. Solarized has a mild, Matrix-like green tint.
90
+
91
+ V - violet
92
+ O - orange
93
+ b03 - base03
94
+ b02 - base02
95
+ b01 - base01
96
+ b00 - base00
97
+ b0 - base0
98
+ b1 - base1
99
+ b3 - base3
100
+ b2 - base2
101
+
102
+ Note that we can code coloring in two ways: with methods or with instance variables. The methods use _lower case_ names while the variables use _upper_case_ names. The methods always reset the color back to "normal" (no color), while the instance variables work better when setting multiple colors in text.
103
+
104
+ ### Palettes ###
105
+
106
+ - ANSI
107
+ The common "ANSI" standard color names.
108
+ ```
109
+ import piethon.term.colors as c
110
+
111
+ print("I'm so mad, I'm seeing", c.ansi.r("red!"))
112
+ print("Better than being," c.ansi.y("yellow"), "with envy")
113
+
114
+ ca = c.ansi # a bit of abbreviating
115
+ print(ca.R + "Happy", ca.W + "Fourth", ca.B + "of July" + ca.N)
116
+ ```
117
+
118
+ - SOLARIZED
119
+ ```
120
+ import piethon.term.colors as c
121
+
122
+ print(c.sol.b01("A greyscale-ish color named base01!"))
123
+ ```
124
+
125
+ - X11
126
+ These names come from the X11 'rgb.txt' file found on many systems. They overlap heavily with the ANSI palette, but some names may appear only one or the other, and some which do match may actually have slightly different color values.
127
+ ```
128
+ import piethon.term.colors as c
129
+
130
+ print(c.x11.chocolate("I love chocolate!"))
131
+ ```
132
+
133
+ - SYSTEM
134
+ Colorization for common system terms, akin to color `ls`.
135
+
136
+ e - exe
137
+ cmd - command
138
+ f - file
139
+ d - dir or even directory
140
+ l - link
141
+ mp - mount
142
+ h - hostname
143
+ u - username
144
+
145
+ - Delimiters
146
+ A word of wisdom: colorizing delimiters looks really great, but are a huge hassle.
147
+ This palette doesn't just change the color: it inserts the actual colorized delimiters as well. These only exist as functions, and typically work best for double-delimiaters like '()' etc.
148
+
149
+ ```
150
+ print("We use the html tag", c.dlm.angle("p"), "for paragraphs)
151
+ print("A graph starting at", c.dlm.coord(1, 2))
152
+ ```
153
+
@@ -0,0 +1,117 @@
1
+ piethon
2
+ =======
3
+
4
+ Series of tools for python3, releasing to PyPi.
5
+
6
+ ```
7
+ # Install for Testing
8
+ # System
9
+ /usr/bin/python3 -m pip install -e .
10
+ # brew
11
+ python3 -m pip install -e .
12
+ ```
13
+
14
+
15
+ This package currently includes 4 different libraries:
16
+ - A text coloring library, along with argparse colorization (counts as 2).
17
+ - A process listing library (ala `ps` which does NOT work in Windows).
18
+ - A set of routines to pull methods and instance variables from one class into another.
19
+
20
+ Terminal Colors
21
+ ---------------
22
+
23
+ Probably most of most interest: the text coloring and color argparse libraries.
24
+ ```
25
+ import piethon.term.colors as c
26
+ import piethon.script.argparse_color as ColorArgparse
27
+ ```
28
+ The focus here is on simplicity and readability. Instead of cumbersome escape codes, cumbersome color names and the overall cumbersomeness of using color, it's as easy as the proverbial pie.
29
+
30
+ The colors library includes five palettes. They can be used individually, or mixed and matched in the same code.
31
+
32
+ The first three palettes provide different common naming conventions for the xterm 256 color palette.
33
+
34
+ The first 8 base colors all have single-letter counterparts from RGB and CMYK. The delimiter, system and solarized palettes include similarly abbreviated color names. This makes coloring text a _lot_ nicer looking in code.
35
+
36
+ R - red
37
+ G - green
38
+ B - blue
39
+ C - cyan
40
+ M - magenta
41
+ Y - yellow
42
+ K - black
43
+ W - white
44
+ N - reset to system normal
45
+
46
+ Preceding each with 'X' (for "extended" colors) takes us to the 16-color palette.
47
+
48
+ XR - extended red
49
+ XG - extended green
50
+ etc.
51
+
52
+ The Solarized palette includes the exact same 16-color naming, though each color name represents an different _actual_ color.
53
+ It also includes the violet, orange and the special names invented for Solarized itself. Solarized has a mild, Matrix-like green tint.
54
+
55
+ V - violet
56
+ O - orange
57
+ b03 - base03
58
+ b02 - base02
59
+ b01 - base01
60
+ b00 - base00
61
+ b0 - base0
62
+ b1 - base1
63
+ b3 - base3
64
+ b2 - base2
65
+
66
+ Note that we can code coloring in two ways: with methods or with instance variables. The methods use _lower case_ names while the variables use _upper_case_ names. The methods always reset the color back to "normal" (no color), while the instance variables work better when setting multiple colors in text.
67
+
68
+ ### Palettes ###
69
+
70
+ - ANSI
71
+ The common "ANSI" standard color names.
72
+ ```
73
+ import piethon.term.colors as c
74
+
75
+ print("I'm so mad, I'm seeing", c.ansi.r("red!"))
76
+ print("Better than being," c.ansi.y("yellow"), "with envy")
77
+
78
+ ca = c.ansi # a bit of abbreviating
79
+ print(ca.R + "Happy", ca.W + "Fourth", ca.B + "of July" + ca.N)
80
+ ```
81
+
82
+ - SOLARIZED
83
+ ```
84
+ import piethon.term.colors as c
85
+
86
+ print(c.sol.b01("A greyscale-ish color named base01!"))
87
+ ```
88
+
89
+ - X11
90
+ These names come from the X11 'rgb.txt' file found on many systems. They overlap heavily with the ANSI palette, but some names may appear only one or the other, and some which do match may actually have slightly different color values.
91
+ ```
92
+ import piethon.term.colors as c
93
+
94
+ print(c.x11.chocolate("I love chocolate!"))
95
+ ```
96
+
97
+ - SYSTEM
98
+ Colorization for common system terms, akin to color `ls`.
99
+
100
+ e - exe
101
+ cmd - command
102
+ f - file
103
+ d - dir or even directory
104
+ l - link
105
+ mp - mount
106
+ h - hostname
107
+ u - username
108
+
109
+ - Delimiters
110
+ A word of wisdom: colorizing delimiters looks really great, but are a huge hassle.
111
+ This palette doesn't just change the color: it inserts the actual colorized delimiters as well. These only exist as functions, and typically work best for double-delimiaters like '()' etc.
112
+
113
+ ```
114
+ print("We use the html tag", c.dlm.angle("p"), "for paragraphs)
115
+ print("A graph starting at", c.dlm.coord(1, 2))
116
+ ```
117
+
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["setuptools>=65.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "piecolor"
7
+ version = "3.1.1"
8
+ authors = [
9
+ { name="EatingPie", email="eatingpie@gmail.com" },
10
+ ]
11
+ description = "Primarily a text colorization library for python3."
12
+ readme = "README.md"
13
+ license = { file="LICENSE" }
14
+ requires-python = ">=3.10"
15
+ classifiers = [
16
+ "Programming Language :: Python :: 3",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Operating System :: OS Independent",
19
+ ]
20
+ dependencies = [
21
+ "typing",
22
+ "typing_extensions",
23
+ ]
24
+
25
+ [project.urls]
26
+ "Homepage" = "https://github.com/EatingPie/piethon_repo"
27
+
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,153 @@
1
+ Metadata-Version: 2.4
2
+ Name: piecolor
3
+ Version: 3.1.1
4
+ Summary: Primarily a text colorization library for python3.
5
+ Author-email: EatingPie <eatingpie@gmail.com>
6
+ License: Copyright (c) 2022 EatingPie
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
25
+
26
+ Project-URL: Homepage, https://github.com/EatingPie/piethon_repo
27
+ Classifier: Programming Language :: Python :: 3
28
+ Classifier: License :: OSI Approved :: MIT License
29
+ Classifier: Operating System :: OS Independent
30
+ Requires-Python: >=3.10
31
+ Description-Content-Type: text/markdown
32
+ License-File: LICENSE
33
+ Requires-Dist: typing
34
+ Requires-Dist: typing_extensions
35
+ Dynamic: license-file
36
+
37
+ piethon
38
+ =======
39
+
40
+ Series of tools for python3, releasing to PyPi.
41
+
42
+ ```
43
+ # Install for Testing
44
+ # System
45
+ /usr/bin/python3 -m pip install -e .
46
+ # brew
47
+ python3 -m pip install -e .
48
+ ```
49
+
50
+
51
+ This package currently includes 4 different libraries:
52
+ - A text coloring library, along with argparse colorization (counts as 2).
53
+ - A process listing library (ala `ps` which does NOT work in Windows).
54
+ - A set of routines to pull methods and instance variables from one class into another.
55
+
56
+ Terminal Colors
57
+ ---------------
58
+
59
+ Probably most of most interest: the text coloring and color argparse libraries.
60
+ ```
61
+ import piethon.term.colors as c
62
+ import piethon.script.argparse_color as ColorArgparse
63
+ ```
64
+ The focus here is on simplicity and readability. Instead of cumbersome escape codes, cumbersome color names and the overall cumbersomeness of using color, it's as easy as the proverbial pie.
65
+
66
+ The colors library includes five palettes. They can be used individually, or mixed and matched in the same code.
67
+
68
+ The first three palettes provide different common naming conventions for the xterm 256 color palette.
69
+
70
+ The first 8 base colors all have single-letter counterparts from RGB and CMYK. The delimiter, system and solarized palettes include similarly abbreviated color names. This makes coloring text a _lot_ nicer looking in code.
71
+
72
+ R - red
73
+ G - green
74
+ B - blue
75
+ C - cyan
76
+ M - magenta
77
+ Y - yellow
78
+ K - black
79
+ W - white
80
+ N - reset to system normal
81
+
82
+ Preceding each with 'X' (for "extended" colors) takes us to the 16-color palette.
83
+
84
+ XR - extended red
85
+ XG - extended green
86
+ etc.
87
+
88
+ The Solarized palette includes the exact same 16-color naming, though each color name represents an different _actual_ color.
89
+ It also includes the violet, orange and the special names invented for Solarized itself. Solarized has a mild, Matrix-like green tint.
90
+
91
+ V - violet
92
+ O - orange
93
+ b03 - base03
94
+ b02 - base02
95
+ b01 - base01
96
+ b00 - base00
97
+ b0 - base0
98
+ b1 - base1
99
+ b3 - base3
100
+ b2 - base2
101
+
102
+ Note that we can code coloring in two ways: with methods or with instance variables. The methods use _lower case_ names while the variables use _upper_case_ names. The methods always reset the color back to "normal" (no color), while the instance variables work better when setting multiple colors in text.
103
+
104
+ ### Palettes ###
105
+
106
+ - ANSI
107
+ The common "ANSI" standard color names.
108
+ ```
109
+ import piethon.term.colors as c
110
+
111
+ print("I'm so mad, I'm seeing", c.ansi.r("red!"))
112
+ print("Better than being," c.ansi.y("yellow"), "with envy")
113
+
114
+ ca = c.ansi # a bit of abbreviating
115
+ print(ca.R + "Happy", ca.W + "Fourth", ca.B + "of July" + ca.N)
116
+ ```
117
+
118
+ - SOLARIZED
119
+ ```
120
+ import piethon.term.colors as c
121
+
122
+ print(c.sol.b01("A greyscale-ish color named base01!"))
123
+ ```
124
+
125
+ - X11
126
+ These names come from the X11 'rgb.txt' file found on many systems. They overlap heavily with the ANSI palette, but some names may appear only one or the other, and some which do match may actually have slightly different color values.
127
+ ```
128
+ import piethon.term.colors as c
129
+
130
+ print(c.x11.chocolate("I love chocolate!"))
131
+ ```
132
+
133
+ - SYSTEM
134
+ Colorization for common system terms, akin to color `ls`.
135
+
136
+ e - exe
137
+ cmd - command
138
+ f - file
139
+ d - dir or even directory
140
+ l - link
141
+ mp - mount
142
+ h - hostname
143
+ u - username
144
+
145
+ - Delimiters
146
+ A word of wisdom: colorizing delimiters looks really great, but are a huge hassle.
147
+ This palette doesn't just change the color: it inserts the actual colorized delimiters as well. These only exist as functions, and typically work best for double-delimiaters like '()' etc.
148
+
149
+ ```
150
+ print("We use the html tag", c.dlm.angle("p"), "for paragraphs)
151
+ print("A graph starting at", c.dlm.coord(1, 2))
152
+ ```
153
+
@@ -0,0 +1,30 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/piecolor.egg-info/PKG-INFO
5
+ src/piecolor.egg-info/SOURCES.txt
6
+ src/piecolor.egg-info/dependency_links.txt
7
+ src/piecolor.egg-info/requires.txt
8
+ src/piecolor.egg-info/top_level.txt
9
+ src/piethon/__init__.py
10
+ src/piethon/config.py
11
+ src/piethon/pretty/__init__.py
12
+ src/piethon/pretty/argparse_formatter.py
13
+ src/piethon/pretty/formatter.py
14
+ src/piethon/script/argparsecolor.py
15
+ src/piethon/script/dots.py
16
+ src/piethon/script/info.py
17
+ src/piethon/script/object_info.py
18
+ src/piethon/system/__init__.py
19
+ src/piethon/system/processes.py
20
+ src/piethon/system/processes.pyi
21
+ src/piethon/term/__init__.py
22
+ src/piethon/term/colors.py
23
+ src/piethon/term/colors.pyi
24
+ src/piethon/term/sgr.py
25
+ src/piethon/term/sgr.pyi
26
+ src/piethon/term/tee.py
27
+ src/piethon/types/__init__.py
28
+ src/piethon/types/attributes.py
29
+ src/piethon/types/hashable.py
30
+ src/piethon/types/map.py
@@ -0,0 +1,2 @@
1
+ typing
2
+ typing_extensions
@@ -0,0 +1 @@
1
+ piethon
@@ -0,0 +1 @@
1
+ __all__ = ["script", "system", "term", "types"]