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
Made compatible with new exchange rate api #88
Conversation
You will need your own access_key which you can get for free after registering with 1000 request limit per month, please provide this key when you create CurrencyCodes as an argument CurrencyCodes(access_key) Also note that with free tier they don't support HTTPS currently all request will be HTTP based by default
It's like online banking for free bank accounts without HTTPS! |
@DaBors I got an error on line 106. CurrencyRates() in converter.py was expecting the api key. I just put empty quotes instead. Script works for me after doing this. Thank you. |
@DIGITALCRIMINAL Thank you for noticing that, should be fixed now. |
Thank you for doing this. I was really confused when my program stopped working a day or two ago. |
I ended up downloading the code and pasting it into my project. Couldn't get it to work with pip via github. |
Please can you explain that? |
I don't think your get_rates method works. I keep getting only EUR exchange rates when I put different currencies in.
|
@thusodangersimon NOTE: Changing the source currency is only available if you are on a paying plan it's not available for users through free plan. In that case the new fix should solve your problem. |
@dbarnes18 Which in this case should be: pip install git+https://github.com/DaBors/forex-python.git@ratesapi-fix Not sure if this is allowed in your platform, if not you can copy paste the code, or pick one of these shorter solutions mentioned in the api issue: Hope you can make it work :) |
Thanks.
Do I actually need an access key though?
While the original forex-python was working I didn’t, but now I get an ***@***.***D75260.0F5CD880]
This is my project: https://replit.com/@DillonB0/14-Unit-Converter
Thanks if you are able to help. No problem if you can’t, because you already have helped quite a bit.
From: Márton Borsos ***@***.***>
Date: Wednesday, 26 May 2021 at 18:44
To: MicroPyramid/forex-python ***@***.***>
Cc: Barnes,Dillon ***@***.***>, Mention ***@***.***>
Subject: Re: [MicroPyramid/forex-python] Made compatible with new exchange rate api (#88)
CAUTION: This email originated from outside of the School. Do not click links or open attachments unless you recognize the sender and know the content is safe. Please contact IT Support if you are unsure.
@dbarnes18<https://github.com/dbarnes18>
You should be able to use pip with the following format: pip install ***@***.***
Which in this case should be: pip install ***@***.***
Not sure if this is allowed in your platform, if not you can copy paste the code, or pick one of these shorter solutions mentioned in the api issue:
#86 (comment)<#86 (comment)>
#86 (comment)<#86 (comment)>
Hope you can make it work :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#88 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AUAPGD45TLHEPS6CMLQVDTTTPUXPJANCNFSM45HMS56Q>.
Note: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Beaumont Leys School reserves the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. Thank You.
|
@dbarnes18 Yes, you can create a free account with the free account the usages are quite limited the currency rates are only being updated once per day, switching source currency is not supported. (You can also pay for an account, but not all the changes in the API are not implemented yet here) I would suggest you to switch to this project https://pypi.org/project/CurrencyConverter/ a lot of people changed to it, since this problem occurred. |
Thank you!
I will give that a go when I get time.
From: Márton Borsos ***@***.***>
Date: Wednesday, 26 May 2021 at 19:09
To: MicroPyramid/forex-python ***@***.***>
Cc: Barnes,Dillon ***@***.***>, Mention ***@***.***>
Subject: Re: [MicroPyramid/forex-python] Made compatible with new exchange rate api (#88)
CAUTION: This email originated from outside of the School. Do not click links or open attachments unless you recognize the sender and know the content is safe. Please contact IT Support if you are unsure.
@dbarnes18<https://github.com/dbarnes18>
Yes, you can create a free account with the free account the usages are quite limited the currency rates are only being updated once per day, switching source currency is not supported. (You can also pay for an account, but not all the changes in the API are not implemented yet here)
I would suggest you to switch to this project https://pypi.org/project/CurrencyConverter/ a lot of people changed to it, since this problem occurred.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#88 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AUAPGD6MSUUM74WL4F2LU3TTPU2OPANCNFSM45HMS56Q>.
Note: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Beaumont Leys School reserves the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. Thank You.
|
raise RatesNotAvailableError("Currency Rates Source Not Ready") | ||
|
||
|
||
_CURRENCY_FORMATTER = CurrencyRates() | ||
# Please add your access key here | ||
_CURRENCY_FORMATTER = CurrencyRates("your_access_key") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the access key should be read from on environtment variable.
This will allow to make it work without alterint the source code.
Probably the same should be done to activate the SSL access.
@DaBors |
I totally agree with you @ravigadila and users should have freedom to use other paid services too if they want. |
@ashwin31 It's good idea to make exchangerateapi as optional and default option as free api. |
Note: This is not an optimal change just a hotfix to make the code work
You will need your own access_key which you can get for free after registering with 1000 request limit per month, please provide this key when you create CurrencyCodes as an argument CurrencyCodes(access_key)
Also note that with free tier they don't support HTTPS currently all request will be HTTP based by default