Skip to content

PyCon Ireland 2019 talk - Python iterators as a tool for analysing a social network

License

Notifications You must be signed in to change notification settings

yoniLavi/PyConIreland2019

 
 

Repository files navigation

Python iterators as a tool for analyzing a social network

A simple iterator-based approach for visualizing a Slack social network presented by Yoni Lavi at PyCon Ireland 2019.

The tool generates a directed graph of all mentions on a Slack community, with users as nodes and edges for users mentioning one another. The edge widths are weighted by the number of mentions between the two users and the node areas are proportional to the total mentions of that user. In addition nodes are colored with a shade of red corresponding to their pagerank, which provides a more global measure of a user's influence.

Dependencies

  • An admin Slack API key (xoxp-*), to be provided via the SLACK_ADMIN_TOKEN env variable
  • The graphviz system package (e.g. sudo apt install graphviz)
  • Some Python requirements - pip install -r requirements.txt

Usage

  1. Run ./slack_mentions.py to render your last week's Slack mentions into output.svg in the current directory
  2. View output.svg in your browser or favorite image viewer
  3. Gain valuable insights about your community dynamics

Example social graph (generated on 2019-10-12)

2019-10-12 Slack graph

Diagram of the map/reduce-inspired data pipeline approach

Data pipeline diagram

About

PyCon Ireland 2019 talk - Python iterators as a tool for analysing a social network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 86.1%
  • Python 13.9%