Understanding Python module usage on GitHub with python-api-inspect

Sunday, July 14th, 2019 | Uncategorized

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:

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&namespace=sympy&function=sympy.physics.quantum%25

If you click on the link you can fill in your own project and package to search for.

Meta

Search