{"id":121,"date":"2019-07-14T20:46:28","date_gmt":"2019-07-14T20:46:28","guid":{"rendered":"http:\/\/hodgestar.za.net\/blog\/?p=121"},"modified":"2019-07-14T20:48:08","modified_gmt":"2019-07-14T20:48:08","slug":"understanding-python-module-usage-on-github-with-python-api-inspect","status":"publish","type":"post","link":"https:\/\/hodgestar.za.net\/blog\/2019\/07\/understanding-python-module-usage-on-github-with-python-api-inspect\/","title":{"rendered":"Understanding Python module usage on GitHub with python-api-inspect"},"content":{"rendered":"<p>A SciPy 2019 <a href=\"https:\/\/docs.google.com\/presentation\/d\/1iGnnNh-qxPOJcuIPxNNNwYhp5whV4RqQCduC6Ar1VVs\/edit?usp=sharing\" target=\"_blank\">lightning talk<\/a> by Chris Ostrouchov introduced me to his project <a href=\"https:\/\/github.com\/Quansight-Labs\/python-api-inspect\" target=\"_blank\">python-api-inspect<\/a>. This provides an API for querying Python package usage on GitHub (and hopefully soon other source control systems).<\/p>\n<p>It includes very flexible SQL queries, for example this one which we used to find packages that use the <em>sympy.physics.quantum<\/em> package within <em>sympy<\/em>:<\/p>\n<p><a href=\"https:\/\/python-api-inspect.aves.io\/inspect?sql=++SELECT+DISTINCT+File.project%0D%0A++FROM+FunctionStats%2C+json_each%28FunctionStats.stats%29%0D%0A++JOIN+File+ON+FunctionStats.id+%3D+File.id%0D%0A++WHERE+FunctionStats.namespace+%3D+%3Anamespace%0D%0A++++AND+key+LIKE+%3Afunction%0D%0A++++AND+File.filename+NOT+LIKE+%27%25%2Fsite-packages%2F%25%27&amp;namespace=sympy&amp;function=sympy.physics.quantum%25\">https:\/\/python-api-inspect.aves.io\/inspect?sql=++SELECT+DISTINCT+File.project%0D%0A++FROM+FunctionStats%2C+json_each%28FunctionStats.stats%29%0D%0A++JOIN+File+ON+FunctionStats.id+%3D+File.id%0D%0A++WHERE+FunctionStats.namespace+%3D+%3Anamespace%0D%0A++++AND+key+LIKE+%3Afunction%0D%0A++++AND+File.filename+NOT+LIKE+%27%25%2Fsite-packages%2F%25%27&amp;namespace=sympy&amp;function=sympy.physics.quantum%25<\/a><\/p>\n<p>If you click on the link you can fill in your own project and package to search for.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A SciPy 2019 lightning talk by Chris Ostrouchov introduced me to his project python-api-inspect. This provides an API for querying Python package usage on GitHub (and hopefully soon other source control systems). It includes very flexible SQL queries, for example this one which we used to find packages that use the sympy.physics.quantum package within sympy: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-121","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/posts\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/comments?post=121"}],"version-history":[{"count":4,"href":"https:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/posts\/121\/revisions"}],"predecessor-version":[{"id":125,"href":"https:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/posts\/121\/revisions\/125"}],"wp:attachment":[{"href":"https:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/media?parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/categories?post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/tags?post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}