sparkmicro / mouser-api Goto Github PK
View Code? Open in Web Editor NEWMouser Python API
License: MIT License
Mouser Python API
License: MIT License
Describing the problem
Visiting https://pypi.org/project/mouser/ and using link to git repo results in Error 404.
How to solve
Link needs to be updated to new repository name https://github.com/sparkmicro/mouser-api
"create a file named mouser_api_keys.yaml with the order API key on the first line and the part API key on a second line."
I have done this but am now confused on where to place this file in my windows directory. When I call the API i get "[ERROR] API Keys File "mouser_api_keys.yaml" Not Found"
I wrote a code of getting data of mpn
`import requests
import json
api_key = ''
search_term = 'SI4450DY-T1-E3'
url = f'https://api.mouser.com/api/v1/search/partnumber?apiKey={api_key}&partnumber={search_term}'
headers = {
'Content-Type': 'application/json',
'x-mouser-api-key': api_key
}
payload = {
'SearchByPartRequest': {
'mouserPartNumber': search_term,
'IncludeExtendedAttributes': 'true'
}
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
with open("data.json", "w") as outfile:
json.dump(data, outfile, indent=4)
print(data)
`
is it possible to get package case information (like SOIC-8) in this part
i can't find it on the documentation
It doesn't appear to be authenticating my mouser key. I tried entering the keys in manually to the Mouser Test.py file on lines 22 & 23 as well as putting the mouser_api_keys.yaml file in the directory. I have modified the test_mouser.py by adding the following code at the end:
test_version()
test_search_partnumber()
I know it is going to be a me not doing something right on this one, but help would be greatly appreciated.
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.