Herein lies a Python script that builds a dashboard to analyze membership lists. It uses the Dash framework for creating web-based data visualizations.
To run this code, you'll need to have Python 3.9, 3.10, or 3.11 installed on your machine. You'll also need to install the required packages by running the following command from inside the project folder:
python3 -m pip install -r requirements.txt
- Clone the repository and navigate to the project folder.
- Open a terminal and run the following command to start the dashboard:
python3 -m membership_dashboard
- Open your browser and go to
http://localhost:8050
to view the dashboard.
The dashboard provides the following features:
- Dropdown menus in sidebar to select an active membership list and another to compare against.
- Timeline graph showing long-term trends across all loaded lists. Choose what is shown by selecting columns from the dropdown list.
- List table displaying the active membership list with the option to export a CSV. If a compare list is selected, only the rows that changed are shown.
- Metrics showing the number of constitutional members, members in good standing, expiring members, and lapsed members.
- Graphs displaying membership counts, dues, union membership, length of membership, and racial demographics.
- Standardizes some important membership list metrics across variances in membership list formatting going back to at least Jan 2020.
- The membership lists should be in the form of zipped CSV files.
- The code assumes that the membership lists are located in the
maine_membership_list
folder. - The membership lists should follow a specific naming convention:
maine_membership_list_<YYYYMMDD>.zip
containing a single csv file calledmaine_membership_list.csv
. - To change this file name to match your chapter, look at the top of the scan_membership_lists.py file and change the string
MEMB_LIST_NAME
.
Feel free to explore the code and modify it according to your needs!