participant

Grabs Participant JSON data and outputs to files.

class eldonationtracker.api.participant.Participant(config)

Bases: object

Owns all the attributes under the participant API.

Also owns the results of any calculated data.

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

property avatar_image_url

The user’s avatar image on the website.

property average_donation

The average amount of donations received by this participant

property created_date_utc

The date the participant created their campaign.

property currency_symbol

The currency symbol eg ‘$’ added to the output text files.

property display_name

Return the participant’s display name.

The link for making donations to the participant.

property donation_url

API endpoint for the Participant’s donations.

property donors_to_display

For output text files that display multiple donors (or donations), the number of them that should be written to the text file.

property event_name

The event name as obtained from the API.

property extra_life_page_url

The URL to the participant’s ExtraLife page.

property extralife_id

The participant’s extra life ID

property goal

The goal for the amount of the money the participant wishes to raise.

property is_team_captain

True if the participant is the team captain.

property my_team

An instantiation of a team class for the participant’s team.

property new_donation

True if the participant receives a new donation.

property number_of_donations

The number of donations received by the participant.

output_donation_data()None

Write out text files for donation data.

If there have been donations, format the data (eg horizontally, vertically, etc) and output to text files. If there have not yet been donations, write default data to the files.

output_donor_data()None

Write out text files for donor data.

If there have been donations, format the data (eg horizontally, vertically, etc) and output to text files. If there have not yet been donations, write default data to the files.

output_participant_data()None

Format participant data and write to text files for use by OBS or XSplit.

A public method to do the above. Also called from the main loop.

property participant_donor_url

API Endpoint for the Participant’s donors.

property participant_url

API endpoint for the participant

run()None

Run to get participant, donation, donor, and team data and output to text files.

set_config_values()None

Set participant values, create URLs, and create Team.

property stream_is_live

True if the participant is actively streaming.

property stream_url

The URL to the participant’s stream on Twitch.

property sum_pledges

Number of pledges for the participant.

property team_id

The Team ID if the participant is part of a team.

property team_name

If the participant is part of a team, this is the team name.

property text_folder

Where the output text files will be written on disk

property total_raised

Total amount raised by the participant.

update_donation_data()None

Update donation data.

update_donor_data()None

Update donor data.

update_participant_attributes()None

Update participant attributes.

A public method that will update the Participant object with data from self.participant_url.

Also called from the main loop.

write_text_files(dictionary: dict)None

Write OBS/XSplit display info to text files.

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

Parameters

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