microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.99k stars 6.48k forks source link

[Run][New Plugin] Currency converter #3248

Closed aarish21 closed 2 years ago

aarish21 commented 4 years ago

image this would be very useful feature for everyone I hope you guys can implement it

byeze commented 4 years ago

Up!

crutkas commented 4 years ago

good idea

aarish21 commented 4 years ago

good idea

why not add everything that calculator can convert

PhilTb7 commented 4 years ago

good idea

why not add everything that calculator can convert

exactly! that's even better than integrating the wox plugin "currency converter"

also consider other functions which exist as wox plugin already (websearch, google translate) -> https://github.com/microsoft/PowerToys/issues/3226

as well as existing features in the UELI launcher -> https://github.com/microsoft/PowerToys/issues/3228

aarish21 commented 4 years ago

good idea

why not add everything that calculator can convert

exactly! that's even better than integrating the wox plugin "currency converter"

also consider other functions which exist as wox plugin already (websearch, google translate) -> #3226

as well as existing features in the UELI launcher -> #3228

yeah fully web integration would be great

Firestone91 commented 3 years ago

Can anyone tell me how is the progress in this task? I can't wait because the currency converter will be very useful for me. The unit/currency converter doesn't work for me that's why i am waiting for new update.

ThiefZero commented 3 years ago

Can anyone tell me how is the progress in this task? I can't wait because the currency converter will be very useful for me. The unit/currency converter doesn't work for me that's why i am waiting for new update.

There's no spec and nobody writing code as far as I know. It might take a while.

Firestone91 commented 3 years ago

Can anyone tell me how is the progress in this task? I can't wait because the currency converter will be very useful for me. The unit/currency converter doesn't work for me that's why i am waiting for new update.

There's no spec and nobody writing code as far as I know. It might take a while.

Do you think PowerToys Run is slowly dying? Do you know what awaits her now? To be honest, this module is very useful for me and I use it on a daily basis, and the additional functionalities only improve the convenience of using it.

andreperegrina commented 3 years ago

Is there anyone working on this? Because I would like to work on this option

crutkas commented 3 years ago

@andreperegrina best of my knowledge no but ultimately where does the data come from for the query?

andreperegrina commented 3 years ago

@andreperegrina best of my knowledge no but ultimately where does the data come from for the query?

I don't not yet. I haven't done the research or code. I just download this tool and I think it's amazing. I usually use spotlight to convert dollars to pesos in my Mac and I was wondering if I can do the same here.

This is why I want it to contribute.

dougwl commented 3 years ago

Does MSN Money have some sort of API? Because it has a currency converter using its own data.

https://www.msn.com/en-us/money/tools/currencyconverter

Edit: Ok, they seem to use https://www.refinitiv.com as source.

Firestone91 commented 3 years ago

Hello guys, I wanted to ask how is going about this function. I am waiting for this Currency converter from last year, but no particulars so far. Have you now any API or database from where the powertoys could get the currency data? Or an IDEA how do this?

dedavis6797 commented 26 days ago in #12112

Great suggestion, we'll track this for our feature request milestone and figure out prioritization/implementation timeline following our general stability efforts. Thanks!

But in β€œProjects” to versions 0.45 and 0.47 I can't find this function.

PS, I admire your work with PowerToys, this tool became my favorite out of the box. I hope this functionality will see the light of day soon. I wish you the easiest possible code writing :).

TomerGamerTV commented 3 years ago

Still waiting....

MrJellyB commented 3 years ago

Hey guys, I think I can try to work on that feature if there is no other person who did. but I am new to contributing code (I read the the docs about contributing). Can a team member help me to kick off and guide me what should I do?

jaimecbernardo commented 3 years ago

Hi @MrJellyB ,

Thank you for showing interest.

We have some docs about adding a plugin to PowerToys Run here: https://github.com/microsoft/PowerToys/tree/master/doc/devdocs/modules/launcher

It might be helpful looking at some PRs that added plugins, as well. Here's an example for the Windows Settings plugin: https://github.com/microsoft/PowerToys/pull/9137 https://github.com/microsoft/PowerToys/pull/11663

crutkas commented 3 years ago

Can someone share how their api works? This is not currently a plug-in we are planning based on our roadmap.

asheroto commented 2 years ago

Request: Not just fiat currency, but crypto too 😊😊😊😊😊

TomLewis commented 2 years ago

when is this being added?

sibber5 commented 2 years ago

this could be added to the unit converter plugin

crutkas commented 2 years ago

Issue still is data source. I think this could be a community supported plugin but as of now, we lack a data source.

TomLewis commented 2 years ago

Hell of a lot of options here: https://stackoverflow.com/questions/3139879/how-do-i-get-currency-exchange-rates-via-an-api-such-as-google-finance

To overcome the limits on all these free ones you could simply have a service that caches results from any of these sources and data is read from the cache/CDN.

ThiefZero commented 2 years ago

Hell of a lot of options here: https://stackoverflow.com/questions/3139879/how-do-i-get-currency-exchange-rates-via-an-api-such-as-google-finance

To overcome the limits on all these free ones you could simply have a service that caches results from any of these sources and data is read from the cache/CDN.

With only 250 to 1000 requests per month you won't be able to make use of a free service. Remember that's 1000 request per API key that every user of this feature would share.

Caching the results seems counter productive as you then are using possible outdated trading values (in addition of having no way of knowing when they need to be updated).

Data source is indeed the issue and without Microsoft or any currency API service supplying the community with a plan and API key I don't see a way of this feature being implemented.

