juniorprint 0.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.
- juniorprint-0.1.1/PKG-INFO +38 -0
- juniorprint-0.1.1/README.md +25 -0
- juniorprint-0.1.1/juniorprint/__init__.py +2 -0
- juniorprint-0.1.1/juniorprint/formatter.py +16 -0
- juniorprint-0.1.1/juniorprint/printer.py +14 -0
- juniorprint-0.1.1/juniorprint/styles.py +11 -0
- juniorprint-0.1.1/juniorprint.egg-info/PKG-INFO +38 -0
- juniorprint-0.1.1/juniorprint.egg-info/SOURCES.txt +11 -0
- juniorprint-0.1.1/juniorprint.egg-info/dependency_links.txt +1 -0
- juniorprint-0.1.1/juniorprint.egg-info/requires.txt +1 -0
- juniorprint-0.1.1/juniorprint.egg-info/top_level.txt +1 -0
- juniorprint-0.1.1/pyproject.toml +20 -0
- juniorprint-0.1.1/setup.cfg +4 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: juniorprint
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Print colored text easily in Python
|
|
5
|
+
Author-email: Hero <joscelynrandrianilaina@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.7
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: colorama
|
|
13
|
+
|
|
14
|
+
# juniorprint
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+

|
|
18
|
+

|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Overview
|
|
24
|
+
|
|
25
|
+
`juniorprint` is a lightweight Python library that enhances printing with inline color and style formatting.
|
|
26
|
+
|
|
27
|
+
It is:
|
|
28
|
+
- Simple
|
|
29
|
+
- Safe (no global override)
|
|
30
|
+
- Compatible with standard Python
|
|
31
|
+
- Lightweight
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install juniorprint
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# juniorprint
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
`juniorprint` is a lightweight Python library that enhances printing with inline color and style formatting.
|
|
13
|
+
|
|
14
|
+
It is:
|
|
15
|
+
- Simple
|
|
16
|
+
- Safe (no global override)
|
|
17
|
+
- Compatible with standard Python
|
|
18
|
+
- Lightweight
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install juniorprint
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from .styles import COLORS, STYLES, RESET
|
|
3
|
+
|
|
4
|
+
pattern = re.compile(r'([a-z]+)_\[(.*?)\]')
|
|
5
|
+
|
|
6
|
+
def format_text(text: str) -> str:
|
|
7
|
+
def repl(match):
|
|
8
|
+
key, content = match.group(1), match.group(2)
|
|
9
|
+
codes = ""
|
|
10
|
+
for char in key:
|
|
11
|
+
if char in COLORS:
|
|
12
|
+
codes += COLORS[char]
|
|
13
|
+
elif char in STYLES:
|
|
14
|
+
codes += STYLES[char]
|
|
15
|
+
return f"{codes}{content}{RESET}"
|
|
16
|
+
return pattern.sub(repl, text)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from colorama import init
|
|
2
|
+
init(autoreset=True)
|
|
3
|
+
|
|
4
|
+
import builtins
|
|
5
|
+
from .formatter import format_text
|
|
6
|
+
|
|
7
|
+
_original_print = builtins.print
|
|
8
|
+
|
|
9
|
+
def print_(*args, **kwargs):
|
|
10
|
+
try:
|
|
11
|
+
formatted_args = [format_text(str(arg)) for arg in args]
|
|
12
|
+
_original_print(*formatted_args, **kwargs)
|
|
13
|
+
except Exception:
|
|
14
|
+
_original_print(*args, **kwargs)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: juniorprint
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Print colored text easily in Python
|
|
5
|
+
Author-email: Hero <joscelynrandrianilaina@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.7
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: colorama
|
|
13
|
+
|
|
14
|
+
# juniorprint
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+

|
|
18
|
+

|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Overview
|
|
24
|
+
|
|
25
|
+
`juniorprint` is a lightweight Python library that enhances printing with inline color and style formatting.
|
|
26
|
+
|
|
27
|
+
It is:
|
|
28
|
+
- Simple
|
|
29
|
+
- Safe (no global override)
|
|
30
|
+
- Compatible with standard Python
|
|
31
|
+
- Lightweight
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install juniorprint
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
juniorprint/__init__.py
|
|
4
|
+
juniorprint/formatter.py
|
|
5
|
+
juniorprint/printer.py
|
|
6
|
+
juniorprint/styles.py
|
|
7
|
+
juniorprint.egg-info/PKG-INFO
|
|
8
|
+
juniorprint.egg-info/SOURCES.txt
|
|
9
|
+
juniorprint.egg-info/dependency_links.txt
|
|
10
|
+
juniorprint.egg-info/requires.txt
|
|
11
|
+
juniorprint.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
colorama
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
juniorprint
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=42", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "juniorprint"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "Print colored text easily in Python"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.7"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [{name="Hero", email="joscelynrandrianilaina@gmail.com"}]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"License :: OSI Approved :: MIT License",
|
|
16
|
+
"Operating System :: OS Independent"
|
|
17
|
+
]
|
|
18
|
+
dependencies = [
|
|
19
|
+
"colorama"
|
|
20
|
+
]
|