simple-python-utils 1.6.0__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.
- simple_python_utils-1.6.0/LICENSE +21 -0
- simple_python_utils-1.6.0/PKG-INFO +318 -0
- simple_python_utils-1.6.0/README.md +263 -0
- simple_python_utils-1.6.0/pyproject.toml +186 -0
- simple_python_utils-1.6.0/setup.cfg +4 -0
- simple_python_utils-1.6.0/setup.py +75 -0
- simple_python_utils-1.6.0/simple_python_utils.egg-info/PKG-INFO +318 -0
- simple_python_utils-1.6.0/simple_python_utils.egg-info/SOURCES.txt +12 -0
- simple_python_utils-1.6.0/simple_python_utils.egg-info/dependency_links.txt +1 -0
- simple_python_utils-1.6.0/simple_python_utils.egg-info/requires.txt +25 -0
- simple_python_utils-1.6.0/simple_python_utils.egg-info/top_level.txt +1 -0
- simple_python_utils-1.6.0/simple_utils/__init__.py +36 -0
- simple_python_utils-1.6.0/simple_utils/core.py +377 -0
- simple_python_utils-1.6.0/tests/test_core.py +555 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 fjmpereira20
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: simple-python-utils
|
|
3
|
+
Version: 1.6.0
|
|
4
|
+
Summary: A minimalist Python library with basic utility functions
|
|
5
|
+
Home-page: https://github.com/fjmpereira20/simple-python-utils
|
|
6
|
+
Author: fjmpereira20
|
|
7
|
+
Author-email: fjmpereira20 <fjmpereira20@users.noreply.github.com>
|
|
8
|
+
Project-URL: Homepage, https://github.com/fjmpereira20/simple-python-utils
|
|
9
|
+
Project-URL: Bug Reports, https://github.com/fjmpereira20/simple-python-utils/issues
|
|
10
|
+
Project-URL: Source, https://github.com/fjmpereira20/simple-python-utils
|
|
11
|
+
Project-URL: Documentation, https://github.com/fjmpereira20/simple-python-utils#readme
|
|
12
|
+
Project-URL: Funding, https://github.com/sponsors/fjmpereira20
|
|
13
|
+
Keywords: utilities,python,simple,basic,functions
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Topic :: Utilities
|
|
25
|
+
Classifier: Typing :: Typed
|
|
26
|
+
Requires-Python: >=3.9
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
31
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
32
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
33
|
+
Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
34
|
+
Requires-Dist: flake8>=6.0.0; extra == "dev"
|
|
35
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
|
|
37
|
+
Requires-Dist: bandit[toml]>=1.7.0; extra == "dev"
|
|
38
|
+
Requires-Dist: safety>=2.0.0; extra == "dev"
|
|
39
|
+
Requires-Dist: build>=0.10.0; extra == "dev"
|
|
40
|
+
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
41
|
+
Provides-Extra: test
|
|
42
|
+
Requires-Dist: pytest>=7.0.0; extra == "test"
|
|
43
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
|
|
44
|
+
Provides-Extra: qa
|
|
45
|
+
Requires-Dist: black>=23.0.0; extra == "qa"
|
|
46
|
+
Requires-Dist: isort>=5.12.0; extra == "qa"
|
|
47
|
+
Requires-Dist: flake8>=6.0.0; extra == "qa"
|
|
48
|
+
Requires-Dist: mypy>=1.0.0; extra == "qa"
|
|
49
|
+
Requires-Dist: bandit[toml]>=1.7.0; extra == "qa"
|
|
50
|
+
Requires-Dist: safety>=2.0.0; extra == "qa"
|
|
51
|
+
Dynamic: author
|
|
52
|
+
Dynamic: home-page
|
|
53
|
+
Dynamic: license-file
|
|
54
|
+
Dynamic: requires-python
|
|
55
|
+
|
|
56
|
+
<div align="center">
|
|
57
|
+
|
|
58
|
+
# 🐍 Simple Python Utils
|
|
59
|
+
|
|
60
|
+
*Uma biblioteca Python minimalista e elegante para funções utilitárias*
|
|
61
|
+
|
|
62
|
+
[](https://github.com/fjmpereira20/simple-python-utils/actions/workflows/ci.yml)
|
|
63
|
+
[](https://pypi.org/project/simple-python-utils/)
|
|
64
|
+
[](https://pypi.org/project/simple-python-utils/)
|
|
65
|
+
[](https://opensource.org/licenses/MIT)
|
|
66
|
+
|
|
67
|
+
[](https://codecov.io/gh/fjmpereira20/simple-python-utils)
|
|
68
|
+
[](https://www.codefactor.io/repository/github/fjmpereira20/simple-python-utils)
|
|
69
|
+
[](https://pypi.org/project/simple-python-utils/)
|
|
70
|
+
[](https://conventionalcommits.org)
|
|
71
|
+
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## ✨ Características
|
|
77
|
+
|
|
78
|
+
🎯 **Simples & Intuitivo** - API limpa e fácil de usar
|
|
79
|
+
🔒 **Robusto & Confiável** - 100% cobertura de testes
|
|
80
|
+
⚡ **Rápido & Eficiente** - Zero dependências externas
|
|
81
|
+
🐍 **Python Puro** - Compatível com Python 3.9+
|
|
82
|
+
|
|
83
|
+
## 🎯 Objetivo
|
|
84
|
+
|
|
85
|
+
Este projeto demonstra boas práticas de desenvolvimento de pacotes Python, seguindo princípios de:
|
|
86
|
+
- **Simplicidade sobre complexidade**
|
|
87
|
+
- **Legibilidade sobre inteligência**
|
|
88
|
+
- **Clareza sobre abstração**
|
|
89
|
+
|
|
90
|
+
## 📦 Instalação
|
|
91
|
+
|
|
92
|
+
### 🚀 Instalação via PyPI (Recomendado)
|
|
93
|
+
```bash
|
|
94
|
+
# Instalação básica
|
|
95
|
+
pip install simple-python-utils
|
|
96
|
+
|
|
97
|
+
# Instalação com dependências de desenvolvimento
|
|
98
|
+
pip install simple-python-utils[dev]
|
|
99
|
+
|
|
100
|
+
# Instalação de versão específica
|
|
101
|
+
pip install simple-python-utils==1.5.0
|
|
102
|
+
|
|
103
|
+
# Upgrade para versão mais recente
|
|
104
|
+
pip install --upgrade simple-python-utils
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 🔧 Instalação via Git
|
|
108
|
+
```bash
|
|
109
|
+
# Instalação estável (branch main)
|
|
110
|
+
pip install git+https://github.com/fjmpereira20/simple-python-utils.git
|
|
111
|
+
|
|
112
|
+
# Instalação de desenvolvimento (branch develop)
|
|
113
|
+
pip install git+https://github.com/fjmpereira20/simple-python-utils.git@develop
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 🛠️ Instalação para Desenvolvimento
|
|
117
|
+
```bash
|
|
118
|
+
# Clonar repositório
|
|
119
|
+
git clone https://github.com/fjmpereira20/simple-python-utils.git
|
|
120
|
+
cd simple-python-utils
|
|
121
|
+
|
|
122
|
+
# Criar ambiente virtual
|
|
123
|
+
python -m venv .venv
|
|
124
|
+
source .venv/bin/activate # Linux/Mac
|
|
125
|
+
# ou
|
|
126
|
+
.venv\Scripts\activate # Windows
|
|
127
|
+
|
|
128
|
+
# Instalação em modo desenvolvimento
|
|
129
|
+
pip install -e ".[dev]"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### ✅ Verificação da Instalação
|
|
133
|
+
```python
|
|
134
|
+
# Verificar se a instalação funcionou
|
|
135
|
+
import simple_utils
|
|
136
|
+
print(f"Versão instalada: {simple_utils.__version__}")
|
|
137
|
+
|
|
138
|
+
# Testar funcionalidades básicas
|
|
139
|
+
from simple_utils import print_message, add_numbers
|
|
140
|
+
print_message("Instalação bem-sucedida!")
|
|
141
|
+
print(f"2 + 3 = {add_numbers(2, 3)}")
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## 🚀 Uso Rápido
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
from simple_utils import print_message, add_numbers, multiply_numbers, divide_numbers, square_numbers
|
|
148
|
+
|
|
149
|
+
# Imprimir mensagem
|
|
150
|
+
print_message("Olá, mundo!")
|
|
151
|
+
# Output: Olá, mundo!
|
|
152
|
+
|
|
153
|
+
# Somar números
|
|
154
|
+
resultado = add_numbers(3.5, 2.1)
|
|
155
|
+
print(f"Resultado: {resultado}")
|
|
156
|
+
# Output: Resultado: 5.6
|
|
157
|
+
|
|
158
|
+
# Multiplicar números
|
|
159
|
+
produto = multiply_numbers(4, 5)
|
|
160
|
+
print(f"Produto: {produto}")
|
|
161
|
+
# Output: Produto: 20
|
|
162
|
+
|
|
163
|
+
# Dividir números
|
|
164
|
+
divisao = divide_numbers(10, 2)
|
|
165
|
+
print(f"Divisão: {divisao}")
|
|
166
|
+
# Output: Divisão: 5.0
|
|
167
|
+
|
|
168
|
+
# Elevar ao quadrado
|
|
169
|
+
quadrado = square_numbers(6)
|
|
170
|
+
print(f"Quadrado: {quadrado}")
|
|
171
|
+
# Output: Quadrado: 36
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## 📚 Funções Disponíveis
|
|
175
|
+
|
|
176
|
+
<div align="center">
|
|
177
|
+
|
|
178
|
+
| Função | Descrição | Exemplo | Resultado |
|
|
179
|
+
|--------|-----------|---------|-----------|
|
|
180
|
+
| `print_message(msg)` | Imprime mensagem com validação | `print_message("Hello!")` | `Hello!` |
|
|
181
|
+
| `add_numbers(a, b)` | Soma dois números | `add_numbers(2, 3)` | `5` |
|
|
182
|
+
| `multiply_numbers(a, b)` | Multiplica dois números | `multiply_numbers(4, 5)` | `20` |
|
|
183
|
+
| `divide_numbers(a, b)` | Divide dois números (proteção ÷0) | `divide_numbers(10, 2)` | `5.0` |
|
|
184
|
+
| `square_numbers(n)` | Eleva número ao quadrado | `square_numbers(6)` | `36` |
|
|
185
|
+
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
## 🧪 Executando os Testes
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# Instalar dependências de teste
|
|
192
|
+
pip install -e ".[test]"
|
|
193
|
+
|
|
194
|
+
# Executar todos os testes
|
|
195
|
+
pytest
|
|
196
|
+
|
|
197
|
+
# Executar com cobertura
|
|
198
|
+
pytest --cov=simple_utils
|
|
199
|
+
|
|
200
|
+
# Executar testes específicos
|
|
201
|
+
pytest tests/test_core.py::TestPrintMessage::test_print_message_valid_string
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## 🛠️ Desenvolvimento
|
|
205
|
+
|
|
206
|
+
### Configuração do Ambiente
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
# Clonar repositório
|
|
210
|
+
git clone https://github.com/fjmpereira20/simple-python-utils.git
|
|
211
|
+
cd simple-python-utils
|
|
212
|
+
|
|
213
|
+
# Criar ambiente virtual
|
|
214
|
+
python -m venv .venv
|
|
215
|
+
source .venv/bin/activate # Linux/Mac
|
|
216
|
+
# ou
|
|
217
|
+
.venv\Scripts\activate # Windows
|
|
218
|
+
|
|
219
|
+
# Instalar em modo desenvolvimento
|
|
220
|
+
pip install -e ".[dev]"
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Ferramentas de Qualidade
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
# Formatação de código
|
|
227
|
+
black simple_utils/ tests/
|
|
228
|
+
|
|
229
|
+
# Organizar imports
|
|
230
|
+
isort simple_utils/ tests/
|
|
231
|
+
|
|
232
|
+
# Linting
|
|
233
|
+
flake8 simple_utils/ tests/
|
|
234
|
+
|
|
235
|
+
# Type checking
|
|
236
|
+
mypy simple_utils/
|
|
237
|
+
|
|
238
|
+
# Ou use o comando unificado:
|
|
239
|
+
make quality # Linux/Mac
|
|
240
|
+
dev.bat quality # Windows
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### 🎨 Filosofia do Código
|
|
244
|
+
|
|
245
|
+
> "Simplicidade é a sofisticação máxima" - Leonardo da Vinci
|
|
246
|
+
|
|
247
|
+
Este projeto adota os seguintes princípios:
|
|
248
|
+
|
|
249
|
+
- ✅ **Claro > Inteligente**: Código autoexplicativo
|
|
250
|
+
- ✅ **Simples > Abstrato**: Evitar over-engineering
|
|
251
|
+
- ✅ **Legível > Compacto**: Priorizar compreensão
|
|
252
|
+
- ✅ **Funcional > Orientado a Objetos**: Usar funções puras
|
|
253
|
+
- ✅ **Documentado > Óbvio**: Docstrings e exemplos
|
|
254
|
+
|
|
255
|
+
## 🤝 Contribuindo
|
|
256
|
+
|
|
257
|
+
1. Fork o projeto
|
|
258
|
+
2. Crie uma branch para sua feature (`git checkout -b feature/AmazingFeature`)
|
|
259
|
+
3. Commit suas mudanças (`git commit -m 'feat: add some AmazingFeature'`)
|
|
260
|
+
4. Push para a branch (`git push origin feature/AmazingFeature`)
|
|
261
|
+
5. Abra um Pull Request
|
|
262
|
+
|
|
263
|
+
### Diretrizes de Contribuição
|
|
264
|
+
|
|
265
|
+
- ✅ Mantenha o foco na simplicidade
|
|
266
|
+
- ✅ Adicione testes para novas funcionalidades
|
|
267
|
+
- ✅ Siga as convenções de código existentes
|
|
268
|
+
- ✅ Atualize a documentação conforme necessário
|
|
269
|
+
- ✅ Use [Conventional Commits](docs/CONVENTIONAL_COMMITS.md)
|
|
270
|
+
|
|
271
|
+
### 🤖 Changelog Automático
|
|
272
|
+
- **Local**: Use `make changelog` ou `dev.bat changelog` para preview
|
|
273
|
+
- **Automático**: Changelog gerado automaticamente em releases (`git tag v*`)
|
|
274
|
+
- **Baseado em**: [Conventional Commits](docs/CONVENTIONAL_COMMITS.md)
|
|
275
|
+
|
|
276
|
+
## 📚 Documentação
|
|
277
|
+
|
|
278
|
+
<div align="center">
|
|
279
|
+
|
|
280
|
+
### 📖 Guias Completos
|
|
281
|
+
|
|
282
|
+
| 📚 [Tutorial](docs/TUTORIAL.md) | 🔧 [API Reference](docs/API_REFERENCE.md) | ❓ [FAQ](docs/FAQ.md) |
|
|
283
|
+
|---|---|---|
|
|
284
|
+
| Guia passo a passo | Documentação técnica | Perguntas frequentes |
|
|
285
|
+
|
|
286
|
+
| 📝 [Commits](docs/CONVENTIONAL_COMMITS.md) | 📋 [Workflow](WORKFLOW.md) | 🤝 [Contribuindo](CONTRIBUTING.md) |
|
|
287
|
+
|---|---|---|
|
|
288
|
+
| Padrão de commits | Processo de dev | Como contribuir |
|
|
289
|
+
|
|
290
|
+
</div>
|
|
291
|
+
|
|
292
|
+
## 📄 Licença
|
|
293
|
+
|
|
294
|
+
Este projeto está licenciado sob a Licença MIT - veja o arquivo [LICENSE](LICENSE) para detalhes.
|
|
295
|
+
|
|
296
|
+
## 👨💻 Autor
|
|
297
|
+
|
|
298
|
+
<div align="center">
|
|
299
|
+
|
|
300
|
+
**fjmpereira20**
|
|
301
|
+
[](https://github.com/fjmpereira20)
|
|
302
|
+
[](mailto:fjmpereira20@users.noreply.github.com)
|
|
303
|
+
|
|
304
|
+
</div>
|
|
305
|
+
|
|
306
|
+
## 🌟 Agradecimentos
|
|
307
|
+
|
|
308
|
+
- Inspirado pelos princípios de design do Python (PEP 20 - The Zen of Python)
|
|
309
|
+
- Seguindo as melhores práticas da comunidade Python
|
|
310
|
+
- Focado em ser um exemplo de código limpo e bem documentado
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
<div align="center">
|
|
315
|
+
|
|
316
|
+
**Feito com ❤️ e Python**
|
|
317
|
+
|
|
318
|
+
</div>
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🐍 Simple Python Utils
|
|
4
|
+
|
|
5
|
+
*Uma biblioteca Python minimalista e elegante para funções utilitárias*
|
|
6
|
+
|
|
7
|
+
[](https://github.com/fjmpereira20/simple-python-utils/actions/workflows/ci.yml)
|
|
8
|
+
[](https://pypi.org/project/simple-python-utils/)
|
|
9
|
+
[](https://pypi.org/project/simple-python-utils/)
|
|
10
|
+
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
|
|
12
|
+
[](https://codecov.io/gh/fjmpereira20/simple-python-utils)
|
|
13
|
+
[](https://www.codefactor.io/repository/github/fjmpereira20/simple-python-utils)
|
|
14
|
+
[](https://pypi.org/project/simple-python-utils/)
|
|
15
|
+
[](https://conventionalcommits.org)
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## ✨ Características
|
|
22
|
+
|
|
23
|
+
🎯 **Simples & Intuitivo** - API limpa e fácil de usar
|
|
24
|
+
🔒 **Robusto & Confiável** - 100% cobertura de testes
|
|
25
|
+
⚡ **Rápido & Eficiente** - Zero dependências externas
|
|
26
|
+
🐍 **Python Puro** - Compatível com Python 3.9+
|
|
27
|
+
|
|
28
|
+
## 🎯 Objetivo
|
|
29
|
+
|
|
30
|
+
Este projeto demonstra boas práticas de desenvolvimento de pacotes Python, seguindo princípios de:
|
|
31
|
+
- **Simplicidade sobre complexidade**
|
|
32
|
+
- **Legibilidade sobre inteligência**
|
|
33
|
+
- **Clareza sobre abstração**
|
|
34
|
+
|
|
35
|
+
## 📦 Instalação
|
|
36
|
+
|
|
37
|
+
### 🚀 Instalação via PyPI (Recomendado)
|
|
38
|
+
```bash
|
|
39
|
+
# Instalação básica
|
|
40
|
+
pip install simple-python-utils
|
|
41
|
+
|
|
42
|
+
# Instalação com dependências de desenvolvimento
|
|
43
|
+
pip install simple-python-utils[dev]
|
|
44
|
+
|
|
45
|
+
# Instalação de versão específica
|
|
46
|
+
pip install simple-python-utils==1.5.0
|
|
47
|
+
|
|
48
|
+
# Upgrade para versão mais recente
|
|
49
|
+
pip install --upgrade simple-python-utils
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 🔧 Instalação via Git
|
|
53
|
+
```bash
|
|
54
|
+
# Instalação estável (branch main)
|
|
55
|
+
pip install git+https://github.com/fjmpereira20/simple-python-utils.git
|
|
56
|
+
|
|
57
|
+
# Instalação de desenvolvimento (branch develop)
|
|
58
|
+
pip install git+https://github.com/fjmpereira20/simple-python-utils.git@develop
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 🛠️ Instalação para Desenvolvimento
|
|
62
|
+
```bash
|
|
63
|
+
# Clonar repositório
|
|
64
|
+
git clone https://github.com/fjmpereira20/simple-python-utils.git
|
|
65
|
+
cd simple-python-utils
|
|
66
|
+
|
|
67
|
+
# Criar ambiente virtual
|
|
68
|
+
python -m venv .venv
|
|
69
|
+
source .venv/bin/activate # Linux/Mac
|
|
70
|
+
# ou
|
|
71
|
+
.venv\Scripts\activate # Windows
|
|
72
|
+
|
|
73
|
+
# Instalação em modo desenvolvimento
|
|
74
|
+
pip install -e ".[dev]"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### ✅ Verificação da Instalação
|
|
78
|
+
```python
|
|
79
|
+
# Verificar se a instalação funcionou
|
|
80
|
+
import simple_utils
|
|
81
|
+
print(f"Versão instalada: {simple_utils.__version__}")
|
|
82
|
+
|
|
83
|
+
# Testar funcionalidades básicas
|
|
84
|
+
from simple_utils import print_message, add_numbers
|
|
85
|
+
print_message("Instalação bem-sucedida!")
|
|
86
|
+
print(f"2 + 3 = {add_numbers(2, 3)}")
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 🚀 Uso Rápido
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
from simple_utils import print_message, add_numbers, multiply_numbers, divide_numbers, square_numbers
|
|
93
|
+
|
|
94
|
+
# Imprimir mensagem
|
|
95
|
+
print_message("Olá, mundo!")
|
|
96
|
+
# Output: Olá, mundo!
|
|
97
|
+
|
|
98
|
+
# Somar números
|
|
99
|
+
resultado = add_numbers(3.5, 2.1)
|
|
100
|
+
print(f"Resultado: {resultado}")
|
|
101
|
+
# Output: Resultado: 5.6
|
|
102
|
+
|
|
103
|
+
# Multiplicar números
|
|
104
|
+
produto = multiply_numbers(4, 5)
|
|
105
|
+
print(f"Produto: {produto}")
|
|
106
|
+
# Output: Produto: 20
|
|
107
|
+
|
|
108
|
+
# Dividir números
|
|
109
|
+
divisao = divide_numbers(10, 2)
|
|
110
|
+
print(f"Divisão: {divisao}")
|
|
111
|
+
# Output: Divisão: 5.0
|
|
112
|
+
|
|
113
|
+
# Elevar ao quadrado
|
|
114
|
+
quadrado = square_numbers(6)
|
|
115
|
+
print(f"Quadrado: {quadrado}")
|
|
116
|
+
# Output: Quadrado: 36
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## 📚 Funções Disponíveis
|
|
120
|
+
|
|
121
|
+
<div align="center">
|
|
122
|
+
|
|
123
|
+
| Função | Descrição | Exemplo | Resultado |
|
|
124
|
+
|--------|-----------|---------|-----------|
|
|
125
|
+
| `print_message(msg)` | Imprime mensagem com validação | `print_message("Hello!")` | `Hello!` |
|
|
126
|
+
| `add_numbers(a, b)` | Soma dois números | `add_numbers(2, 3)` | `5` |
|
|
127
|
+
| `multiply_numbers(a, b)` | Multiplica dois números | `multiply_numbers(4, 5)` | `20` |
|
|
128
|
+
| `divide_numbers(a, b)` | Divide dois números (proteção ÷0) | `divide_numbers(10, 2)` | `5.0` |
|
|
129
|
+
| `square_numbers(n)` | Eleva número ao quadrado | `square_numbers(6)` | `36` |
|
|
130
|
+
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
## 🧪 Executando os Testes
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Instalar dependências de teste
|
|
137
|
+
pip install -e ".[test]"
|
|
138
|
+
|
|
139
|
+
# Executar todos os testes
|
|
140
|
+
pytest
|
|
141
|
+
|
|
142
|
+
# Executar com cobertura
|
|
143
|
+
pytest --cov=simple_utils
|
|
144
|
+
|
|
145
|
+
# Executar testes específicos
|
|
146
|
+
pytest tests/test_core.py::TestPrintMessage::test_print_message_valid_string
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## 🛠️ Desenvolvimento
|
|
150
|
+
|
|
151
|
+
### Configuração do Ambiente
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Clonar repositório
|
|
155
|
+
git clone https://github.com/fjmpereira20/simple-python-utils.git
|
|
156
|
+
cd simple-python-utils
|
|
157
|
+
|
|
158
|
+
# Criar ambiente virtual
|
|
159
|
+
python -m venv .venv
|
|
160
|
+
source .venv/bin/activate # Linux/Mac
|
|
161
|
+
# ou
|
|
162
|
+
.venv\Scripts\activate # Windows
|
|
163
|
+
|
|
164
|
+
# Instalar em modo desenvolvimento
|
|
165
|
+
pip install -e ".[dev]"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Ferramentas de Qualidade
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# Formatação de código
|
|
172
|
+
black simple_utils/ tests/
|
|
173
|
+
|
|
174
|
+
# Organizar imports
|
|
175
|
+
isort simple_utils/ tests/
|
|
176
|
+
|
|
177
|
+
# Linting
|
|
178
|
+
flake8 simple_utils/ tests/
|
|
179
|
+
|
|
180
|
+
# Type checking
|
|
181
|
+
mypy simple_utils/
|
|
182
|
+
|
|
183
|
+
# Ou use o comando unificado:
|
|
184
|
+
make quality # Linux/Mac
|
|
185
|
+
dev.bat quality # Windows
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### 🎨 Filosofia do Código
|
|
189
|
+
|
|
190
|
+
> "Simplicidade é a sofisticação máxima" - Leonardo da Vinci
|
|
191
|
+
|
|
192
|
+
Este projeto adota os seguintes princípios:
|
|
193
|
+
|
|
194
|
+
- ✅ **Claro > Inteligente**: Código autoexplicativo
|
|
195
|
+
- ✅ **Simples > Abstrato**: Evitar over-engineering
|
|
196
|
+
- ✅ **Legível > Compacto**: Priorizar compreensão
|
|
197
|
+
- ✅ **Funcional > Orientado a Objetos**: Usar funções puras
|
|
198
|
+
- ✅ **Documentado > Óbvio**: Docstrings e exemplos
|
|
199
|
+
|
|
200
|
+
## 🤝 Contribuindo
|
|
201
|
+
|
|
202
|
+
1. Fork o projeto
|
|
203
|
+
2. Crie uma branch para sua feature (`git checkout -b feature/AmazingFeature`)
|
|
204
|
+
3. Commit suas mudanças (`git commit -m 'feat: add some AmazingFeature'`)
|
|
205
|
+
4. Push para a branch (`git push origin feature/AmazingFeature`)
|
|
206
|
+
5. Abra um Pull Request
|
|
207
|
+
|
|
208
|
+
### Diretrizes de Contribuição
|
|
209
|
+
|
|
210
|
+
- ✅ Mantenha o foco na simplicidade
|
|
211
|
+
- ✅ Adicione testes para novas funcionalidades
|
|
212
|
+
- ✅ Siga as convenções de código existentes
|
|
213
|
+
- ✅ Atualize a documentação conforme necessário
|
|
214
|
+
- ✅ Use [Conventional Commits](docs/CONVENTIONAL_COMMITS.md)
|
|
215
|
+
|
|
216
|
+
### 🤖 Changelog Automático
|
|
217
|
+
- **Local**: Use `make changelog` ou `dev.bat changelog` para preview
|
|
218
|
+
- **Automático**: Changelog gerado automaticamente em releases (`git tag v*`)
|
|
219
|
+
- **Baseado em**: [Conventional Commits](docs/CONVENTIONAL_COMMITS.md)
|
|
220
|
+
|
|
221
|
+
## 📚 Documentação
|
|
222
|
+
|
|
223
|
+
<div align="center">
|
|
224
|
+
|
|
225
|
+
### 📖 Guias Completos
|
|
226
|
+
|
|
227
|
+
| 📚 [Tutorial](docs/TUTORIAL.md) | 🔧 [API Reference](docs/API_REFERENCE.md) | ❓ [FAQ](docs/FAQ.md) |
|
|
228
|
+
|---|---|---|
|
|
229
|
+
| Guia passo a passo | Documentação técnica | Perguntas frequentes |
|
|
230
|
+
|
|
231
|
+
| 📝 [Commits](docs/CONVENTIONAL_COMMITS.md) | 📋 [Workflow](WORKFLOW.md) | 🤝 [Contribuindo](CONTRIBUTING.md) |
|
|
232
|
+
|---|---|---|
|
|
233
|
+
| Padrão de commits | Processo de dev | Como contribuir |
|
|
234
|
+
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
## 📄 Licença
|
|
238
|
+
|
|
239
|
+
Este projeto está licenciado sob a Licença MIT - veja o arquivo [LICENSE](LICENSE) para detalhes.
|
|
240
|
+
|
|
241
|
+
## 👨💻 Autor
|
|
242
|
+
|
|
243
|
+
<div align="center">
|
|
244
|
+
|
|
245
|
+
**fjmpereira20**
|
|
246
|
+
[](https://github.com/fjmpereira20)
|
|
247
|
+
[](mailto:fjmpereira20@users.noreply.github.com)
|
|
248
|
+
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
## 🌟 Agradecimentos
|
|
252
|
+
|
|
253
|
+
- Inspirado pelos princípios de design do Python (PEP 20 - The Zen of Python)
|
|
254
|
+
- Seguindo as melhores práticas da comunidade Python
|
|
255
|
+
- Focado em ser um exemplo de código limpo e bem documentado
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
<div align="center">
|
|
260
|
+
|
|
261
|
+
**Feito com ❤️ e Python**
|
|
262
|
+
|
|
263
|
+
</div>
|