-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
A couple of suggestions #10
Comments
Hey, thanks for using this tool! Regarding your first code sample, that seems to be based on an outdated version of Generally, if you use a DigiKey SKU, it should only be matched by DigiKey, unless it somehow matches another MPN (which is relatively unlikely).
That's unfortunate, could be that they just recently improved their anti crawling measurements. (The whole
If you configure Reichelt as the last supplier in |
Oh, OK. I got "part not found" from any without the changes. I installed using pipx this morning, so I guess the release hasn't been pushed there? I'll try not being lazy and clone the repo instead to get the latest.
Ah, didn't know. Will test that |
It definitely should be, that seems very odd. Have you tried installing this before? To update with pipx you have to use |
The image downloading code also still seems to work for me btw, maybe you got temporarily blocked or something? |
You can also just directly install the newest version from git via pipx btw: |
Just confirmed that this is indeed not working anymore ... |
Closing this in favor of #14 |
Hi
First, big thanks for this! I've got chaotic parts spread all over and this really helps me actually start using inventree!
While using the script I've been bumping into a few things, and just want to share my thoughts. No problem if you don't want to add anything of it. Also, as you'll notice, Python isn't my language, that's why I didn't make a PR:
First, in some cases I have the actual supplier . For instance it's printed on the bag with the part. It then fails to find the part. What I hacked in was this part in supplier_digikey.py:
This isn't really optimal, ideally here I think it should first test with all suppliers if it's an actual supplier product ID, then search the others with the exact manufacturer ID to get new shots at images/data sheets and prices.
Another thing I noticed is that Digikey is somehow blocking media requests, in my case (with the above tweak) I ran with 4878-2N7000TR-ND as the parameter. The media URL returned was https://mm.digikey.com/Volume0/opasdata/d220001/medias/images/3602/MFG_BC327-16.jpg which opens fine in browsers, but fails with non-browsers. I also tried doing the exact same request as my browser, but with curl, and it failed as well.
In any case that made stumble upon this bug:
When getting back 301 forbidden _download_file_content returns None, which makes upload_image crash as it's expecting two variables back:
I simply changed the except to return None, None and that seems to fix it. Didn't figure out a way to actually get the image sadly.
For Reichelt, it sucks they don't have an API, maybe only use them as a fallback if there are no matches in the others? I have a fair share of parts from them so I like to have them activated (took a while to figure out how to actually activate them btw), but if the part is found elsewhere the data quality is much better there.
Hope I don't come across as pushy. I really appreciate what you've done!
The text was updated successfully, but these errors were encountered: