-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add supplier jameco electronics #247
Add supplier jameco electronics #247
Conversation
…Inventree, Param map for Electronics does not exist warning. Part creation failed error, check Ki-nTree settings match Inventree part settings error msg.
…rs work with requests.get() and not urllib.request.urlopen()
That happens with testing on |
@hillsandales Check the CI, there is some kind of error loading the Jameco settings while launching the GUI |
I found a few typos. I didn't find them earlier because those sections of the code weren't being run because I had a user config directory already created in $HOME. I ran through my additions again and fixed the typos. I removed my $HOME config directory to let the program create a new directory and copy files in. Should be okay now, I hope. I'll submit a separate pull request for both Automation Direct and Jameco suppliers having tested both at this point. |
I've added Jameco Electronics as a searchable supplier. I have a bunch of parts I bought from Jameco, and wanted to easily add them to the Inventree database. I've tested it with various part numbers and it seems to work okay. I managed to find the API URL that Jameco's search sends data to when searching on their site. I started with trying to scrape the site with bs4, but they run Cloudflare that protects against scraping. Looking at the request sent when searching a part on their site was the key and works much better. For image download, they also protect, so I used cloudscraper in that case, which gives a slight delay and also retries a few times every delay. It seems to work and downloads the image on the second attempt, if the first attempt times out.
Not sure if anyone buys parts from Jameco, but they offer project kits and parts for hobby projects, so perhaps it'll help someone else.
Let me know what you think. I tried running
invoke test
and it starts up, but then errors out with an error connecting to the Inventree server. I'm not sure why that is--the GUI works and creates parts on the InvenTree server fine.