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.
@@ -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
+ ![PyPI](https://img.shields.io/pypi/v/juniorprint.svg)
17
+ ![Python Version](https://img.shields.io/pypi/pyversions/juniorprint.svg)
18
+ ![License](https://img.shields.io/pypi/l/juniorprint.svg)
19
+ ![Build](https://github.com/Tech-dax/juniorprint/actions/workflows/publish.yml/badge.svg)
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
+ ![PyPI](https://img.shields.io/pypi/v/juniorprint.svg)
4
+ ![Python Version](https://img.shields.io/pypi/pyversions/juniorprint.svg)
5
+ ![License](https://img.shields.io/pypi/l/juniorprint.svg)
6
+ ![Build](https://github.com/Tech-dax/juniorprint/actions/workflows/publish.yml/badge.svg)
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,2 @@
1
+ from .printer import print_
2
+ __all__ = ["print_"]
@@ -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,11 @@
1
+ COLORS = {
2
+ "r": "\033[31m",
3
+ "g": "\033[32m",
4
+ "y": "\033[33m",
5
+ "b": "\033[34m",
6
+ "m": "\033[35m",
7
+ "c": "\033[36m",
8
+ "w": "\033[37m",
9
+ }
10
+ STYLES = {"d": "\033[1m"}
11
+ RESET = "\033[0m"
@@ -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
+ ![PyPI](https://img.shields.io/pypi/v/juniorprint.svg)
17
+ ![Python Version](https://img.shields.io/pypi/pyversions/juniorprint.svg)
18
+ ![License](https://img.shields.io/pypi/l/juniorprint.svg)
19
+ ![Build](https://github.com/Tech-dax/juniorprint/actions/workflows/publish.yml/badge.svg)
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
+ 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
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+