Voters tell their names and affiliations when registering to vote. Registration rolls are readily available public data.