From e91f02df33da10e7f18ac5c582f08134e9bea3c8 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 25 Sep 2015 16:52:19 +0200 Subject: wip --- category_search_cmd.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 category_search_cmd.py (limited to 'category_search_cmd.py') 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) -- cgit v1.2.3