elex.api.Candidate

class elex.api.Candidate(**kwargs)

Canonical representation of a candidate. Should be globally unique for this election, across races.

serialize()

Implements APElection.serialize().

set_id_field()

Set id to <unique_id>.

set_unique_id()

Generate and set unique id.

Candidate IDs are not globally unique. AP National Politian IDs (NPIDs or polid) are unique, but only national-level candidates have them; everyone else gets ‘0’. The unique key, then, is the NAME of the ID we’re using and then the ID itself. Verified this is globally unique with Tracy.