Skip to content

Atm account number - #1806

Merged
UTSAVS26 merged 4 commits into
UTSAVS26:mainfrom
HARSHIDS-4:atm_account_number
Sep 28, 2025
Merged

UTSAVS26 merged 4 commits into
UTSAVS26:mainfrom
HARSHIDS-4:atm_account_number

Conversation

@HARSHIDS-4

@HARSHIDS-4 HARSHIDS-4 commented Sep 27, 2025 •

Copy link
Copy Markdown
Contributor

Pull Request for PyVerse 💡

Requesting to submit a pull request to the PyVerse repository.


Issue Title

Please enter the title of the issue related to your pull request.
Input account number in ATM interfece (begineer_projects)

  • I have provided the issue title.

Info about the Related Issue

What's the goal of the project?
in ATM INTERFACE folder of begineers_projects their is no command to take account number of user to check balance,deposit amount or withdraw it .These changes would enhance the code.

  • I have described the aim of the project.

Name

Please mention your name.
Harshi Gupta

  • I have provided my name.

GitHub ID

Please mention your GitHub ID.
HARSHIDS-4

  • I have provided my GitHub ID.

Email ID

Please mention your email ID for further communication.
gharshi089@gmail.com

  • I have provided my email ID.

Identify Yourself

Mention in which program you are contributing (e.g., WoB, GSSOC, SSOC, SWOC).
GSSOC

  • I have mentioned my participant role.

Closes

Enter the issue number that will be closed through this PR.
Closes: #1775

  • I have provided the issue number.

Describe the Add-ons or Changes You've Made

Give a clear description of what you have added or modified.
Makes changes in code by asking user for their account number so that operations can be performed on it easily.

  • I have described my changes.

Type of Change

Select the type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Describe how your changes have been tested.
entered my account number and it accepted

  • I have described my testing process.

Checklist

Please confirm the following:

  • My code follows the guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly wherever it was hard to understand.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added things that prove my fix is effective or that my feature works.
  • Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • New Features

    • ATM Interface: Prompts for account number, improves menu selection input, and displays the entered account number at startup.
    • Amazon Product Checker: Script is now executable to fetch product title and availability.
    • E-Commerce Project: Added end-to-end workflow to load CSVs, clean/standardize data, merge datasets, compute revenue metrics, analyze customers/categories, generate visualizations, and export cleaned data.
  • Documentation

    • Added E-Commerce README with project overview, setup, usage, and learning outcomes.

@coderabbitai

coderabbitai Bot commented Sep 27, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Adds account number input and startup print to ATM interface; enables the Amazon availability checker by uncommenting code; introduces a new E-Commerce project with a comprehensive, single-file data workflow (ingestion, cleaning, merging, feature engineering, analysis, visualization, export) and adds its README.

Changes

Cohort / File(s) Summary of Changes
ATM Interface
Beginner_Projects/ATM Interface/ATM.py
Added account_number() prompt/return function; cast menu choice to int; prints returned account number at startup before invoking atm_interface().
Amazon Availability Checker
Beginner_Projects/Amazon product availability checker/amazon.py
Activated previously commented implementation; same logic now executes (requests, BeautifulSoup parsing, main guard).
E-Commerce Docs
Beginner_Projects/E-Commerce/README.md
New README describing purpose, features, tech stack, run steps, and learning outcomes; no code changes.
E-Commerce Workflow
Beginner_Projects/E-Commerce/e-commerce.py
New single-file project with classes for ingestion, cleaning, merging, feature engineering, analysis, visualization, and export; module-level instances; sequential prints executing methods.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant ATM as ATM.py
  User->>ATM: Run script
  ATM->>User: Prompt for account number
  User-->>ATM: Enter account number
  ATM->>ATM: print(account_number())
  ATM->>User: Show menu (int choice)
  alt User selects action
    ATM->>ATM: Perform balance/deposit/withdraw (existing flow)
  end
Loading
sequenceDiagram
  autonumber
  actor User
  participant EC as e-commerce.py
  participant FS as CSV Files
  participant PD as pandas/matplotlib

  User->>EC: Run script
  EC->>FS: Load customers/products/orders CSV
  EC->>EC: E_COMMERCE.__init__ (coerce types)
  EC->>EC: calculate_revenue (merge + revenue col)

  rect rgba(200,230,255,0.3)
  note right of EC: Cleaning/Merge/Features
  EC->>EC: DATA_CLEANING.* (missing, standardize, dates)
  EC->>EC: MERGE.concat (join datasets)
  EC->>EC: FEATURE_ENGINEERING.* (revenue, CLV, counts)
  end

  rect rgba(220,255,220,0.3)
  note right of EC: Analysis/Visualization/Export
  EC->>EC: ANALYSIS.* (top customers, category revenue, comparison)
  EC->>PD: VISUALIZATION.* (trend, by category, distribution)
  EC->>FS: EXPORT.export_cleaned_csv
  end

  EC-->>User: Printed summaries/results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Suggested labels

