diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-09-25 16:52:19 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-09-25 16:52:19 +0200 |
commit | e91f02df33da10e7f18ac5c582f08134e9bea3c8 (patch) | |
tree | f64c120c3f44251b481630b252e487012d664bab /category_search_cmd.py | |
parent | a75ab11f03a45bc5f5e82b079d79b2cf423ac47c (diff) | |
download | octopart-stuff-e91f02df33da10e7f18ac5c582f08134e9bea3c8.tar.gz octopart-stuff-e91f02df33da10e7f18ac5c582f08134e9bea3c8.tar.bz2 octopart-stuff-e91f02df33da10e7f18ac5c582f08134e9bea3c8.tar.xz octopart-stuff-e91f02df33da10e7f18ac5c582f08134e9bea3c8.zip |
wip
Diffstat (limited to 'category_search_cmd.py')
-rw-r--r-- | category_search_cmd.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/category_search_cmd.py b/category_search_cmd.py new file mode 100644 index 0000000..680df09 --- /dev/null +++ b/category_search_cmd.py @@ -0,0 +1,16 @@ +import octopart + +#search_response = octopart.category_search_raw('resistor') +# +## print number of hits +#print "Hits: {}".format(search_response['hits']) +# +## print results +#for result in res['results']: +# item = result['item'] +# print "{}: {}".format(item['uid'], item['name']) + +categories = octopart.category_search('resistor') + +for c in categories: + print "{}: {}".format(c.uid, c.name) |