Using GitHub Actions and Jupyter Notebooks to track Living With Machines GitHub traffic

|Written by Daniel van StrienDecember 15, 2020Comments: 0

Funded research projects usually need to show they are spending money effectively and are having an impact on people. One very imperfect way of trying to measure this success is through various ‘access’ and ‘usage’ statistics. 

For a website, these access stats might be the number of visitors to a website or page. Living with Machines, as a project developing and utilising computational approaches, is also making extensive use of GitHub. GitHub is a platform used for hosting code, collaborating on open-source software projects, and increasingly for a variety of educational resources. 

The Living with Machines project has a GitHub Organization under which various repositories related to different strands of the project are hosted. Since these repositories represent an output on the project, it is helpful to capture some basic usage stats for them.

GitHub provides some usage statistics for repositories, including the number of views, clones (sort of equivalent to downloads), stars (sort of a bookmark/like) and forks (a copy someone else makes of the repository). These statistics are only shown for the most recent two weeks. Since we want to have information for longer periods of time, we needed to capture these two-week snapshots on a semi-regular basis. 

We could do this manually on a weekly schedule, but this is a bit of a clunky solution. GitHub provides a service called GitHub Actions which can be used to automate processes. In our case, we combined GitHub Actions with Jupyter Notebooks and nbconvert, a library for converting Jupyter notebooks into different formats. This results in an HTML version of a report notebook that is updated weekly. 

If you are interested in a longer explanation of how this works, you can look at the README for the repository hosting the report. 



Our Funder and Partners