Skip to main content

bank_creator

The bank_creator package provides some basic set of tools for managing various types of bank accounts, including savings, checking, loan, and reward accounts. It also simulates the creation and management of banks and their branches.

Table of Contents

Installation

To install the bank_creator package, use pip:

pip install bank_creator
Creating a Bank and Branches
Creating a Bank
To create a bank, instantiate the Bank class with a name and an initial investment amount:

python
Copy code
from bank import Bank

# Create a bank with an initial investment
my_bank = Bank(name="My Bank", initial_investment=100000)
Creating Branches
You can create branches for the bank using the BankBranch class and add them to the bank:

python
Copy code
from bank import BankBranch

# Create branches
branch1 = BankBranch(name="Branch 1")
branch2 = BankBranch(name="Branch 2")

# Add branches to the bank
my_bank.add_branch(branch1)
my_bank.add_branch(branch2)
Creating Accounts
Savings Account
A savings account can be created using the SavingsAccount class. It requires an account number, account holder's name, initial balance, and interest rate:

python
Copy code
from account import SavingsAccount

# Create a savings account
savings_account = SavingsAccount(account_number="123456789", account_holder="John Doe", balance=1000, interest_rate=0.03)

# Add the savings account to a branch
branch1.add_account(savings_account)
Checking Account
A checking account can be created using the CheckingAccount class. It requires an account number, account holder's name, and initial balance:

python
Copy code
from account import CheckingAccount

# Create a checking account
checking_account = CheckingAccount(account_number="987654321", account_holder="Jane Doe", balance=500)

# Add the checking account to a branch
branch2.add_account(checking_account)
Loan Account
A loan account can be created using the LoanAccount class. It requires an account number, account holder's name, initial balance, and loan amount:

python
Copy code
from loan import LoanAccount

# Create a loan account
loan_account = LoanAccount(account_number="1122334455", account_holder="Alice", balance=0, loan_amount=10000)

# Add the loan account to a branch
branch1.add_account(loan_account)
Reward Accounts
Reward accounts combine the features of savings or checking accounts with a reward points system. They can be created using the RewardSavingsAccount and RewardCheckingAccount classes:

python
Copy code
from enhanced_bank import RewardSavingsAccount, RewardCheckingAccount

# Create a reward savings account
reward_savings_account = RewardSavingsAccount(account_number="123123123", account_holder="Bob", balance=2000, interest_rate=0.03, reward_points=100)

# Create a reward checking account
reward_checking_account = RewardCheckingAccount(account_number="321321321", account_holder="Charlie", balance=1000, reward_points=50)

# Add the reward accounts to branches
branch2.add_account(reward_savings_account)
branch1.add_account(reward_checking_account)
Performing Operations on Accounts
Deposit
To deposit an amount into an account, use the deposit method:

python
Copy code
# Deposit into savings account
savings_account.deposit(500)
Withdraw
To withdraw an amount from an account, use the withdraw method:

python
Copy code
# Withdraw from checking account
checking_account.withdraw(200)
Repay Loan
To repay a loan, use the repay_loan method on a loan account:

python
Copy code
# Repay loan
loan_account.repay_loan(1000)
Earn Rewards
To earn reward points on a reward account, use the earn_rewards method:

python
Copy code
# Earn rewards on reward account
reward_savings_account.earn_rewards(500)
Redeem Rewards
To redeem reward points, use the redeem_rewards method:

python
Copy code
# Redeem rewards on reward account
reward_checking_account.redeem_rewards(20)
Utility Functions
Transfer Funds
To transfer funds from one account to another, use the transfer function:

python
Copy code
from utilities import transfer

# Transfer funds from one account to another
transfer(from_account=savings_account, to_account=checking_account, amount=300)
Logging Operations
The package includes a decorator to log operations performed on accounts. This can be useful for tracking account activity:

python
Copy code
from decorators import log_operation

@log_operation
def custom_operation(account, amount):
    account.deposit(amount)

# Perform custom operation
custom_operation(savings_account, 150)
Database Management
The package uses SQLite to manage account and bank details. All account and bank operations are automatically saved to the database. This ensures that all changes are persistent and can be retrieved later.

Contributing
Contributions are welcome! If you have suggestions for improvements or new features, feel free to submit a Pull Request on GitHub.

License
This project is licensed under the MIT License.

Metadata

Release files for bank-creator 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bank-creator 0.1.0
File Size Uploaded Provenance
bank_creator-0.1.0.tar.gz 3.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bank-creator 0.1.0
File Interpreter ABI Platform
bank_creator-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.5 kB

Release files / bank_creator-0.1.0.tar.gz

Download URL bank_creator-0.1.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d5b27f829f09b35d2222105b54d2b2c26e8b5330b9b90bca59b4a3b9b1ee1269
BLAKE2b-256 checksum
How to use checksums
3c3afb1b5f802ed95a2dda3efff282914e5979762cb5f560a0ecadd60a9a11a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Release files / bank_creator-0.1.0-py3-none-any.whl

Download URL bank_creator-0.1.0-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82fbed7862a275b12f3361fc625a5715bc14c2b09576ca1644325e4cdf8b51e5
BLAKE2b-256 checksum
How to use checksums
235350ef459f219a5401f7357087bb17e18756cb703e7dad9025cd4a4b3f02a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Security for bank-creator 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page