team

Contains classes pertaining to teams.

class eldonationtracker.team.Team(team_id: str, folder: str, currency_symbol: str)

Bases: object

Hold Team API Data.

API Variables:
param team_url

URL to the team JSON API

param team_participant_url

URL to the JSON api for participants in the team.

param team_info

a dictionary to hold the following:

  • Team_goal: fundraising goal

  • Team_captain: team captain’s name

  • Team_totalRaised: total amount raised by team

  • Team_numDonations: total number of donations to the team

param participant_list

a list of the most recent participants

param top_5_participant_list

a list of the top 5 team participants by amount donated.

Helper Variables:

param output_folder

the folder that will contain the output txt files

param currency_symbol

for formatting text

param participant_calculation_dict

dictionary holding output for txt files:

  • Team_Top5Participants: top 5 participants by donation amount

  • Team_Top5ParticipantsHorizontal: same, but horizontal

  • Team_TopParticipantNameAmnt: Top participant and amount

get_participants()

Get team participant info from API.

get_team_json()

Get team info from JSON api.

get_top_5_participants()

Get team participants.

participant_run()

Get and calculate team partipant info.

team_run()

Get team info from API.

write_text_files(dictionary: dict)

Write info to text files.

Parameters

dictionary – The dictionary containing the values to write out to text files.

class eldonationtracker.team.TeamParticipant(json)

Bases: eldonationtracker.donor.Donor

Participant Attributes.

Inherits from the donor class, but over-rides the json_to_attributes function.

API variables:

Parameters
  • name – participant’s name or Anonymous

  • amount – the sum of all donations by this participant

  • number_of_donations – number of all donations by this participant

  • image_url – the url of the participant’s avatar image (not used)

json_to_attributes(json)

Convert JSON to Team Participant attributes.

Parameters

json – JSON attributes from API