An open API service indexing awesome lists of open source software.

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

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("")
```