Contributor, Status: Review Ongoing 🔄, level1, gssoc25

Suggested reviewers

  • UTSAVS26
  • TheChaoticor

Poem

A rabbit taps keys with a happy thrum,
ATM asks numbers—beep, here they come.
Amazon wakes from a sleepy state,
E-commerce plots trends that look great.
CSVs dance, pandas prance—hooray!
Hop, merge, print—ship it today! 🐇📊✨

Pre-merge checks and finishing touches

❌ Failed checks (4 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title “Atm account number” is too terse and lacks an action verb, making it unclear that the PR adds a prompt for entering an account number in the ATM interface; it does not read as a concise, descriptive sentence that conveys the primary change. Rename the title to something like “Add account number prompt to ATM interface” so it clearly and concisely describes the new functionality.
Linked Issues Check ⚠️ Warning Although the PR introduces an account_number() function and prints the entered account number, it does not integrate this input into the existing balance check, deposit, and withdraw operations in atm_interface as required by issue #1775, so the core objective of performing subsequent operations on the provided account number is not met. Update the ATM interface to store the returned account number and pass it to the balance, deposit, and withdrawal functions so that all operations use the user’s input, and remove the standalone print(account_number()) call.
Out of Scope Changes Check ⚠️ Warning The PR includes unrelated modifications to the Amazon product checker and the E-Commerce beginner project files, which fall outside the scope of issue #1775 that only concerns adding account-number input to the ATM interface. Separate or remove the changes to the Amazon checker and the E-Commerce project so that this PR exclusively contains the ATM interface updates linked to issue #1775.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

👋 Thank you for opening this pull request! We're excited to review your contribution. Please give us a moment, and we'll get back to you shortly!

Feel free to join our community on Discord to discuss more!

@github-actions

Copy link
Copy Markdown

✅ PR validation passed! Syncing labels and assignees from the linked issue...

@github-actions github-actions Bot added Contributor Denotes issues or PRs submitted by contributors to acknowledge their participation. gssoc25 level1 stale Status: Review Ongoing 🔄 PR is currently under review and awaiting feedback from reviewers. labels Sep 27, 2025
@github-actions

Copy link
Copy Markdown

✅ PR validation passed! Syncing labels and assignees from the linked issue...

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Beginner_Projects/ATM Interface/ATM.py (1)

50-62: Menu option handling regressed — critical runtime bug.

Casting the menu input to int breaks the control flow in two ways: (1) a non-numeric entry (e.g. “q”) now raises ValueError and crashes the loop, and (2) even valid numeric input never matches the string literals '1' … '4', so every option—including Exit—falls into the “Invalid choice” branch. Restore string handling (or update the comparisons) so the interface keeps working.

Apply this diff:

-        choice = int(input("\nEnter your choice (1-4): "))
+        choice = input("\nEnter your choice (1-4): ")
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 45a0fbe and cbb00fc.

📒 Files selected for processing (4)
  • Beginner_Projects/ATM Interface/ATM.py (3 hunks)
  • Beginner_Projects/Amazon product availability checker/amazon.py (1 hunks)
  • Beginner_Projects/E-Commerce/README.md (1 hunks)
  • Beginner_Projects/E-Commerce/e-commerce.py (1 hunks)
🧰 Additional context used
🪛 Ruff (0.13.1)
Beginner_Projects/E-Commerce/e-commerce.py

77-77: Redefinition of unused date from line 3

(F811)

Beginner_Projects/Amazon product availability checker/amazon.py

11-11: Probable use of requests call without timeout

(S113)

Comment on lines +11 to +12
response = requests.get(product_url, headers=headers)
response.raise_for_status()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add a timeout to the Amazon request.

Eliminating the timeout means a slow or stalled Amazon response will hang the script indefinitely, which is a reliability regression. Please add an explicit timeout to requests.get.

Apply this diff:

-        response = requests.get(product_url, headers=headers)
+        response = requests.get(product_url, headers=headers, timeout=10)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
response = requests.get(product_url, headers=headers)
response.raise_for_status()
response = requests.get(product_url, headers=headers, timeout=10)
response.raise_for_status()
🧰 Tools
🪛 Ruff (0.13.1)

11-11: Probable use of requests call without timeout

(S113)

🤖 Prompt for AI Agents
In Beginner_Projects/Amazon product availability checker/amazon.py around lines
11-12, the requests.get call lacks a timeout causing possible indefinite hangs;
add an explicit timeout argument (e.g., timeout=10) to requests.get and
optionally handle requests.exceptions.Timeout (or requests.RequestException) to
fail fast and surface the error instead of blocking indefinitely.

Comment on lines 65 to 67
# Run the ATM interface
print(account_number())
atm_interface()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Account number input is collected but never used.

We prompt the user and immediately print the account number, but we neither persist it nor pass it into the ATM workflow. All subsequent operations still act on the hard-coded balance, so the new feature delivers no functional benefit. Please capture the value (e.g., acct = account_number()) and thread it through the session so balance/transactions are tied to that account.

🤖 Prompt for AI Agents
In Beginner_Projects/ATM Interface/ATM.py around lines 65-67, the
account_number() return value is printed but not used so the session isn't tied
to an account; assign the result to a variable (e.g., acct = account_number())
and pass that account identifier into the ATM workflow (atm_interface(acct)) and
into any functions that read/update balance or transactions; if your code
currently uses a single hard-coded balance, refactor to look up and persist
balances by account (e.g., a dict or simple storage) so all balance/transaction
operations reference the account passed in.

Comment on lines +101 to +106
merge=self.calculate_revenue()
merge[['month','day','year']]=merge['order_date'].str.split("/",expand=True)
merge['month']=pd.to_numeric(merge['month'],errors="coerce")
result=merge.groupby("month")["revenue"].sum()
result.plot(kind="line",marker='*',label="revenue trend")
plt.xlabel("month")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

.str.split on order_date will crash after datetime conversion.

Earlier we coerce order_date to datetime64 (see DATA_CLEANING.date_time). Once that runs, calling .str.split raises AttributeError, so revenue_trend() blows up. Use the datetime accessor instead of string splitting.

Apply this diff:

-        merge[['month','day','year']]=merge['order_date'].str.split("/",expand=True)
-        merge['month']=pd.to_numeric(merge['month'],errors="coerce")
+        merge['order_date'] = pd.to_datetime(merge['order_date'], errors="coerce")
+        merge['month'] = merge['order_date'].dt.month
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
merge=self.calculate_revenue()
merge[['month','day','year']]=merge['order_date'].str.split("/",expand=True)
merge['month']=pd.to_numeric(merge['month'],errors="coerce")
result=merge.groupby("month")["revenue"].sum()
result.plot(kind="line",marker='*',label="revenue trend")
plt.xlabel("month")
merge = self.calculate_revenue()
merge['order_date'] = pd.to_datetime(merge['order_date'], errors="coerce")
merge['month'] = merge['order_date'].dt.month
result = merge.groupby("month")["revenue"].sum()
result.plot(kind="line", marker='*', label="revenue trend")
plt.xlabel("month")
🤖 Prompt for AI Agents
In Beginner_Projects/E-Commerce/e-commerce.py around lines 101 to 106, calling
.str.split on order_date will fail after earlier conversion to datetime64;
replace the string-splitting with the datetime accessor (e.g., ensure order_date
is datetime dtype and set merge['month']=merge['order_date'].dt.month), then
group by that month column and plot the revenue trend as before (no .str.split,
coerce/handle NaT if needed).

Comment on lines +28 to +36
1. Clone the repository (or download the project folder).
```bash
git clone https://github.com/UTSAVS26/PyVerse.git
```

2. Navigate to the project folder.
```bash
cd PyVerse/beginner_projects/ecommerce
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix incorrect path in run instructions.

The listed directory (beginner_projects/ecommerce) doesn’t exist; the actual folder is Beginner_Projects/E-Commerce. Following the current steps will fail on case-sensitive systems. Please update the path so users can navigate successfully.

Apply this diff:

-    cd PyVerse/beginner_projects/ecommerce
+    cd PyVerse/Beginner_Projects/E-Commerce
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Clone the repository (or download the project folder).
```bash
git clone https://github.com/UTSAVS26/PyVerse.git
```
2. Navigate to the project folder.
```bash
cd PyVerse/beginner_projects/ecommerce
```
1. Clone the repository (or download the project folder).
🤖 Prompt for AI Agents
In Beginner_Projects/E-Commerce/README.md around lines 28 to 36, the checkout
instructions reference the wrong path (git clone path is fine but the cd uses
`PyVerse/beginner_projects/ecommerce` which is incorrect and will fail on
case-sensitive systems); update the navigation command to the actual folder name
by replacing `cd PyVerse/beginner_projects/ecommerce` with `cd
PyVerse/Beginner_Projects/E-Commerce` (ensure exact casing and hyphenation) so
users can successfully change into the project directory.

@UTSAVS26
UTSAVS26 merged commit 40792f6 into UTSAVS26:main Sep 28, 2025
7 checks passed
@UTSAVS26 UTSAVS26 added Status: Approved ✔️ PRs that have passed review and are approved for merging. and removed Status: Review Ongoing 🔄 PR is currently under review and awaiting feedback from reviewers. stale labels Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Contributor Denotes issues or PRs submitted by contributors to acknowledge their participation. gssoc25 level1 Status: Approved ✔️ PRs that have passed review and are approved for merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🧑‍💻: Input account number in ATM interfece (begineer_projects)

2 participants