hildogjr / KiCost

Build cost spreadsheet for a KiCad project.
MIT License
496 stars 97 forks source link

usage of --currency switch on prices and excel sheet #425

Closed sebo83910 closed 3 years ago

sebo83910 commented 3 years ago

Hello,

I use kicost 1.1.4 with the switch currency set to EUR. I have two remarks.

Thanks for your excellent work!!

hildogjr commented 3 years ago

Yes, the conversion was introduced by me, it prioritize the values passed by the distributors and made conversion by CurrencyConverter python module, when not present. Usually, by the API, the distributors just provide USD or USD+EUR (but not always).

You can update CurrencyConverter, that have a static conversion database. Also, the spreadsheet have the currency rate listed bellow all your parts (edit them to update the values).

Because of this behavior: the currency rate may not be up-to-date and to use a online server to do that was necessary an API and user login and, the comments-balloons are static (doesn't change with the update of the cell with the current rate). I kept them as original distributor currency, it is not the best but it was what I though at the moment.

sebo83910 commented 3 years ago

Hi @hildogjr, Is it possible to retrieve the data in EUR instead of USD? I mean without converting the price within the python? If look at mouser for instance, the prices migth be significantly different when I look at the website... The available quantity as well...

hildogjr commented 3 years ago

Yes, just not use --currency on call.

Some distributor have native USD and EUR and KiCost prioritize USD, but I didn't remember if EUR get deleted in this case on api_partinfo_kitspace.py functions.

The difference in qty is because we use KitSpace API, that update it database time-by-time on demand. The ffinal solution to this is have suport for all distributors APIs, but it demands some code https://github.com/xesscorp/KiCost/issues/386.

sebo83910 commented 3 years ago

Now I'm confused. I removed the switch --currency and I have the same results. I thought everything would be in USD in this case...

sebo83910 commented 3 years ago

No sorry. I talked too fast sorry. USD by default without the switch. I've been looking at the code but I can't find a way to retrieve the data in EUR form Mouser (as an example). Moreother, I see a py file for octopart. Does the tool support octopart queries instead of kitspace?

hildogjr commented 3 years ago

I think, specific Mouser (I am not sure) just have EUR in the KitSpace API, so USD is internally generated.

Yes, you can use Octopart instead Kitspace, just need to manually change the code that call into kicost.py. There isn't a command yet for this due #386 implementation missing.

sebo83910 commented 3 years ago

For Mouser, I don't know. it seems to me everything out of the call to KitSpace API is in USD or GBP.

I tried to switch to Octopart as you suggested: api_octopart.query_part_info(parts, distributor_dict, currency). It crashes so far.

hildogjr commented 3 years ago

You need you on KEY / license / registration to run Octopart.

GBP is the base currency for RS, if I remember...

sebo83910 commented 3 years ago

yes indeed, there is a key required along with a registration. So, what's the current status for kicost? do you have a roadmap for future improvement of the tool?

hildogjr commented 3 years ago

I have a personal roadmap, second some needs mine and others https://github.com/xesscorp/KiCost/milestones but not time to develop all by my self.

After fix this bunch of issue, we can return to v2 discussion https://github.com/xesscorp/KiCost/issues/396.

Feel free if you can fix any of those issues. The forum is also missing Windows users to test the new features before release.

hildogjr commented 3 years ago

There was some changes @set-soft of how the prices currencies are converted. @sebo83910, could you check the last code on this repository?

set-soft commented 3 years ago
  1. Now we update the currency conversion. So differences should be (now) some distributor detail.
  2. Now Octopart can be enabled from command line and/or environment. Seems to be working.
  3. I verified that using --currency EUR we are selecting the values in EUR (when available of course)

For the above reasons, and the lack of reply, I'm closing this issue