Congressional Tenure Tracker
The data for current and former lawmakers comes from the excellent United States project on GitHub.
Retrieval and formatting
To retrieve and format the data, run:
This will download the data from Github, convert it to JSON (which can take awhile) and calculate the tenure for each session of congress. See the comments in the python source for details.