Skip to content
Matthew Leeds edited this page Jul 13, 2015 · 45 revisions

Data Model v1.0

Here is the current state of the data model, which should be matched by the utils/Generate*.py scripts. A dash before a field means it's optional. With the exceptions of coordinate data, API_timestamp values, lists of transaction IDs, lists of endorsers, and in_state values, everything is a string.

Party Collection

  • API_status: status code from Google Civic Info API
  • id: generated UUID
  • org_id: orgID from FCPA system (this changes for different campaigns). This could be empty if it's a PAC that only has recorded transactions with Candidates.
  • name: CandidateName/CommitteeName, tidied up a bit
  • type: PAC|Candidate
  • filed_year: the year of the data where this party was found
  • -equivalent_ids: UUIDs for Party records from other filing years that refer to the same entity
  • -API_timestamp: Unix timestamp for when the API data was received (int)
  • -ocd_id: Open Civic Data identifier
  • -status: Active|Dissolved
  • -party: "Democrat" or "Republican" for example
  • -office: "State Representative" or "Sheriff" for example
  • -district: "House District 77" or "4th Judicial Circuit" for example
  • -place: For example if there are 8 district court judges, this number could be 1-8
  • -phone: Official phone number
  • -email: Official email address
  • -url: Official website
  • -photo_url: a URL for a photo of them
  • -facebook_id: facebook.com ID
  • -twitter_id: twitter.com handle
  • -office_address: Street address of their office
  • -openstates_id: ID for lookup on openstates.org
  • -influenceexplorer_id: ID for lookup on influenceexplorer.com

Transactee Collection

  • transactee_type: Contributor|Payee|ReceiptSource
  • API_status: status code from Google Geocoding API
  • id: generated UUID
  • name: FirstName MI LastName Suffix (or just the organization name)
  • address: Street Address, City, State Zip, Country (in most cases)
  • transaction_type: InKindContribution|Contribution|Receipt|Expenditure
  • transaction_ids: A non-empty list of transaction IDs
  • filed_year: the year of the data where this transactee was found
  • -equivalent_ids: UUIDs for Transactee records from other filing years that refer to the same entity
  • -API_timestamp: Unix timestamp for when the API data was received (int)
  • -organization_type: "Individual" or "Group/Business/Corporation" for example
  • -geo_data: [latitude, longitude]
  • -county: County Name
  • -house_district: House District #
  • -senate_district: Senate District #
  • -in_state: 0|1 (Is the address in Alabama?)

Transaction Collection

  • id: generated UUID
  • type: Expenditure|Contribution|InKindContribution|Receipt
  • transaction_type: "Cash (Itemized)" for example
  • party_id: generated UUID for the involved Party
  • transactee_id: the id for the involved Contributor/ReceiptSource/etc. If the involved party is a PAC, this is actually a Party ID, not a Transactee ID!
  • amount: the cash value of the transaction (occasionally negative for some reason)
  • filed_date: MM/DD/YYYY
  • transaction_id: InKindContributionID/ContributionID/ExpenditureID/ReceiptID
  • amended: Y|N
  • filed_year: the year of the data where this transaction was found
  • party_to_party: 0|1 (Is this transaction PAC ->/<- Candidate rather than Transactee ->/<- Party?)
  • -explanation: "Bank Fee" for example (only for Expenditures)
  • -purpose: "Food" for example (only for Expenditures)
  • -source_type: "Individual" for example (not for Expenditures)
  • -name: FirstName MI LastName Suffix or the organization name
  • -inkind_nature: Nature Of In-Kind Contribution ("Administrative" for example)
  • -endorsers: For Receipts, sometimes a list of people who will guarantee part of the loan. For each guarantor, the format is [name, address, amount].

District Collection

  • name: Name of the district
  • ocd_id: OpenCivicData Identifier (from here)