This project is a compound interest calculator developed for educational purposes, showcasing best practices for organizing Python code in professional projects.
Teach how to organize a Python project in a professional structure following the MVC (Model-View-Controller) pattern:
graph TD
A[View] -->|Sends data| B[Controller]
B -->|Validation| C[Model]
C -->|Returns results| B
B -->|Updates interface| A
A -->|Displays graph| D[Matplotlib]
- 💰 Accurate compound interest calculations
- 📈 Interactive graphical visualization
- 🎨 Intuitive interface with Tkinter
- ✅ Robust input validation
- 💵 Automatic currency formatting
- 🖥️ Responsive design for various screen sizes
-
Clone the repository:
git clone https://github.com/Monokatarina/compound-interest.git cd compound-interest -
Install dependencies:
pip install -r requirements.txt
-
Run the program:
python main.py
pie
title Project Structure
"models/" : 25
"views/" : 30
"controllers/" : 25
"utils/" : 20
| Technology | Purpose |
|---|---|
| Python | Core logic |
| Tkinter | Graphical interface |
| Matplotlib | Data visualization |
| Mermaid | Diagrams in README |
flowchart TB
subgraph "Project Structure"
A[main.py] --> B[controllers/calculator.py]
A --> C[views/gui.py]
A --> D[models/calculations.py]
A --> E[utils/formatters.py]
end
Complete Legend:
models/: Contains mathematical formulasviews/: User interface and graphscontrollers/: Validation and flow controlutils/: Auxiliary functions
- Fork the project
- Create a branch for your feature (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by [Monokatarina] - Transforming lines of code into knowledge! 🚀
# Simplified example of the main logic
from models.calculations import calculate_compound_interest
result = calculate_compound_interest(
principal=1000,
interest_rate=8, # 8% per year
time=5 # 5 years
)
print(f"Final amount: ${result:,.2f}")Este projeto é uma calculadora de juros compostos desenvolvida para fins educacionais, demonstrando boas práticas de organização de código em projetos profissionais.
Ensinar como organizar um projeto Python em uma estrutura profissional seguindo o padrão MVC (Model-View-Controller):
graph TD
A[View] -->|Envia dados| B[Controller]
B -->|Validação| C[Model]
C -->|Retorna resultados| B
B -->|Atualiza interface| A
A -->|Exibe gráfico| D[Matplotlib]
- 💰 Cálculo preciso de juros compostos
- 📈 Visualização gráfica interativa
- 🎨 Interface intuitiva com Tkinter
- ✅ Validação robusta de entradas
- 💵 Formatação monetária automática
- 🖥️ Responsividade para diferentes tamanhos de tela
-
Clone o repositório:
git clone https://github.com/Monokatarina/juros-compostos.git cd juros-compostos -
Instale as dependências:
pip install -r requirements.txt
-
Execute o programa:
python main.py
pie
title Estrutura do Projeto
"models/" : 25
"views/" : 30
"controllers/" : 25
"utils/" : 20
| Tecnologia | Finalidade |
|---|---|
| Python | Lógica principal |
| Tkinter | Interface gráfica |
| Matplotlib | Visualização de dados |
| Mermaid | Diagramas no README |
flowchart TB
subgraph "Estrutura do Projeto"
A[main.py] --> B[controllers/calculator.py]
A --> C[views/gui.py]
A --> D[models/calculations.py]
A --> E[utils/formatters.py]
end
Legenda Completa:
models/: Contém as fórmulas matemáticasviews/: Interface do usuário e gráficoscontrollers/: Validação e controle de fluxoutils/: Funções auxiliares
- Faça um fork do projeto
- Crie uma branch para sua feature (
git checkout -b feature/incrivel) - Commit suas mudanças (
git commit -m 'Adiciona feature incrível') - Push para a branch (
git push origin feature/incrivel) - Abra um Pull Request
Este projeto está licenciado sob a licença MIT - veja o arquivo LICENSE para detalhes.
Feito com ❤️ por [Monokatarina] - Transformando linhas de código em conhecimento! 🚀
# Exemplo simplificado da lógica principal
from models.calculations import calcular_juros_compostos
resultado = calcular_juros_compostos(
capital_inicial=1000,
taxa_juros=8, # 8% ao ano
tempo=5 # 5 anos
)
print(f"Montante final: R${resultado:,.2f}")