{"id":13488256,"url":"https://github.com/sparkmicro/mouser-api","last_synced_at":"2025-03-28T00:33:23.630Z","repository":{"id":42514481,"uuid":"396922946","full_name":"sparkmicro/mouser-api","owner":"sparkmicro","description":"Mouser Python API","archived":false,"fork":false,"pushed_at":"2024-10-01T18:08:42.000Z","size":90,"stargazers_count":32,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-02T03:12:07.197Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sparkmicro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-16T18:33:27.000Z","updated_at":"2025-02-09T23:20:42.000Z","dependencies_parsed_at":"2024-10-31T00:30:44.743Z","dependency_job_id":"b6a3ac9d-7baa-4ae2-9edb-0c9e0049fb2a","html_url":"https://github.com/sparkmicro/mouser-api","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":"0.050000000000000044","last_synced_commit":"d62544862af612df28f6e4237b614cab112eda2c"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparkmicro%2Fmouser-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparkmicro%2Fmouser-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparkmicro%2Fmouser-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparkmicro%2Fmouser-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sparkmicro","download_url":"https://codeload.github.com/sparkmicro/mouser-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245949254,"owners_count":20698911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T18:01:12.413Z","updated_at":"2025-03-28T00:33:18.579Z","avatar_url":"https://github.com/sparkmicro.png","language":"Python","readme":"# Mouser Python API\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/sparkmicro/mouser-api/blob/main/LICENSE)\n[![Python Versions](https://raw.githubusercontent.com/sparkmicro/Ki-nTree/master/images/python_versions.svg)](https://www.python.org/)\n[![PyPI](https://img.shields.io/pypi/v/mouser)](https://pypi.org/project/mouser/)\n[![Style | Tests](https://github.com/sparkmicro/mouser-api/actions/workflows/tests.yaml/badge.svg)](https://github.com/sparkmicro/mouser-api/actions)\n\n## Setup\n\n### Requirements\n\n* Tested with Python 3.8+\n* Dependencies: [click](https://click.palletsprojects.com/en/8.0.x/) and [requests](https://docs.python-requests.org/en/master/) packages\n\n### Mouser API Keys\n\nMouser provides two separate API keys:\n* one for the cart and orders\n* one for part searches.\n\nGo to [Mouser's API hub](https://www.mouser.com/api-hub/) to request the keys.\n\nTo store the keys, two options:\n* create two environmental variables `MOUSER_ORDER_API_KEY` and `MOUSER_PART_API_KEY` with the respective values of each key\n* 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.\n\n\u003e :warning: Using the `mouser_api_keys.yaml` file method, make sure to run `mouser` commands in the same folder!\n\nThe keys will be automatically loaded for each API request.\n\n### Install\n\n#### Pip\n\n``` bash\npip install mouser\n```\n\n#### Manually\n\n1. Create virtual environment and activate it\n2. Run `pip install -r requirements.txt`\n\n#### Poetry\n\n1. Install `poetry` package: `pip install poetry`\n2. Run `poetry install`\n\n### Run\n\n#### Pip\n\n```bash\nmouser\n```\n\n#### Manually\n\n```bash\npython mouser_cli.py\n```\n\n#### Poetry\n\n```bash\npoetry run mouser\n```\n\n## Usage\n\nThis command line tool reflects the usage from Mouser's API structure [documented here](https://api.mouser.com/api/docs/ui/index#/).  \nThe first positional argument is the category of the request: cart (for MouserCart), order, history (for MouserOrderHistory) and search (for SearchAPI).\nThe second argument is the type of operation from the list of operations for each category.\n\nRun `mouser --help` for more information about the usage.\n\n### Examples\n\u003e The examples below assume this package was installed using Pip (for more options, see [above](#run))\n\n#### Part Number Search\n```bash\nmouser search partnumber --number XXX\n```\n\n#### Export order to CSV\n``` bash\nmouser order get --number XXX --export\n```\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsparkmicro%2Fmouser-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsparkmicro%2Fmouser-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsparkmicro%2Fmouser-api/lists"}