Grabs donor JSON data and outputs to files.

class eldonationtracker.extralifedonations.Participant(participant_conf)

Bases: object

Owns all the attributes under the participant API.

Also owns the results of any calculated data.

Participant.conf variables:

  • self.ExtraLifeID – the participant’s extra life ID

  • self.textFolder – where the output txt files will be written on disk

  • self.CurrencySymbol – for the output txt files

  • self.donors_to_display – for txt files that display multiple donors (or donations), the number of them that should be written to the text file.

Donor Drive API api info at https://github.com/DonorDrive/PublicAPI

Donor Drive Variables:

  • self.participant_url (str) – API info for participant

  • self.donorURL (str) – donation API info (should be renamed to donationURL)

  • self.participant_donor_URL (str) – API info for donors. Useful for calculating top donor.

  • self.participantinfo (dict) –

    a dictionary holding data from participantURL:

    • totalRaised: total money raised

    • numDonations: number of donations

    • averageDonation: this doesn’t come from the API, it’s calculated in this class.

    • goal: the participant’s fundraising goal

  • self.myteam – An instantiation of a team class for the participant’s team.

  • self.donationlist – a list of Donation class ojects made of donations to this participant

Helper Variables:

  • self.donorcalcs

    a dictionary holding values for txt ouput:

    • LastDonationNameAmnt: most recent donation,

      donor name, amount of donation

    • TopDonorNameAmnt: top donor name and sum of donations

    • lastNDonationNameAmts: based on value of donors_to_display

      above, a list of the last N donor names and donation amounts

    • lastNDonationNameAmtsMessage: same with messages

    • lastNDonationNameAmtsMessageHorizontal: same, but horizontal

    • lastNDonationNameAmtsHorizontal: same, but no message

  • self.loop – set to true on init, it’s there so that the GUI can stop the loop.(if the GUI is being used. Otherwise, no big deal)


Run loop to get participant data.

This should run getParticipantJSON, getDonors, the calculations methnods, and the methods to write to text files.


This will be changed in a future version to no longer be a loop and instead the loop will be in the if __name__=__main__ part. This will make it more consistent with the way team.py works and will enable some better efficiencies with the GUI.


Stop the loop.


Write OBS/XSplit display info to text files.

It uses the helper function extralife_IO.write_text_files to handle the task.


dictionary (dict) – Dictionary containing values to write to text files . The key will become the filename. The value will be written to the file.