summaryrefslogtreecommitdiff
path: root/category_search.py
diff options
context:
space:
mode:
Diffstat (limited to 'category_search.py')
-rw-r--r--category_search.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/category_search.py b/category_search.py
new file mode 100644
index 0000000..680df09
--- /dev/null
+++ b/category_search.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)