Quansight Events

    import pandas, requests_cache, requests, uritemplate
    from toolz.curried import *
    requests_cache.install_cache('qs')
    qs = pandas.Series(requests.get('https://api.github.com/orgs/quansight', params=params).json())
    i = 0 
    while True:
        i += 1
        if len(requests.get(F"{uritemplate.expand(qs.members_url)}?page={i}", params=params).json()) == 30: continue
        break
    members = pandas.concat([pandas.DataFrame(requests.get(F"{uritemplate.expand(qs.members_url)}?page={i}", params=params).json()) for i in range(1, i+1)])
    events = pandas.concat([
        pandas.DataFrame(requests.get(x, params=params).json())
        for x in members.events_url.apply(uritemplate.expand, {'privacy': 'public'})
    ], sort=True)
    graph = pandas.concat({'user': events.actor.apply(pandas.Series), 'repo': events.repo.apply(pandas.Series)}, axis=1).set_index(
        events.created_at.pipe(pandas.to_datetime)
    )
    gaant = graph.repo.name.str.rpartition('/')[2].pipe(pandas.get_dummies).groupby(pandas.Grouper(freq='2W')).sum()
    import hvplot.pandas, holoviews
    pandas.DataFrame(pandas.np.fft.fftshift(pandas.np.fft.ifftn(
        pandas.np.multiply(pandas.np.fft.fftn(gaant, axes=[0, 1]), pandas.np.conj(pandas.np.fft.fftn(gaant, axes=[0, 1])))
    ).real)).pipe(lambda df: holoviews.HeatMap((df.columns.tolist(), df.index.tolist(), df.values), datatype=['grid'])).opts(
        width=1000, cmap='twilight')
Written on October 14, 2019