https://github.com/alexsartori/pymouser
Python module to interact with Mouser's Search API
https://github.com/alexsartori/pymouser
mouser mouser-api mouser-electronics python python3
Last synced: about 24 hours ago
JSON representation
Python module to interact with Mouser's Search API
- Host: GitHub
- URL: https://github.com/alexsartori/pymouser
- Owner: AlexSartori
- License: mit
- Created: 2023-03-17T15:54:32.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-21T19:58:21.000Z (about 2 years ago)
- Last Synced: 2025-02-22T09:29:44.979Z (4 months ago)
- Topics: mouser, mouser-api, mouser-electronics, python, python3
- Language: Python
- Homepage: https://pypi.org/project/pymouser/
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyMouser
## Installation
Install the package with pip.
```pip install --user pymouser```
## Usage:
```python
import pymouser# Initialize the package with your API key
mouser = pymouser.MouserAPI('your-search-key')# Search by Part-Number
err, res = mouser.search_by_PN('your-part-number')# Check for errors or print the returned results
if err:
print("Error during request:")
print(err)
else:
if res['NumberOfResult'] == 0:
print("No results matched the part number")
else:
for match in res['Parts']:
print("Match for PartNumber .... %s" % match['MouserPartNumber'])
print("Description ............. %s" % match['Description'])
print("Link to datasheet ....... %s" % match['DataSheetUrl'])
print("Link to product page .... %s" % match['ProductDetailUrl'])
print("")
```