Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mplewis/digiglass
Search Digi-Key from your terminal
https://github.com/mplewis/digiglass
Last synced: about 2 months ago
JSON representation
Search Digi-Key from your terminal
- Host: GitHub
- URL: https://github.com/mplewis/digiglass
- Owner: mplewis
- License: mit
- Created: 2015-05-14T03:25:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-05-23T07:19:13.000Z (over 1 year ago)
- Last Synced: 2024-11-01T06:36:08.491Z (2 months ago)
- Language: Python
- Size: 21.5 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Digiglass
*Search Digi-Key from your terminal*
Searching Digi-Key can be a pain. Here's a list of things I do every time I search for an item:
* Filter by "In Stock"
* Filter by "Quantity Desired: 1"
* Sort by price, ascendingEach of those actions takes a click and a couple seconds to load. I can automate these tasks and do most of the work from the command line.
# Usage
* Search for blue LEDs:
`digiglass blue led`
* Search for 470-ohm resistors in the through-hole category:
`digiglass -c 'through hole resistor' 470 ohm`
* Browse all resistor kits:
`digiglass --category 'resistor kit'``-c` and `--category` are interchangeable. Category names support fuzzy search - you can type part of the name and the proper category will probably appear.
# Installation
This is a Python 3 script, so use `pip3` to install:
```
pip3 install digiglass
```# Filters
Specify a filter to be used during a search like this: `digiglass --filter some_new_filter`
You can customize the filters used by Digiglass by modifying `~/.digiglass`. It's a YAML file that looks like this:
```
filters:
my_filter:
in_stock: true
lead_free: false
rohs_compliant: false
sort_by: '1000011' # Unit price, USD, ascending
min_quantity: 1
pb_rohs:
lead_free: true
rohs_compliant: truesettings:
default_filter: my_filter
```Valid options are:
* `in_stock`: Item must be in stock
* `lead_free`: Item must be lead free
* `rohs_compliant`: Item must be RoHS compliant
* `sort_by`: The column by which to sort results
* `min_quantity`: At least this many of this item must be availableEvery field in a filter is optional.
`default_filter` is used when no filter is specified.
Fields not specified in a requested filter use the default filter's settings.
# Troubleshooting
Having issues? Try clearing the app's cache: `digiglass --clear-cache`
Still having issues? Odds are Digi-Key changed their HTML format. They probably broke the app's screen scraping. Let me know and I'll try and fix it—or dig in yourself! Screen scraping is fun.
# Contributions
Bug reports, fixes, or features? Feel free to open an issue or pull request any time. You can also tweet me at [@mplewis](http://twitter.com/mplewis) or email me at [[email protected]](mailto:[email protected]).
# License
Copyright (c) 2014 Matthew Lewis. Licensed under [the MIT License](http://opensource.org/licenses/MIT).