asheroto commented 2 years ago

Could we make it where the user could sign up and insert their own API key?

TomLewis commented 2 years ago

using possible outdated trading values

Even if its only updated once a day, that's better than nothing. I only use it on spotlight for rough conversion, so I have an estimate what a conversion would be. I don't think anyone's going to be using it for anything extreme.

The cache would just be a mirror of what's possible with whatever service is used, hell multiple services could be used to create this cache server, maybe cache is the wrong word? I'm wondering if we could use something like vercel query these APIs to their max requests to host a public version that isn't rate limited.

1000 requests a month, that's 33 updates per day, that's plenty!

edit: I looked up Vercels free server-less function tier, and it says "Serverless Function Execution | Up to 100 GB-Hrs" https://vercel.com/docs/concepts/limits/fair-use-policy

That seems like it could handle an API request 33 times a day and hosting an API.

crutkas commented 2 years ago

I don't like the idea of someone having to put in their own API key. I'm also willing to bet that model is against the services TOS. I don't think a Microsoft product should piggy back off someone's service / compute / bandwidth like that. If i was that company, i'd be irked.

TLDR: We can't stop a community plugin from adopting such a model but that model is not one I want inside PowerToys.

sibber5 commented 2 years ago

can't we query to bing's currency converter and parse the result?

ThiefZero commented 2 years ago

Is there any way that Microsoft could supply an API key or service for the community to use for this feature?

crutkas commented 2 years ago

@cyberrex5 / @ThiefZero I don't think the API is open for 3rd parties (which PT would be treated like that)

TomLewis commented 2 years ago

Why cant this be used? This is a microsoft product with microsoft developers right? https://docs.microsoft.com/en-us/partner/develop/get-foreign-exchange-rates

crutkas commented 2 years ago

@TomLewis that api is for azure pricing sheets.

Currently used with get price sheet API to calculate expected charges for Azure plan CSP local currencies.

TomLewis commented 2 years ago

Oops!

RinMinase commented 2 years ago

Hell of a lot of options here: https://stackoverflow.com/questions/3139879/how-do-i-get-currency-exchange-rates-via-an-api-such-as-google-finance

To overcome the limits on all these free ones you could simply have a service that caches results from any of these sources and data is read from the cache/CDN.

What about this one? This also came from that link, but no one seems to be talking about it.

Free & Blazing Fast response using CDN No Rate limits 150+ Currencies, Including Common Cryptocurrencies Daily Updated

https://github.com/fawazahmed0/currency-api

Sample Request: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies/usd.json

Are there any pitfalls to using this data source?

crutkas commented 2 years ago

@rinminase, where does that data come from. Can you confirm the data's legitimacy and validity? If PowerToys has a plugin that sources data, we need to validate and be sure it stays valid. They do not say where that data is sourced from. To me, that is a big red flag.

RinMinase commented 2 years ago

@crutkas, it fetches from CoinMarketCap basing on this commit. The data-source URL seems to be placed in the ENV.

This seems to be another issue I found: I validated it, but sadly by eye only, that it fetches on the 12AM on the value of each currency. It does not fetch the data again whenever it changes within the day. So its currency data-source would not be "valid" during the rest of the day as exchange rates would change (possibly by the decimals) throughout the day.

lokize commented 2 years ago

+1 for this, because is very useful resource.

crutkas commented 2 years ago

I don't see PowerToys itself creating this. While it is a popular request, it requires a service backend and honestly would be best suited against 3rd party plugin support which is #3200

asheroto commented 2 years ago

For some crazy reason I remembered this exact issue from awhile ago. I stumbled across this website that is free exchange rate information. A user could be easily guided to utilize the API key. Free plan is 1k requests/month.

https://openexchangerates.org/

AlexHunterCodes commented 2 years ago

Can people please stop adding to this thread with random 3rd party exchange rate APIs that can't scale or meet legal/security/accuracy/reliability requirements? Realistically, if this ever gets the green light as a 1st party plugin, it will be with one of Microsoft's own APIs or not at all.

That said, calc.exe on Windows 10 and later already has a built-in currency converter which hits api.msn.com (which means that valid API keys technically ship with every install of Windows 10-11 🀷).

Their readme explicitly says that API is not licenced for other use, but if Microsoft can licence Microsoft's data feed from Microsoft to Microsoft for use in Microsoft's open source calculator app which already ships with every copy of Microsoft's operating system, then it seems mad to me that Microsoft's PowerToys can't access a similar / the same licence too, or piggyback off of Calculator's existing functionality.

So here's a new idea. There's an open feature request microsoft/calculator#1524 to add some kind of command line argument or protocol handler support. If that goes anywhere, perhaps this issue could be revisited to parse a currency conversion search query and then simply open Calculator with the right arguments (just like opening a search query in a web browser). That way, PowerToys wouldn't need to directly licence or consume any APIs at all.

janeoa commented 1 year ago

Does it work now? Why is this issue closed?

Jay-o-Way commented 1 year ago

@janeoa see https://github.com/microsoft/PowerToys/issues/3248#issuecomment-1127188055

janeoa commented 1 year ago

@janeoa see #3248 (comment)

Oof. Sorry, but I dont really get it. The issue is open, and most of the people are talking about some wox. Is it a full version of powertoys? Is there a way to mae your own plugins for powertoys?

Advaith3600 commented 8 months ago

I created a custom plugin for this https://github.com/Advaith3600/powertoys-run-currency-converter Let me know if this helps.