Skip to main content

An example package

Project description

Introduction:

Build Status

The banking633 system is divided into 2 subpackage Admin with modules view, action, card and User with modules account, transaction. main is the main menu, data.json is for storing all action data though store.

Running the Application

Execution: The application can be started by running main import banking633 and import banking633.main directly, then select role depending on the desired mode (admin or user). We general "account: 1, password: 1" for admin, user should have account created at the first time.

MainView Class

Purpose: Serves as the entry point for the application, allowing users to choose between admin and user modes. Methods: run_admin: Executes the admin view. run_user: Executes the user view. choice_user_type: Displays welcome message and lets users choose their role (admin or user).

Admin

Store Class

Purpose: Handles data storage and retrieval. Attributes: data_file_path (path to the data file), users (dictionary of users). Methods: save_all_data: Saves all user data to a file. read_users_from_file: Reads users from a file and converts them to User objects.

action Class

Purpose: Handles user actions such as creating or removing users. Methods: createUser: Registers a new user after validating inputs. randomCardId: Generates a unique card ID. killUser: Deletes a user based on card number after validation. checkPasswd: Validates a password.

Card Class

Purpose: Represents a bank card. Attributes: cardId, cardPasswd, cardMoney, cardLock. Method: to_dict: Converts card attributes to a dictionary.

User Class

-Purpose: Represents a user. Attributes: name, idCard, phone, card. Method: to_dict: Converts user attributes to a dictionary.

AdminView Class (Inherits from Store)

Purpose: Provides the admin interface for managing users. Methods: quit: Saves data and exits. login: Handles admin login. admin_view: Displays admin options and handles user interactions.

User

UserView Class (Inherits from Store)

Purpose: Provides the user interface for banking transactions. Methods: menu: Displays the user menu. user_view: Handles user interactions based on menu choices. quit: Saves data and exits.

transaction Class

Purpose: Handles banking transactions like balance check, withdrawal, deposit, and transfer. Methods: balance: Displays the user's current balance. withdraw: Processes a withdrawal after validation. deposit: Processes a deposit. transfer: Handles fund transfers between accounts. checkPasswd: Validates the password with a maximum of three attempts.

Coverage Reports

report

NOTE: the lack of coverage for admin/view is UI code and for user/transaction is print statement

pypi: https://pypi.org/project/banking633/0.0.2/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

banking633-0.0.5.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

banking633-0.0.5-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file banking633-0.0.5.tar.gz.

File metadata

  • Download URL: banking633-0.0.5.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for banking633-0.0.5.tar.gz
Algorithm Hash digest
SHA256 1d5d1e4cd3399971d36ac4dbc3ccb5d18c6be946c4fb892908d1e84c48a38d47
MD5 803e8f2439e2076debf33c8c418930f8
BLAKE2b-256 5d9fcba7a7c72cfe1d2700c6e98c7515fb06ad96c7a1d45965e0dee56e759ebb

See more details on using hashes here.

File details

Details for the file banking633-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: banking633-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for banking633-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4d3be221bd42a7574d2cb587493256c2c73b762341f5fbbc33e513c76bfa94a6
MD5 927b1e9c096c5d5f9ec2cc8af5bf6b53
BLAKE2b-256 ae6e41723ec5603a2db1bbd61bdc95a9700f85e2670501187ffdd4f61d119331

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page