A mini project written in Python 3.12, showcasing the use of modern tools and best practices in software development.
This project utilizes:
- Poetry 🛠️ – for virtual environment and dependency management,
- mypy ✅ – for static type checking,
- pytest 🧪 – for unit testing.
The project implements a simple BankAccount
class with the following functionalities:
- Creating a bank account with an initial balance,
- Depositing and withdrawing funds,
- Handling errors, such as trying to withdraw more money than available.
The project also includes unit tests to ensure code correctness.
- Python 3.12+
- Poetry 1.6.1 or newer
- mypy 1.5.0 or newer
- pytest 7.0.0 or newer
git git@github.com:Kinetics20/intro_project.git
cd intro_projekt
poetry install
# Linux/macOS
poetry shell
# Windows (Command Prompt or PowerShell)
poetry shell
# Linux/macOS
pip install mypy
# Windows (Command Prompt or PowerShell)
pip install mypy
# Linux/macOS
pip install pytest
# Windows (Command Prompt or PowerShell)
pip install pytest
pytest
mypy bank_account.py
-
__init__(owner: str, account_number: str, balance: Decimal = Decimal("0.0")) -> None
Creates a bank account. -
deposit(amount: Decimal) -> None
Deposits funds into the account (only positive amounts are allowed). -
withdraw(amount: Decimal) -> None
Withdraws funds from the account (the amount cannot exceed the current balance). -
get_balance() -> str
Returns the balance formatted as "xx.xx PLN".
Feel free to submit pull requests with improvements and suggestions.
This project was created for educational purposes and to improve Python skills! 🌟