pyrisma 2__py3-none-any.whl

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.
pyrisma/Colors.py ADDED
@@ -0,0 +1,162 @@
1
+ from datetime import datetime
2
+ class Colors:
3
+ def __init__(self) -> None:
4
+ self.colors = {
5
+ # Text colors (normal)
6
+ 'black' : "\033[30m",
7
+ 'red' : "\033[31m",
8
+ 'green' : "\033[32m",
9
+ 'yellow' : "\033[33m",
10
+ 'blue' : "\033[34m",
11
+ 'magenta' : "\033[35m",
12
+ 'cyan' : "\033[36m",
13
+ 'white' : "\033[37m",
14
+
15
+ # Bright text colors
16
+ 'bright_black' : "\033[90m",
17
+ 'bright_red' : "\033[91m",
18
+ 'bright_green' : "\033[92m",
19
+ 'bright_yellow' : "\033[93m",
20
+ 'bright_blue' : "\033[94m",
21
+ 'bright_magenta' : "\033[95m",
22
+ 'bright_cyan' : "\033[96m",
23
+ 'bright_white' : "\033[97m",
24
+
25
+ # Background colors (normal)
26
+ 'bg_black' : "\033[40m",
27
+ 'bg_red' : "\033[41m",
28
+ 'bg_green' : "\033[42m",
29
+ 'bg_yellow' : "\033[43m",
30
+ 'bg_blue' : "\033[44m",
31
+ 'bg_magenta' : "\033[45m",
32
+ 'bg_cyan' : "\033[46m",
33
+ 'bg_white' : "\033[47m",
34
+
35
+ # Bright backgrounds
36
+ 'bg_bright_black' : "\033[100m",
37
+ 'bg_bright_red' : "\033[101m",
38
+ 'bg_bright_green' : "\033[102m",
39
+ 'bg_bright_yellow' : "\033[103m",
40
+ 'bg_bright_blue' : "\033[104m",
41
+ 'bg_bright_magenta' : "\033[105m",
42
+ 'bg_bright_cyan' : "\033[106m",
43
+ 'bg_bright_white' : "\033[107m",
44
+
45
+ # Styles
46
+ 'bold' : "\033[1m",
47
+ 'italic' : "\033[3m",
48
+ 'underline' : "\033[4m",
49
+ 'double_underline' : "\033[21m",
50
+ 'blink' : "\033[5m",
51
+ 'reverse' : "\033[7m",
52
+ 'hidden' : "\033[8m",
53
+ 'strike' : "\033[9m",
54
+
55
+ # Reset
56
+ 'reset' : "\033[0m",
57
+ 'normal' : "\033[2m"
58
+ }
59
+
60
+ self.icons = {
61
+ 'void': '',
62
+ 'info': f'{chr(10069)}{chr(160)}',
63
+ 'error': f'{chr(10060)}{chr(160)}',
64
+ 'debug': f'{chr(9935)}{chr(160)} ',
65
+ 'success': f'{chr(9989)}{chr(160)}',
66
+ 'warning': f'{chr(10071)}{chr(160)}',
67
+ 'highlight': f'{chr(10062)}{chr(160)}',
68
+ }
69
+
70
+ # Métodos utilitários
71
+ def color(self, name: str) -> str:
72
+ return self.colors.get(name, self.colors['reset'])
73
+
74
+ def icon(self, name: str) -> str:
75
+ return self.icons.get(name, '')
76
+
77
+ def reset(self) -> str:
78
+ return self.colors['reset']
79
+
80
+ # Sucesso
81
+ def success(self, msg: str = None, **kwargs) -> None:
82
+ style: str = 'normal'
83
+ icon: bool = 'void'
84
+ time_clock: bool = False
85
+
86
+ icon = kwargs.get('icon', icon)
87
+ style = kwargs.get('style', style)
88
+
89
+ _clock: datetime = f'[{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}] ' if kwargs.get('time_clock') == True else ''
90
+
91
+ print(f"{_clock}{self.icons[icon]}{self.colors['bright_green']}{self.colors[style]}{msg}{self.reset()}")
92
+ return None
93
+
94
+ # Erro
95
+ def error(self, msg: str = None, **kwargs) -> None:
96
+ style: str = 'normal'
97
+ icon: bool = 'void'
98
+ time_clock: bool = False
99
+
100
+ icon = kwargs.get('icon', icon)
101
+ style = kwargs.get('style', style)
102
+
103
+ _clock: datetime = f'[{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}] ' if kwargs.get('time_clock') == True else ''
104
+
105
+ print(f"{_clock}{self.icons[icon]}{self.colors['bright_red']}{self.colors[style]}{msg}{self.reset()}")
106
+ return None
107
+
108
+ # Aviso
109
+ def warning(self, msg: str = None, **kwargs) -> None:
110
+ style: str = 'normal'
111
+ icon: bool = 'void'
112
+ time_clock: bool = False
113
+
114
+ icon = kwargs.get('icon', icon)
115
+ style = kwargs.get('style', style)
116
+
117
+ _clock: datetime = f'[{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}] ' if kwargs.get('time_clock') == True else ''
118
+
119
+ print(f"{_clock}{self.icons[icon]}{self.colors['bright_yellow']}{self.colors[style]}{msg}{self.reset()}")
120
+ return None
121
+
122
+ # Informação
123
+ def info(self, msg: str, **kwargs) -> None:
124
+ style: str = 'normal'
125
+ icon: bool = 'void'
126
+ time_clock: bool = False
127
+
128
+ icon = kwargs.get('icon', icon)
129
+ style = kwargs.get('style', style)
130
+
131
+ _clock: datetime = f'[{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}] ' if kwargs.get('time_clock') == True else ''
132
+
133
+ print(f"{_clock}{self.icons[icon]}{self.colors['blue']}{self.colors[style]}{msg}{self.reset()}")
134
+ return None
135
+
136
+ # Debug
137
+ def debug(self, msg: str, **kwargs) -> None:
138
+ style: str = 'normal'
139
+ icon: bool = 'void'
140
+ time_clock: bool = False
141
+
142
+ icon = kwargs.get('icon', icon)
143
+ style = kwargs.get('style', style)
144
+
145
+ _clock: datetime = f'[{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}] ' if kwargs.get('time_clock') == True else ''
146
+
147
+ print(f"{_clock}{self.icons[icon]}{self.colors['bright_magenta']}{self.colors[style]}{msg}{self.reset()}")
148
+ return None
149
+
150
+ # Importante / Destaque
151
+ def highlight(self, msg: str, **kwargs) -> None:
152
+ style: str = 'normal'
153
+ icon: bool = 'void'
154
+ time_clock: bool = False
155
+
156
+ icon = kwargs.get('icon', icon)
157
+ style = kwargs.get('style', style)
158
+
159
+ _clock: datetime = f'[{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}] ' if kwargs.get('time_clock') == True else ''
160
+
161
+ print(f"{_clock}{self.icons[icon]}{self.colors['bright_white']}{self.colors[style]}{msg}{self.reset()}")
162
+ return None
pyrisma/__init__.py ADDED
@@ -0,0 +1,5 @@
1
+ from .Colors import Colors
2
+
3
+ __all__ = ["Colors"]
4
+
5
+ terminal = Colors()
@@ -0,0 +1,160 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyrisma
3
+ Version: 2
4
+ Summary: Uma biblioteca para deixar mensagens coloridas e estilosas no terminal.
5
+ Author: Marley
6
+ Author-email: Marley Benicio <marleysbenicio@gmail.com>
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/MarleyBenicio/pyrisma
9
+ Requires-Python: >=3.9
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Dynamic: license-file
13
+
14
+ # 💬 Pyrisma
15
+
16
+ Uma biblioteca Python para exibir mensagens coloridas e estilizadas no terminal, com ícones, estilos de texto e timestamp opcional.
17
+
18
+ Ideal para quem quer logs mais visuais, legíveis e com um toque de personalidade.
19
+
20
+ ---
21
+
22
+ ## 🚀 Instalação
23
+
24
+ ```bash
25
+ pip install pyrisma
26
+ ```
27
+
28
+ Requer Python >= 3.9. Sem dependências externas.
29
+
30
+ ---
31
+
32
+ ## 🧠 Uso básico
33
+
34
+ ```python
35
+ from pyrisma import terminal
36
+
37
+ terminal.info("Sistema iniciado com sucesso!")
38
+ terminal.warning("Atenção: configuração ausente.")
39
+ terminal.error("Erro crítico detectado!")
40
+ terminal.success("Processo concluído com êxito.")
41
+ terminal.debug("Valor da variável x: 42")
42
+ terminal.highlight("Isso merece destaque!")
43
+ ```
44
+
45
+ O objeto `terminal` já vem pronto para uso (é uma instância de `Colors`), mas você também pode instanciar a classe diretamente:
46
+
47
+ ```python
48
+ from pyrisma import Colors
49
+
50
+ terminal = Colors()
51
+ ```
52
+
53
+ ---
54
+
55
+ ## ⚙️ Métodos disponíveis
56
+
57
+ Todos os métodos de log têm a mesma assinatura:
58
+
59
+ ```python
60
+ terminal.<metodo>(msg: str, **kwargs)
61
+ ```
62
+
63
+ | Método | Cor aplicada |
64
+ |---------------|-------------------|
65
+ | `success` | verde brilhante |
66
+ | `error` | vermelho brilhante|
67
+ | `warning` | amarelo brilhante |
68
+ | `info` | azul |
69
+ | `debug` | magenta brilhante |
70
+ | `highlight` | branco brilhante |
71
+
72
+ ### Parâmetros opcionais (`**kwargs`)
73
+
74
+ | Parâmetro | Tipo | Padrão | Descrição |
75
+ |---------------|--------|----------|----------------------------------------------------------------------------|
76
+ | `style` | `str` | `'normal'` | Nome do estilo de texto a aplicar (ver tabela de estilos abaixo). |
77
+ | `icon` | `str` | `'void'` | Nome do ícone a exibir antes da mensagem (ver tabela de ícones abaixo). |
78
+ | `time_clock` | `bool` | `False` | Se `True`, adiciona um timestamp `[YYYY-MM-DD HH:MM:SS]` antes da mensagem. |
79
+
80
+ Exemplo usando todos os parâmetros:
81
+
82
+ ```python
83
+ terminal.success(
84
+ "Backup concluído",
85
+ style="bold",
86
+ icon="success",
87
+ time_clock=True,
88
+ )
89
+ # [2026-09-11 10:30:00] ✅ Backup concluído
90
+ ```
91
+
92
+ ---
93
+
94
+ ## 🎨 Estilos disponíveis (`style`)
95
+
96
+ ```
97
+ normal, bold, italic, underline, double_underline,
98
+ blink, reverse, hidden, strike, reset
99
+ ```
100
+
101
+ ## 🔣 Ícones disponíveis (`icon`)
102
+
103
+ ```
104
+ void, info, error, debug, success, warning, highlight
105
+ ```
106
+
107
+ ---
108
+
109
+ ## 🧰 Métodos utilitários
110
+
111
+ Além dos métodos de log, a classe `Colors` expõe utilitários para montar suas próprias mensagens formatadas:
112
+
113
+ ```python
114
+ from pyrisma import Colors
115
+
116
+ c = Colors()
117
+
118
+ c.color("red") # retorna o código ANSI da cor "red"
119
+ c.icon("warning") # retorna o ícone associado a "warning"
120
+ c.reset() # retorna o código ANSI de reset ("\033[0m")
121
+ ```
122
+
123
+ Cores de texto disponíveis em `color()`:
124
+
125
+ ```
126
+ black, red, green, yellow, blue, magenta, cyan, white,
127
+ bright_black, bright_red, bright_green, bright_yellow,
128
+ bright_blue, bright_magenta, bright_cyan, bright_white,
129
+ bg_black, bg_red, bg_green, bg_yellow, bg_blue, bg_magenta,
130
+ bg_cyan, bg_white, bg_bright_black, bg_bright_red,
131
+ bg_bright_green, bg_bright_yellow, bg_bright_blue,
132
+ bg_bright_magenta, bg_bright_cyan, bg_bright_white
133
+ ```
134
+
135
+ ---
136
+
137
+ ## ⚙️ Funcionalidades
138
+
139
+ - Mensagens com cores e ícones contextuais.
140
+ - Suporte a diferentes níveis de log (`success`, `error`, `warning`, `info`, `debug`, `highlight`).
141
+ - Estilos de texto (negrito, itálico, sublinhado, etc).
142
+ - Timestamp opcional em cada mensagem.
143
+ - Acesso direto a cores e ícones para composições personalizadas.
144
+ - Sem dependências externas.
145
+
146
+ ---
147
+
148
+ ## 📄 Licença
149
+
150
+ Distribuído sob a licença MIT. Veja o arquivo [LICENSE](LICENSE) para mais informações.
151
+
152
+ ---
153
+
154
+ ## 👤 Autor
155
+
156
+ **Marley Benicio**
157
+ Desenvolvedor de Software
158
+
159
+ 📧 marleysbenicio@gmail.com
160
+ 🔗 [GitHub](https://github.com/MarleyBenicio/pyrisma)
@@ -0,0 +1,7 @@
1
+ pyrisma/Colors.py,sha256=SLNYsHqpNxDoyDTDWmm8sKBE_Kk7DY5DEOqGD5Owep0,5386
2
+ pyrisma/__init__.py,sha256=ZUbebDYKs77jFezutNpibtULPPylSLZLc--d7-bLcG0,69
3
+ pyrisma-2.dist-info/licenses/LICENSE,sha256=dhp3IdrOnCI8ah90zPQHS3AoD57ko0jk4InuvRkk-0g,1119
4
+ pyrisma-2.dist-info/METADATA,sha256=K27UP107jCRCIG_cuv4__MeiLhgAi6zntz8N6-C_zjE,4267
5
+ pyrisma-2.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
6
+ pyrisma-2.dist-info/top_level.txt,sha256=aNMtiLFuIw2Um3g9epGU1PqC5AREnzEHulaktEfNcPE,8
7
+ pyrisma-2.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,27 @@
1
+
2
+ ---
3
+
4
+ ## 📜 `LICENSE` (Licença MIT)
5
+
6
+ ```text
7
+ MIT License
8
+
9
+ Copyright (c) 2025 Marley
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the “Software”), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ pyrisma