Skip to content

Refactored currencies.py to handle currency logic only #452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2025

Conversation

sue-lim
Copy link
Contributor

@sue-lim sue-lim commented Jun 9, 2025

Refactored currencies.py to Isolate Currency Logic

[FEATURE] Currency Script | Create a currency management module #432

Summary

Separated currency-specific logic into currencies.py for modularity and easier maintenance.

Description

This PR introduces improvements by modularising the project. The changes focus on extracting currency-related functionality into its own module, currencies.py, which includes functions for:

  • Getting supported currency codes
  • Validating if a currency is supported

The changes are as follows:

  • Created currencies.py module
  • Added get_supported_currencies() function
  • Added is_valid_currency() function
  • Included manual test examples in the main block
  • Improved readability and beginner-friendliness of code
  • Removed unnecessary type hints for simplicity

Checks

in the repository

  • Made no changes that degrades the functioning of the repository
  • Gave each commit a better title (unlike updated README.md)

in the PR

  • Followed the format of the pull_request_template
  • Made the Pull Request in a small level (for the creator's wellfare)
  • Tested the changes you made, manually & via unittest

image

Thank You,

Sue

@sue-lim
Copy link
Contributor Author

sue-lim commented Jun 9, 2025

@DhanushNehru - please kindly approve PR.

@DhanushNehru DhanushNehru merged commit 7de7541 into DhanushNehru:main Jun 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants