Repository navigation
Atm account number - #1806
Atm account number#1806
Conversation
WalkthroughAdds 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
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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (4 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
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. Comment |
|
👋 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! |
|
✅ PR validation passed! Syncing labels and assignees from the linked issue... |
|
✅ PR validation passed! Syncing labels and assignees from the linked issue... |
There was a problem hiding this comment.
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
intbreaks the control flow in two ways: (1) a non-numeric entry (e.g. “q”) now raisesValueErrorand 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
📒 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)
| response = requests.get(product_url, headers=headers) | ||
| response.raise_for_status() |
There was a problem hiding this comment.
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.
| 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.
| # Run the ATM interface | ||
| print(account_number()) | ||
| atm_interface() |
There was a problem hiding this comment.
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.
| 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") |
There was a problem hiding this comment.
.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.
| 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).
| 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 | ||
| ``` |
There was a problem hiding this comment.
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.
| 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.
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)
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.
Name
Please mention your name.
Harshi Gupta
GitHub ID
Please mention your GitHub ID.
HARSHIDS-4
Email ID
Please mention your email ID for further communication.
gharshi089@gmail.com
Identify Yourself
Mention in which program you are contributing (e.g., WoB, GSSOC, SSOC, SWOC).
GSSOC
Closes
Enter the issue number that will be closed through this PR.
Closes: #1775
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.
Type of Change
Select the type of change:
How Has This Been Tested?
Describe how your changes have been tested.
entered my account number and it accepted
Checklist
Please confirm the following:
Summary by CodeRabbit
New Features
Documentation