Currency Converter Improved
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.
Currency Converter: Issue #1310
- [x] I have provided the issue title.
Info about the Related Issue
What's the goal of the project?
The goal was to create a simple and easy to use Currency Converter with a basic GUI which can toggle between Light Mode and Dark Mode.
- [x] I have described the aim of the project.
Name
Please mention your name.
Yashasvi
- [x] I have provided my name.
GitHub ID
Please mention your GitHub ID.
Y4shu
- [x] I have provided my GitHub ID.
Email ID
Please mention your email ID for further communication.
[email protected]
- [x] I have provided my email ID.
Identify Yourself
Mention in which program you are contributing (e.g., WoB, GSSOC, SSOC, SWOC).
SSoC
- [x] I have mentioned my participant role.
Closes
Enter the issue number that will be closed through this PR.
*Closes: #1310 *
- [x] 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.
So earlier there was imperfect error handling and it was vulnerable to address like 4xx etc. So I have tried to improve that and this time I have also used an API Key to have more clearly working.
- [x] I have described my changes.
Type of Change
Select the type of change:
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] 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.
I ran the project I tried inputting correct and incorrect codes and toggled it as well.
- [x] I have described my testing process.
Checklist
Please confirm the following:
- [x] My code follows the guidelines of this project.
- [x] I have performed a self-review of my own code.
- [x] I have commented my code, particularly wherever it was hard to understand.
- [x] I have made corresponding changes to the documentation.
- [x] My changes generate no new warnings.
- [x] I have added things that prove my fix is effective or that my feature works.
- [x] Any dependent changes have been merged and published in downstream modules.
Summary by CodeRabbit
-
New Features
- Introduced a user-friendly GUI-based currency converter with real-time exchange rates and light/dark theme toggling.
- Added input validation and clear error messages for improved usability.
- Provided a batch script for easy launching of the application on Windows.
-
Documentation
- Added comprehensive README with setup instructions, feature overview, API usage notes, and contribution guidelines.
-
Chores
- Updated ignore rules to exclude environment files, virtual environments, and Python cache files.
Walkthrough
A new Python Tkinter-based currency converter project was added, including a GUI application, README documentation, a batch script for launching the app, and updates to the .gitignore for project-specific files. The application uses a live API for exchange rates, supports theme toggling, input validation, and error handling.
Changes
| File(s) | Change Summary |
|---|---|
| Beginner_Projects/Currency-Converter-with toggletheme/currency_converter.py | Added main GUI application for currency conversion with live API, theme toggle, and error handling. |
| Beginner_Projects/Currency-Converter-with toggletheme/README.md | Added documentation describing features, setup, usage, and contribution guidelines. |
| Beginner_Projects/Currency-Converter-with toggletheme/run_converter.bat | Added batch script to launch the currency converter using the project's virtual environment. |
| .gitignore | Updated to ignore .env, venv/, Python cache files, and retained .DS_Store. |
Sequence Diagram(s)
sequenceDiagram
participant User
participant GUI
participant API
User->>GUI: Enter from/to currency and amount
User->>GUI: Click "Convert" or press Enter
GUI->>API: Fetch exchange rates (with API key)
API-->>GUI: Return exchange rates (JSON)
GUI->>GUI: Validate input and calculate conversion
GUI->>User: Display result or error message
User->>GUI: Toggle theme (optional)
GUI->>GUI: Switch between light/dark mode
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Currency converter with input fields for from currency, to currency, and amount (#1310) | ✅ | |
| Use of live API for fetching currency rates and JSON parsing (#1310) | ✅ | |
| Simple GUI implementation using Tkinter (#1310) | ✅ | |
| Toggle between light and dark theme (#1310) | ✅ |
Poem
In a world of currencies, near and far,
I built a converter—my shining star!
With a hop and a click, exchange rates appear,
Light or dark mode, just as you cheer.
From rupees to yen, or dollar to pound,
My GUI magic makes conversions abound!
— 🐇✨
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
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.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Explain this complex logic.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
👋 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!
@Y4shu can you look into the issues that coderabbitai raises
@Y4shu i will close this issue by tomorrow EOD if i don't see any update on this.
To update the changes should i just commit and push again?
Yes It will automatically update this PR.
@Y4shu Brother, tell me in which folder you found this project data. please in detail. In PyVerse repo, there are many files he listed.
@Y4shu Brother, tell me in which folder you found this project data. please in detail. In PyVerse repo, there are many files he listed.
I didn't find the project data, I added to the beginner projects folder