Hub(P=CqYGVC
zCbA&9=3=JQ>7%MBvcN$uTcN!-&y22gBml1T#Gp#)2!K`Q*`!;rKX0LC4p>KlV@K8+
z72S*WRZyNv=OOgY53*X-7~4tn+n!3cLfxV#=Nm@wP4X1FItC~+nphK_sGd?n&(a!|
zeh-*nrGFbzVz+d}k|*Ci(3CE@wc2?EjB5gIORA~D(9-E*NHytIm#&(P-qkPx9sBNR
zP(p^abJ2AXLyJqqNpi3fM*o2W^{hLZ#c0UjKiNsE9H&T;_VpG(1_>x%zUVowZJh-a
zG)FYhS+<-h$B+!c)sROsWk)(SP9(hzb#VYS%%u2A2&Cq&JrE|1WKH
zzv?z>IEM%6V{n}>IWgc!q`tGf%4n-mMj4{^5tS1n%D#a#o-C5Z^-d_gX(OZ_D{gZ`
z_Eh)u6bPZ4(d%*(ls?*YkWw*jt+OU2=?GF=;fh9B+5X8`>RMUx-ZQv*V?ihY7Ag*?
z&wr?lVE}S=+IGv@gf-!ykf1!UFq%8Sz>0Fu_jrrYmJBMUHm^`SJ14WCRcK1B^EYrf
zsPdU2F&l;Fu$b^N18&!xxM0a1eQ5(1Y~}jgM*UU5ZynhZd_|Ftr6(f1%cr57zS^sd
zfV76pNqK-slfs0jXuL2;?07Z*iJj23?SE;`u7EhP_3laHwSparE#HEql3M%@geW2Q
zFsVK6NYWZ~2SOP1!}VPS4^%9TkLyZrg(4KxaB3liJn52_&TW(~OZF@(x(!(vRH#P@
zWqbfEfH5g8Q|qPj!s>)ceBUu5wX8rd((Nkdcq+*}b75lXCDat7uv;u6#i}JXet%|Q
ztTm-s0*g(<$Iz=vY4Luw{k+fB|
z8~vXYhzfie*1BLK#pVQ~JMEroz)jP4Ii-$`(0iT=%Qs*iW-aani!t;GFpMAJqT+0S3UyJ}
zH$dLTHV)9YvJA0f{5;u&zRHV@fFkujaqtLAUYegW#c}r(DPMouF>%t#*MHY`D5Rc)@9ee#NmS_iMQ?+uOh_?LRaBZr3;U%f_>udayi?g(!O&?-
zy{k0}$0dTXxqYH950vxL>hh4@5@){b7KFLi5j6FrMALxb8?ZZ{1sbfr3LqFN^xCcIFmz(@@{$n?-V
zkZf#fDS#k%PnJMoVzbRS_^M8(4xRQG5eJxbZ>?vIJ>$7j6(;$I#PqfTt|P>4GntCH
za{0~z()UB#;g;^9rr=5n}h^F5#X6X_)O%(tjwGDTw&=R}gHR
zrNNjDnoR0nzjA#GQijMaHe>L+=7(6JTK6!FKglf6-g#zWyi!J4dJ*aaWCy+{agY)U
zgWkp;pa6Xrd!$T3c%*4R?U}du+?_?f@gAUy=9_!N$h9+1SZ~P?hNs$JeJ{t=atxq3
zA#yYD@q_S}Ow%qyfGQ&4$t$w-&aoCQ|9I#GuoMs&`ajpjh>sM
zp@a6cOSlhohL|@FkK1T2Bj>T_>0w`2pWj@(e8vf7Ztn5%vzaY`OXk{*o||KGX3}$d
z<80FZM=J`K(DTSSZhHCHQ6_i^H;=q~w<2q7MgJ~BtUmP3|7%Pczs-Xef25D^_CKp!
znSM0+#UB5T@iV}7dp92FM?CbeiR;n*JK@3;#!H%0S5Qgu03Z(X$sJ-s3hdorEM^3-Zrfob{m$bTDF*v^2yG(|cjZ>oyb
zC`17qG#pC}6$Wz#jb`w&zGC79lg1heN;I_s6sb}8?uZu8_}hZ)QUGT316Oks#I?Sf
zC;o{aH&$|XDtW29nYj|OmLa=>Y1Wg3Yy?O{#lR%Intq8e-3g$h-9W0csmXwc)=Y6p
zV}fUqdND95Eq@u9q|OXb3WMHneid3}iH$~^;3!zx9R)44!;ne)QP$83oWPDjBeQ3b
zi0xTsVGx{YpaYV4=wZZ8zSkP@3Y&r`J#|1rV;xWdllf(C;a&lxbk`9nEdFS6rafep
zwF3Zc=?KDFIfBrNk0c7E_pn;yJ)lJ~2(%oAK_f(U0)L4RqYp<9H;=*VYB2=bS`MAQ
z2W^I~(q*oYO5Z_fv3?0t*J1Wu0|4#*2%_o|eguppiZMXoe&9P+ZNecGpwNm3EDFv0
zl7F?@eK1;Q3&AREA!uzag+kRo3b9u7!Dv-21golrpjEXL3RPKn;1NG6+Rh>u4x5(p
zDPP9FJbxoun|%Pq{sh<(cT)MMByyp%XznVnX#Ja<#se0Tfh`2)>$H_=9VM2V4_o5r
z!XYKs7#+(|!NX=bg=^yCM7z71?mW}THg=w_?yJfC4lF%mK#ApUhF!z+-YO;67#+(I
z^bFglh2HenlXWzOZX;vdwtsIvt|Td38@b(_p>Zzj0{&%67jNc;W0nL%8SdKP>}UUT
zbAPO8^8TUVi93E{@DZTswnKx9*t_ol4($&8RS5UDp6~%^A;V{}6B)WsbT$7I%
q!F48Ber0Efe9MT(2byP*?;oD#&tV?^zq{um53c>QfA&8aQH|-5if{q|
diff --git a/docs/pyteamsnap.html b/docs/pyteamsnap.html
index 8f62c1a..210bd7c 100644
--- a/docs/pyteamsnap.html
+++ b/docs/pyteamsnap.html
@@ -93,89 +93,257 @@
pyteamsnap.models package
- Module contents
Availability
+AvailabilityStatusCode
+
AvailabilitySummary
Event
EventLineup
EventLineupEntry
Location
Me
Member
MemberStatistics
Opponent
Statistics
Team
User
-User.data
+User.birthday
+User.delete()
+User.email
+User.facebook_access_token
+User.facebook_id
+User.first_name
+User.is_lab_rat
+User.last_name
+User.new()
+User.password
+User.post()
+User.receives_newsletter
User.rel
User.type
User.version
@@ -206,12 +374,12 @@
-
-bulk_load(team_id, types: List[BaseApiObject], **kwargs) → List[TTeamSnap]
+bulk_load(team_id, types: List[BaseTeamsnapObject], **kwargs) → List[TTeamSnap]
- Parameters
team_id –
-types – List of items to fetch, in the form of BaseApiObject classes
+types – List of items to fetch, in the form of BaseTeamsnapObject classes
kwargs – Additional filters passed into requested types by passing them in the url’s querystring
as type__filter=value (i.e. ?event__start_date=2015-01-01).
Any filter can be passed that is available on the search for the specified type.
@@ -243,11 +411,6 @@ Any filter can be passed that is available on the search for the specified type.
link(link_name)
-
--
-classmethod parse_response(response: dict) → list
-
-
-
post_item(rel: str, data: dict) → dict
diff --git a/docs/pyteamsnap.models.html b/docs/pyteamsnap.models.html
index a1125df..c8b6188 100644
--- a/docs/pyteamsnap.models.html
+++ b/docs/pyteamsnap.models.html
@@ -87,33 +87,52 @@
Module contents
-
-class pyteamsnap.models.Availability(client: APIClient, data: Dict[str, Union[str, list]] = {})
-Bases: BaseApiObject
-
--
-property data
-Data dictionary for object
-
-- Returns
-dict: dict with keys:
-
-
-
-event_id
-member_id
-notes
-notes_author_member_id
-source
-status_code
-type
-
-
+class pyteamsnap.models.Availability(client: TeamSnap, data: Dict[str, Union[str, list]] = {})
+Bases: BaseTeamsnapObject
+
+-
+event_id
+
+
+
+-
+is_current_user
+
+
+
+-
+member_id
+
+
+
+-
+notes
+
+
+
+-
+notes_author_member_id
+
-
rel: str = 'availabilities'
-rel: Relationship between a linked resource and the current document
-
+
+
+
+-
+status
+
+
+
+-
+status_code
+
+
+
+-
+team_id
+
-
@@ -128,31 +147,91 @@
--
-class pyteamsnap.models.AvailabilitySummary(client: APIClient, data: Dict[str, Union[str, list]] = {})
-Bases: BaseApiObject
-
--
-property data
-Data dictionary for object
-
-- Returns
-dict: dict with keys:
-
-
+-
+class pyteamsnap.models.AvailabilityStatusCode(value)
+Bases: Enum
+An enumeration.
+
+-
+MAYBE = 2
+
+
+
+-
+NO = 0
+
+
+
+-
+YES = 1
+
+
+
+-
+class pyteamsnap.models.AvailabilitySummary(client: TeamSnap, data: Dict[str, Union[str, list]] = {})
+Bases: BaseTeamsnapObject
+
+-
+event_id
+
+
+
+-
+going_count
+
+
+
+-
+maybe_count
+
+
+
+-
+not_going_count
+
+
+
+-
+player_going_count
+
+
+
+-
+player_maybe_count
+
+
+
+-
+player_not_going_count
+
+
+
+-
+player_unknown_count
+
+
-
rel: str = 'availability_summaries'
-rel: Relationship between a linked resource and the current document
-
+
+
+
+-
+team_id
+
-
type = 'availability_summary'
+
+-
+unknown_count
+
+
-
version: str = '3.866.0'
@@ -162,73 +241,250 @@
-
-class pyteamsnap.models.Event(client: APIClient, data: Dict[str, Union[str, list]] = {})
-Bases: BaseApiObject
+class pyteamsnap.models.Event(client: TeamSnap, data: Dict[str, Union[str, list]] = {})
+Bases: BaseTeamsnapObject
Associated object to a team; and represents an event or game that is tracked in the TeamSnap system.
https://www.teamsnap.com/documentation/apiv3/objects#Events
-
--
-property data
-Data dictionary for object
-
-- Returns
-dict: dict with strings:
-
-
-
-type
-additional_location_details
-browser_time_zone
-division_location_id
-doesnt_count_towards_record
-duration_in_minutes
-game_type_code
-icon_color
-is_canceled
-is_game
-is_overtime
-is_shootout
-is_tbd
-label
-location_id
-minutes_to_arrive_early
-name
-notes
-notify_opponent
-notify_opponent_contacts_email
-notify_opponent_contacts_name
-notify_opponent_notes
-notify_team
-notify_team_as_member_id
-opponent_id
-points_for_opponent
-points_for_team
-repeating_include
-repeating_type_code
-repeating_until
-results
-results_url
-shootout_points_for_opponent
-shootout_points_for_team
-start_date
-team_id
-time_zone
-tracks_availability
-uniform
-
-
+
+-
+additional_location_details
+
+
+
+-
+arrival_date
+
+
+
+-
+created_at
+
+
+
+-
+division_location_id
+
+
+
+-
+doesnt_count_towards_record
+
+
+
+-
+duration_in_minutes
+
+
+
+-
+end_date
+
+
+
+-
+formatted_results
+
+
+
+-
+formatted_title
+
+
+
+-
+formatted_title_for_multi_team
+
+
+
+-
+game_type
+
+
+
+-
+game_type_code
+
+
+
+-
+icon_color
+
+
+
+-
+is_canceled
+
+
+
+-
+is_game
+
+
+
+-
+is_league_controlled
+
+
+
+-
+is_overtime
+
+
+
+-
+is_shootout
+
+
+
+-
+is_tbd
+
+
+
+-
+label
+
+
+
+-
+location_id
+
+
+
+-
+location_name
+
+
+
+-
+minutes_to_arrive_early
+
+
+
+-
+name
+
+
+
+-
+notes
+
+
+
+-
+opponent_id
+
+
+
+-
+opponent_name
+
+
+
+-
+points_for_opponent
+
+
+
+-
+points_for_team
+
-
rel: str = 'events'
-rel: Relationship between a linked resource and the current document
-
+
+
+
+-
+repeating_type
+
+
+
+-
+repeating_type_code
+
+
+
+-
+repeating_uuid
+
+
+
+-
+results
+
+
+
+-
+results_url
+
+
+
+-
+shootout_points_for_opponent
+
+
+
+-
+shootout_points_for_team
+
+
+
+-
+source_time_zone_iana_name
+
+
+
+-
+start_date
+
+
+
+-
+team_id
+
+
+
+-
+time_zone
+
+
+
+-
+time_zone_description
+
+
+
+-
+time_zone_iana_name
+
+
+
+-
+time_zone_offset
+
+
+
+-
+tracks_availability
+
-
type = 'event'
+
+-
+uniform
+
+
+
+-
+updated_at
+
+
-
version: str = '3.866.0'
@@ -238,27 +494,26 @@
-
-class pyteamsnap.models.EventLineup(client: APIClient, data: Dict[str, Union[str, list]] = {})
-Bases: BaseApiObject
-
--
-property data
-
-- Returns
-dict: dict with strings:
-
-
-
+class pyteamsnap.models.EventLineup(client: TeamSnap, data: Dict[str, Union[str, list]] = {})
+Bases: BaseTeamsnapObject
+
+-
+entries_count
+
+
+
+-
+event_id
+
+
+
+-
+is_published
+
-
rel: str = 'event_lineups'
-rel: Relationship between a linked resource and the current document
-
-
-
--
-template = {}
@@ -275,33 +530,67 @@
-
-class pyteamsnap.models.EventLineupEntry(client: APIClient, data: Dict[str, Union[str, list]] = {})
-Bases: BaseApiObject
-
--
-property data
-
-- Returns
-dict: dict with strings:
-
-
-
-member_id
-sequence
-label
-type
-
-
+class pyteamsnap.models.EventLineupEntry(client: TeamSnap, data: Dict[str, Union[str, list]] = {})
+Bases: BaseTeamsnapObject
+
+-
+availability_status_code
+
+
+
+-
+event_id
+
+
+
+-
+event_lineup_id
+
+
+
+-
+label
+
+
+
+-
+member_id
+
+
+
+-
+member_name
+
+
+
+-
+member_photo
+
-
rel: str = 'event_lineup_entries'
-rel: Relationship between a linked resource and the current document
-
+
-
classmethod search(client, **kwargs)
+
+- Parameters
+-
+
+- Returns
+List of TeamSnapBaseObjects
+
+
+
+
+
+-
+sequence
@@ -318,42 +607,63 @@
-
-class pyteamsnap.models.Location(client: APIClient, data: Dict[str, Union[str, list]] = {})
-Bases: BaseApiObject
-
--
-property data
-Data dictionary for object
-
-- Returns
-dict: dict with keys:
-
-
-
-name
-url
-phone
-notes
-address
-latitude
-longitude
-team_id
-is_retired
-type
-
-
+class pyteamsnap.models.Location(client: TeamSnap, data: Dict[str, Union[str, list]] = {})
+Bases: BaseTeamsnapObject
+
+-
+address
+
+
+
+-
+is_retired
+
+
+
+-
+latitude
+
+
+
+-
+longitude
+
+
+
+-
+name
+
+
+
+-
+notes
+
+
+
+-
+phone
+
-
rel: str = 'locations'
-rel: Relationship between a linked resource and the current document
-
+
+
+
+-
+team_id
+
-
type = 'location'
+
+-
+url
+
+
-
version: str = '3.866.0'
@@ -363,16 +673,60 @@
-
-class pyteamsnap.models.Me(client)
+class pyteamsnap.models.Me(client: TeamSnap, data: Dict[str, Union[str, list]] = {})
Bases: User
The current user’s object. It is not possible to create or delete users via the API;
however, it is possible to update data on a user’s record.
https://www.teamsnap.com/documentation/apiv3/objects#Me
+
+-
+birthday
+
+
+
+-
+email
+
+
+
+-
+facebook_access_token
+
+
+
+-
+facebook_id
+
+
+
+-
+first_name
+
+
+
+-
+is_lab_rat
+
+
+
+-
+last_name
+
+
+
+-
+password
+
+
+
+-
+receives_newsletter
+
+
-
rel: str = 'me'
-rel: Relationship between a linked resource and the current document
-
+
-
@@ -388,49 +742,114 @@ however, it is possible to update data on a user’s record.
-
-class pyteamsnap.models.Member(client: APIClient, data: Dict[str, Union[str, list]] = {})
-Bases: BaseApiObject
+class pyteamsnap.models.Member(client: TeamSnap, data: Dict[str, Union[str, list]] = {})
+Bases: BaseTeamsnapObject
A member (also referred to as a roster in our web and mobile apps) is a member of a team.
https://www.teamsnap.com/documentation/apiv3/objects#Members
-
--
-property data
-Data dictionary for object
-
-- Returns
-dict: dict with keys:
-
-
-
-first_name
-last_name
-address_city
-address_state
-address_street1
-address_street2
-address_zip
-birthday
-gender
-hide_address
-hide_age
-is_address_hidden
-is_age_hidden
-is_manager
-is_non_player
-is_ownership_pending
-jersey_number
-position
-source_action
-team_id
-type
-
-
+
+-
+address_city
+
+
+
+-
+address_state
+
+
+
+-
+address_street1
+
+
+
+-
+address_street2
+
+
+
+-
+address_zip
+
+
+
+-
+birthday
+
+
+
+-
+first_name
+
+
+
+-
+gender
+
+
+
+-
+hide_address
+
+
+
+-
+hide_age
+
+
+
+-
+is_address_hidden
+
+
+
+-
+is_age_hidden
+
+
+
+-
+is_manager
+
+
+
+-
+is_non_player
+
+
+
+-
+is_ownership_pending
+
+
+
+-
+jersey_number
+
+
+
+-
+last_name
+
+
+
+-
+position
+
-
rel: str = 'members'
-rel: Relationship between a linked resource and the current document
-
+
+
+
+-
+source_action
+
+
+
+-
+team_id
+
-
@@ -446,45 +865,113 @@ however, it is possible to update data on a user’s record.
-
-class pyteamsnap.models.MemberStatistics(client: APIClient, data: Dict[str, Union[str, list]] = {})
-Bases: BaseApiObject
+class pyteamsnap.models.MemberStatistics(client: TeamSnap, data: Dict[str, Union[str, list]] = {})
+Bases: BaseTeamsnapObject
+
+-
+average
+
+
+
+-
+average_ranking
+
+
+
+-
+average_ranking_for_query
+
+
+
+-
+count_games_played
+
+
+
+-
+id
+
+
+
+-
+member_id
+
+
-
rel: str = 'member_statistics'
-rel: Relationship between a linked resource and the current document
-
+
+
+
+-
+statistic_id
+
+
+
+-
+team_id
+
+
+
+-
+total
+
+
+
+-
+total_ranking
+
+
+
+-
+total_ranking_for_query
+
+
+
+-
+type = 'member_statistic'
+
-
-class pyteamsnap.models.Opponent(client: APIClient, data: Dict[str, Union[str, list]] = {})
-Bases: BaseApiObject
-
--
-property data
-Data dictionary for object
-
-- Returns
-dict: dict with keys:
-
-
-
-name
-contacts_name
-contacts_phone
-contacts_email
-notes
-team_id
-type
-
-
+class pyteamsnap.models.Opponent(client: TeamSnap, data: Dict[str, Union[str, list]] = {})
+Bases: BaseTeamsnapObject
+
+-
+contacts_email
+
+
+
+-
+contacts_name
+
+
+
+-
+contacts_phone
+
+
+
+-
+name
+
+
+
+-
+notes
+
-
rel: str = 'opponents'
-rel: Relationship between a linked resource and the current document
-
+
+
+
+-
+team_id
+
-
@@ -500,40 +987,77 @@ however, it is possible to update data on a user’s record.
-
-class pyteamsnap.models.Statistics(client: APIClient, data: Dict[str, Union[str, list]] = {})
-Bases: BaseApiObject
-
--
-property data
-Data dictionary for object
-
-- Returns
-dict: dict with keys:
-
-
-
-acronym
-always_display_decimals
-formula
-is_in_descending_order
-display_zero_totals
-is_percentage
-is_private
-is_team_statistic
-is_top_statistic
-name
-precision
-statistic_group_id
-team_id
-type
-
-
+class pyteamsnap.models.Statistics(client: TeamSnap, data: Dict[str, Union[str, list]] = {})
+Bases: BaseTeamsnapObject
+
+-
+acronym
+
+
+
+-
+always_display_decimals
+
+
+
+-
+display_zero_totals
+
+
+
+-
+formula
+
+
+
+-
+is_in_descending_order
+
+
+
+-
+is_percentage
+
+
+
+-
+is_private
+
+
+
+-
+is_team_statistic
+
+
+
+-
+is_top_statistic
+
+
+
+-
+name
+
+
+
+-
+precision
+
-
rel: str = 'statistics'
-rel: Relationship between a linked resource and the current document
-
+
+
+
+-
+statistic_group_id
+
+
+
+-
+team_id
+
-
@@ -549,47 +1073,104 @@ however, it is possible to update data on a user’s record.
-
-class pyteamsnap.models.Team(client: APIClient, data: Dict[str, Union[str, list]] = {})
-Bases: BaseApiObject
+class pyteamsnap.models.Team(client: TeamSnap, data: Dict[str, Union[str, list]] = {})
+Bases: BaseTeamsnapObject
Associated teams from your origin object. Full CRUD is possible with the teams endpoint.
https://www.teamsnap.com/documentation/apiv3/objects#Teams
-
--
-property data
-Data dictionary for object
-
-- Returns
-dict: dict with keys:
-
-
-
-ad_unit_hero_id
-ad_unit_hero_template_id
-ad_unit_inline_id
-division_id
-division_name
-is_ownership_pending
-league_name
-league_url
-location_country
-location_postal_code
-name
-owner_email
-owner_first_name
-owner_last_name
-season_name
-sport_id
-team
-time_zone
-type
-
-
+
+-
+ad_unit_hero_id
+
+
+
+-
+ad_unit_hero_template_id
+
+
+
+-
+ad_unit_inline_id
+
+
+
+-
+division_id
+
+
+
+-
+division_name
+
+
+
+-
+is_ownership_pending
+
+
+
+-
+league_name
+
+
+
+-
+league_url
+
+
+
+-
+location_country
+
+
+
+-
+location_postal_code
+
+
+
+-
+name
+
+
+
+-
+owner_email
+
+
+
+-
+owner_first_name
+
+
+
+-
+owner_last_name
+
-
rel: str = 'teams'
-rel: Relationship between a linked resource and the current document
-
+
+
+
+-
+season_name
+
+
+
+-
+sport_id
+
+
+
+-
+team
+
+
+
+-
+time_zone
+
-
@@ -605,36 +1186,78 @@ however, it is possible to update data on a user’s record.
-
-class pyteamsnap.models.User(client: APIClient, data: Dict[str, Union[str, list]] = {})
-Bases: BaseApiObject
-
--
-property data
-Data dictionary for object
-
-- Returns
-dict: dict with keys:
-
-
-
-first_name
-last_name
-password
-birthday
-email
-facebook_id
-facebook_access_token
-type
-is_lab_rat
-receives_newsletter
-
+class pyteamsnap.models.User(client: TeamSnap, data: Dict[str, Union[str, list]] = {})
+Bases: BaseTeamsnapObject
+
+-
+birthday
+
+
+
+-
+delete()
+It is not possible to create or delete users via the API;
+however, it is possible to update data on a user’s record.
+
+-
+email
+
+
+
+-
+facebook_access_token
+
+
+
+-
+facebook_id
+
+
+
+-
+first_name
+
+
+
+-
+is_lab_rat
+
+
+
+-
+last_name
+
+
+
+-
+new()
+It is not possible to create or delete users via the API;
+however, it is possible to update data on a user’s record.
+
+
+
+-
+password
+
+
+
+-
+post()
+It is not possible to create or delete users via the API;
+however, it is possible to update data on a user’s record.
+
+
+
+-
+receives_newsletter
+
+
-
rel: str = 'users'
-rel: Relationship between a linked resource and the current document
-
+
-
diff --git a/docs/searchindex.js b/docs/searchindex.js
index cbfed1e..80e64f4 100644
--- a/docs/searchindex.js
+++ b/docs/searchindex.js
@@ -1 +1 @@
-Search.setIndex({"docnames": ["index", "modules", "pyteamsnap", "pyteamsnap.models"], "filenames": ["index.rst", "modules.rst", "pyteamsnap.rst", "pyteamsnap.models.rst"], "titles": ["pyteamsnap", "pyteamsnap", "pyteamsnap package", "pyteamsnap.models package"], "terms": {"an": [0, 3], "unoffici": 0, "python": 0, "wrapper": 0, "teamsnap": [0, 1, 2, 3], "api": [0, 2, 3], "A": [0, 2, 3], "work": 0, "progress": 0, "from": [0, 3], "github": 0, "pip": 0, "git": 0, "http": [0, 2, 3], "com": [0, 2, 3], "anthonyscorrea": 0, "To": 0, "connect": 0, "oauth": 0, "2": 0, "credenti": 0, "auth": 0, "document": 3, "client": [0, 1, 3], "import": 0, "token": [0, 2], "you": 0, "can": [0, 2], "us": [0, 2], "constructor": 0, "model": [0, 1, 2], "creat": [0, 3], "instanc": 0, "user": [0, 2, 3], "object": [0, 3], "authent": 0, "me": [0, 2, 3], "00000000": 0, "firstnam": 0, "lastnam": 0, "There": 0, "i": [0, 2, 3], "onli": 0, "one": 0, "session": 0, "so": 0, "search": [0, 2, 3], "requir": 0, "inform": 0, "access": [0, 2], "kei": [0, 3], "just": 0, "like": 0, "dictionari": [0, 3], "see": 0, "": [2, 3], "dor": [], "its": [], "data": [0, 2, 3], "properti": [0, 3], "list": [0, 2, 3], "avail": [0, 2, 3], "few": 0, "exampl": 0, "managed_team": 0, "team": [0, 2, 3], "teamnam": 0, "0": [0, 3], "name": [0, 3], "have": 0, "function": 0, "where": 0, "criteria": 0, "pass": [0, 2], "keyword": 0, "argument": 0, "event": [0, 2, 3], "team_id": [0, 2, 3], "id": [0, 2], "titl": 0, "00000001": 0, "start_dat": [0, 3], "datetim": 0, "2000": 0, "1": 0, "12": 0, "00": 0, "retriev": 0, "singularli": 0, "updat": [0, 3], "delet": [0, 3], "permiss": 0, "allow": 0, "member": [0, 2, 3], "new_memb": 0, "new": 0, "first_nam": [0, 3], "ferguson": 0, "last_nam": [0, 3], "jenkin": 0, "post": 0, "jersey_numb": [0, 3], "31": 0, "put": 0, "load": 0, "hetereogen": 0, "given": 0, "paramet": [0, 2], "bulk_load": [0, 2], "list_of_ts_object": 0, "type": [0, 2, 3], "event__id": 0, "packag": 1, "subpackag": 1, "submodul": 1, "modul": 1, "content": 1, "rel": [2, 3], "version": [2, 3], "availabilitysummari": [2, 3], "eventlineup": [2, 3], "templat": [2, 3], "eventlineupentri": [2, 3], "locat": [2, 3], "memberstatist": [2, 3], "oppon": [2, 3], "statist": [2, 3], "class": [2, 3], "str": [2, 3], "arg": 2, "kwarg": [2, 3], "base": [2, 3], "apicli": [2, 3], "The": [2, 3], "hypermedia": 2, "json": 2, "collect": 2, "base_url": 2, "v3": 2, "baseapiobject": [2, 3], "tteamsnap": 2, "item": 2, "fetch": 2, "form": 2, "addit": 2, "filter": 2, "request": 2, "them": 2, "url": [2, 3], "querystr": 2, "type__filt": 2, "valu": 2, "e": 2, "event__start_d": 2, "2015": 2, "01": 2, "ani": 2, "specifi": 2, "return": [2, 3], "heterogen": 2, "command": 2, "delete_item": 2, "union": [2, 3], "int": 2, "none": 2, "get_item": 2, "dict": [2, 3], "link": [2, 3], "link_nam": 2, "classmethod": [2, 3], "parse_respons": 2, "respons": 2, "post_item": 2, "put_item": 2, "queri": 2, "top": 2, "level": 2, "event_id": 3, "member_id": 3, "note": 3, "notes_author_member_id": 3, "sourc": 3, "status_cod": 3, "relationship": 3, "between": 3, "resourc": 3, "current": 3, "3": 3, "866": 3, "availability_summari": 3, "associ": 3, "repres": 3, "game": 3, "track": 3, "system": 3, "www": 3, "apiv3": 3, "string": 3, "additional_location_detail": 3, "browser_time_zon": 3, "division_location_id": 3, "doesnt_count_towards_record": 3, "duration_in_minut": 3, "game_type_cod": 3, "icon_color": 3, "is_cancel": 3, "is_gam": 3, "is_overtim": 3, "is_shootout": 3, "is_tbd": 3, "label": 3, "location_id": 3, "minutes_to_arrive_earli": 3, "notify_oppon": 3, "notify_opponent_contacts_email": 3, "notify_opponent_contacts_nam": 3, "notify_opponent_not": 3, "notify_team": 3, "notify_team_as_member_id": 3, "opponent_id": 3, "points_for_oppon": 3, "points_for_team": 3, "repeating_includ": 3, "repeating_type_cod": 3, "repeating_until": 3, "result": 3, "results_url": 3, "shootout_points_for_oppon": 3, "shootout_points_for_team": 3, "time_zon": 3, "tracks_avail": 3, "uniform": 3, "event_lineup": 3, "sequenc": 3, "event_lineup_entri": 3, "phone": 3, "address": 3, "latitud": 3, "longitud": 3, "is_retir": 3, "It": 3, "possibl": 3, "via": 3, "howev": 3, "record": 3, "also": 3, "refer": 3, "roster": 3, "our": 3, "web": 3, "mobil": 3, "app": 3, "address_c": 3, "address_st": 3, "address_street1": 3, "address_street2": 3, "address_zip": 3, "birthdai": 3, "gender": 3, "hide_address": 3, "hide_ag": 3, "is_address_hidden": 3, "is_age_hidden": 3, "is_manag": 3, "is_non_play": 3, "is_ownership_pend": 3, "posit": 3, "source_act": 3, "member_statist": 3, "contacts_nam": 3, "contacts_phon": 3, "contacts_email": 3, "acronym": 3, "always_display_decim": 3, "formula": 3, "is_in_descending_ord": 3, "display_zero_tot": 3, "is_percentag": 3, "is_priv": 3, "is_team_statist": 3, "is_top_statist": 3, "precis": 3, "statistic_group_id": 3, "your": 3, "origin": 3, "full": 3, "crud": 3, "endpoint": 3, "ad_unit_hero_id": 3, "ad_unit_hero_template_id": 3, "ad_unit_inline_id": 3, "division_id": 3, "division_nam": 3, "league_nam": 3, "league_url": 3, "location_countri": 3, "location_postal_cod": 3, "owner_email": 3, "owner_first_nam": 3, "owner_last_nam": 3, "season_nam": 3, "sport_id": 3, "password": 3, "email": 3, "facebook_id": 3, "facebook_access_token": 3, "is_lab_rat": 3, "receives_newslett": 3, "each": 0, "found": 0, "here": 0}, "objects": {"": [[2, 0, 0, "-", "pyteamsnap"]], "pyteamsnap": [[2, 0, 0, "-", "client"], [3, 0, 0, "-", "models"]], "pyteamsnap.client": [[2, 1, 1, "", "TeamSnap"]], "pyteamsnap.client.TeamSnap": [[2, 2, 1, "", "base_url"], [2, 3, 1, "", "bulk_load"], [2, 3, 1, "", "command"], [2, 3, 1, "", "delete_item"], [2, 3, 1, "", "get_item"], [2, 3, 1, "", "link"], [2, 3, 1, "", "parse_response"], [2, 3, 1, "", "post_item"], [2, 3, 1, "", "put_item"], [2, 3, 1, "", "query"]], "pyteamsnap.models": [[3, 1, 1, "", "Availability"], [3, 1, 1, "", "AvailabilitySummary"], [3, 1, 1, "", "Event"], [3, 1, 1, "", "EventLineup"], [3, 1, 1, "", "EventLineupEntry"], [3, 1, 1, "", "Location"], [3, 1, 1, "", "Me"], [3, 1, 1, "", "Member"], [3, 1, 1, "", "MemberStatistics"], [3, 1, 1, "", "Opponent"], [3, 1, 1, "", "Statistics"], [3, 1, 1, "", "Team"], [3, 1, 1, "", "User"]], "pyteamsnap.models.Availability": [[3, 4, 1, "", "data"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.AvailabilitySummary": [[3, 4, 1, "", "data"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.Event": [[3, 4, 1, "", "data"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.EventLineup": [[3, 4, 1, "", "data"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "template"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.EventLineupEntry": [[3, 4, 1, "", "data"], [3, 2, 1, "", "rel"], [3, 3, 1, "", "search"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.Location": [[3, 4, 1, "", "data"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.Me": [[3, 2, 1, "", "rel"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.Member": [[3, 4, 1, "", "data"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.MemberStatistics": [[3, 2, 1, "", "rel"]], "pyteamsnap.models.Opponent": [[3, 4, 1, "", "data"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.Statistics": [[3, 4, 1, "", "data"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.Team": [[3, 4, 1, "", "data"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.User": [[3, 4, 1, "", "data"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:attribute", "3": "py:method", "4": "py:property"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "attribute", "Python attribute"], "3": ["py", "method", "Python method"], "4": ["py", "property", "Python property"]}, "titleterms": {"pyteamsnap": [0, 1, 2, 3], "instal": 0, "get": 0, "start": 0, "packag": [2, 3], "subpackag": 2, "submodul": 2, "client": 2, "modul": [2, 3], "content": [2, 3], "model": 3, "document": 0}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 57}, "alltitles": {"pyteamsnap": [[0, "pyteamsnap"], [1, "pyteamsnap"]], "Installation": [[0, "installation"]], "Getting Started": [[0, "getting-started"]], "Documentation": [[0, "id1"]], "pyteamsnap package": [[2, "pyteamsnap-package"]], "Subpackages": [[2, "subpackages"]], "Submodules": [[2, "submodules"]], "pyteamsnap.client module": [[2, "module-pyteamsnap.client"]], "Module contents": [[2, "module-pyteamsnap"], [3, "module-pyteamsnap.models"]], "pyteamsnap.models package": [[3, "pyteamsnap-models-package"]]}, "indexentries": {"teamsnap (class in pyteamsnap.client)": [[2, "pyteamsnap.client.TeamSnap"]], "base_url (pyteamsnap.client.teamsnap attribute)": [[2, "pyteamsnap.client.TeamSnap.base_url"]], "bulk_load() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.bulk_load"]], "command() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.command"]], "delete_item() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.delete_item"]], "get_item() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.get_item"]], "link() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.link"]], "module": [[2, "module-pyteamsnap"], [2, "module-pyteamsnap.client"], [3, "module-pyteamsnap.models"]], "parse_response() (pyteamsnap.client.teamsnap class method)": [[2, "pyteamsnap.client.TeamSnap.parse_response"]], "post_item() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.post_item"]], "put_item() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.put_item"]], "pyteamsnap": [[2, "module-pyteamsnap"]], "pyteamsnap.client": [[2, "module-pyteamsnap.client"]], "query() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.query"]], "availability (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Availability"]], "availabilitysummary (class in pyteamsnap.models)": [[3, "pyteamsnap.models.AvailabilitySummary"]], "event (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Event"]], "eventlineup (class in pyteamsnap.models)": [[3, "pyteamsnap.models.EventLineup"]], "eventlineupentry (class in pyteamsnap.models)": [[3, "pyteamsnap.models.EventLineupEntry"]], "location (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Location"]], "me (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Me"]], "member (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Member"]], "memberstatistics (class in pyteamsnap.models)": [[3, "pyteamsnap.models.MemberStatistics"]], "opponent (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Opponent"]], "statistics (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Statistics"]], "team (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Team"]], "user (class in pyteamsnap.models)": [[3, "pyteamsnap.models.User"]], "data (pyteamsnap.models.availability property)": [[3, "pyteamsnap.models.Availability.data"]], "data (pyteamsnap.models.availabilitysummary property)": [[3, "pyteamsnap.models.AvailabilitySummary.data"]], "data (pyteamsnap.models.event property)": [[3, "pyteamsnap.models.Event.data"]], "data (pyteamsnap.models.eventlineup property)": [[3, "pyteamsnap.models.EventLineup.data"]], "data (pyteamsnap.models.eventlineupentry property)": [[3, "pyteamsnap.models.EventLineupEntry.data"]], "data (pyteamsnap.models.location property)": [[3, "pyteamsnap.models.Location.data"]], "data (pyteamsnap.models.member property)": [[3, "pyteamsnap.models.Member.data"]], "data (pyteamsnap.models.opponent property)": [[3, "pyteamsnap.models.Opponent.data"]], "data (pyteamsnap.models.statistics property)": [[3, "pyteamsnap.models.Statistics.data"]], "data (pyteamsnap.models.team property)": [[3, "pyteamsnap.models.Team.data"]], "data (pyteamsnap.models.user property)": [[3, "pyteamsnap.models.User.data"]], "pyteamsnap.models": [[3, "module-pyteamsnap.models"]], "rel (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.rel"]], "rel (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.rel"]], "rel (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.rel"]], "rel (pyteamsnap.models.eventlineup attribute)": [[3, "pyteamsnap.models.EventLineup.rel"]], "rel (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.rel"]], "rel (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.rel"]], "rel (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.rel"]], "rel (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.rel"]], "rel (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.rel"]], "rel (pyteamsnap.models.opponent attribute)": [[3, "pyteamsnap.models.Opponent.rel"]], "rel (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.rel"]], "rel (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.rel"]], "rel (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.rel"]], "search() (pyteamsnap.models.eventlineupentry class method)": [[3, "pyteamsnap.models.EventLineupEntry.search"]], "template (pyteamsnap.models.eventlineup attribute)": [[3, "pyteamsnap.models.EventLineup.template"]], "type (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.type"]], "type (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.type"]], "type (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.type"]], "type (pyteamsnap.models.eventlineup attribute)": [[3, "pyteamsnap.models.EventLineup.type"]], "type (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.type"]], "type (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.type"]], "type (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.type"]], "type (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.type"]], "type (pyteamsnap.models.opponent attribute)": [[3, "pyteamsnap.models.Opponent.type"]], "type (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.type"]], "type (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.type"]], "type (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.type"]], "version (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.version"]], "version (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.version"]], "version (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.version"]], "version (pyteamsnap.models.eventlineup attribute)": [[3, "pyteamsnap.models.EventLineup.version"]], "version (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.version"]], "version (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.version"]], "version (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.version"]], "version (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.version"]], "version (pyteamsnap.models.opponent attribute)": [[3, "pyteamsnap.models.Opponent.version"]], "version (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.version"]], "version (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.version"]], "version (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.version"]]}})
\ No newline at end of file
+Search.setIndex({"docnames": ["index", "modules", "pyteamsnap", "pyteamsnap.models"], "filenames": ["index.rst", "modules.rst", "pyteamsnap.rst", "pyteamsnap.models.rst"], "titles": ["pyteamsnap", "pyteamsnap", "pyteamsnap package", "pyteamsnap.models package"], "terms": {"an": [0, 3], "unoffici": 0, "python": 0, "wrapper": 0, "teamsnap": [0, 1, 2, 3], "api": [0, 2, 3], "A": [0, 2, 3], "work": 0, "progress": 0, "from": [0, 3], "github": 0, "pip": 0, "git": 0, "http": [0, 2, 3], "com": [0, 2, 3], "anthonyscorrea": 0, "To": 0, "connect": 0, "oauth": 0, "2": [0, 3], "credenti": 0, "auth": 0, "client": [0, 1, 3], "import": 0, "token": [0, 2], "you": 0, "can": [0, 2], "us": [0, 2], "constructor": 0, "model": [0, 1, 2], "creat": [0, 3], "instanc": 0, "user": [0, 2, 3], "object": [0, 3], "authent": 0, "me": [0, 2, 3], "00000000": 0, "firstnam": 0, "lastnam": 0, "There": 0, "i": [0, 2, 3], "onli": 0, "one": 0, "session": 0, "so": 0, "search": [0, 2, 3], "requir": 0, "inform": 0, "access": [0, 2], "kei": 0, "just": 0, "like": 0, "dictionari": 0, "see": 0, "each": 0, "data": [0, 2, 3], "properti": 0, "list": [0, 2, 3], "avail": [0, 2, 3], "few": 0, "exampl": 0, "managed_team": 0, "team": [0, 2, 3], "teamnam": 0, "0": [0, 3], "name": [0, 2, 3], "have": 0, "function": 0, "where": 0, "criteria": 0, "pass": [0, 2], "keyword": 0, "argument": 0, "event": [0, 2, 3], "team_id": [0, 2, 3], "id": [0, 2, 3], "titl": 0, "00000001": 0, "start_dat": [0, 2, 3], "datetim": 0, "2000": 0, "1": [0, 3], "12": 0, "00": 0, "retriev": 0, "singularli": 0, "updat": [0, 3], "delet": [0, 2, 3], "permiss": 0, "allow": 0, "member": [0, 2, 3], "new_memb": 0, "new": [0, 2, 3], "first_nam": [0, 2, 3], "ferguson": 0, "last_nam": [0, 2, 3], "jenkin": 0, "post": [0, 2, 3], "jersey_numb": [0, 2, 3], "31": 0, "put": 0, "load": 0, "hetereogen": 0, "given": 0, "paramet": [0, 2, 3], "bulk_load": [0, 2], "list_of_ts_object": 0, "type": [0, 2, 3], "event__id": 0, "found": 0, "here": 0, "packag": 1, "subpackag": 1, "submodul": 1, "modul": 1, "content": 1, "event_id": [2, 3], "is_current_us": [2, 3], "member_id": [2, 3], "note": [2, 3], "notes_author_member_id": [2, 3], "rel": [2, 3], "statu": [2, 3], "status_cod": [2, 3], "version": [2, 3], "availabilitystatuscod": [2, 3], "mayb": [2, 3], "NO": [2, 3], "ye": [2, 3], "availabilitysummari": [2, 3], "going_count": [2, 3], "maybe_count": [2, 3], "not_going_count": [2, 3], "player_going_count": [2, 3], "player_maybe_count": [2, 3], "player_not_going_count": [2, 3], "player_unknown_count": [2, 3], "unknown_count": [2, 3], "additional_location_detail": [2, 3], "arrival_d": [2, 3], "created_at": [2, 3], "division_location_id": [2, 3], "doesnt_count_towards_record": [2, 3], "duration_in_minut": [2, 3], "end_dat": [2, 3], "formatted_result": [2, 3], "formatted_titl": [2, 3], "formatted_title_for_multi_team": [2, 3], "game_typ": [2, 3], "game_type_cod": [2, 3], "icon_color": [2, 3], "is_cancel": [2, 3], "is_gam": [2, 3], "is_league_control": [2, 3], "is_overtim": [2, 3], "is_shootout": [2, 3], "is_tbd": [2, 3], "label": [2, 3], "location_id": [2, 3], "location_nam": [2, 3], "minutes_to_arrive_earli": [2, 3], "opponent_id": [2, 3], "opponent_nam": [2, 3], "points_for_oppon": [2, 3], "points_for_team": [2, 3], "repeating_typ": [2, 3], "repeating_type_cod": [2, 3], "repeating_uuid": [2, 3], "result": [2, 3], "results_url": [2, 3], "shootout_points_for_oppon": [2, 3], "shootout_points_for_team": [2, 3], "source_time_zone_iana_nam": [2, 3], "time_zon": [2, 3], "time_zone_descript": [2, 3], "time_zone_iana_nam": [2, 3], "time_zone_offset": [2, 3], "tracks_avail": [2, 3], "uniform": [2, 3], "updated_at": [2, 3], "eventlineup": [2, 3], "entries_count": [2, 3], "is_publish": [2, 3], "eventlineupentri": [2, 3], "availability_status_cod": [2, 3], "event_lineup_id": [2, 3], "member_nam": [2, 3], "member_photo": [2, 3], "sequenc": [2, 3], "locat": [2, 3], "address": [2, 3], "is_retir": [2, 3], "latitud": [2, 3], "longitud": [2, 3], "phone": [2, 3], "url": [2, 3], "birthdai": [2, 3], "email": [2, 3], "facebook_access_token": [2, 3], "facebook_id": [2, 3], "is_lab_rat": [2, 3], "password": [2, 3], "receives_newslett": [2, 3], "address_c": [2, 3], "address_st": [2, 3], "address_street1": [2, 3], "address_street2": [2, 3], "address_zip": [2, 3], "gender": [2, 3], "hide_address": [2, 3], "hide_ag": [2, 3], "is_address_hidden": [2, 3], "is_age_hidden": [2, 3], "is_manag": [2, 3], "is_non_play": [2, 3], "is_ownership_pend": [2, 3], "posit": [2, 3], "source_act": [2, 3], "memberstatist": [2, 3], "averag": [2, 3], "average_rank": [2, 3], "average_ranking_for_queri": [2, 3], "count_games_plai": [2, 3], "statistic_id": [2, 3], "total": [2, 3], "total_rank": [2, 3], "total_ranking_for_queri": [2, 3], "oppon": [2, 3], "contacts_email": [2, 3], "contacts_nam": [2, 3], "contacts_phon": [2, 3], "statist": [2, 3], "acronym": [2, 3], "always_display_decim": [2, 3], "display_zero_tot": [2, 3], "formula": [2, 3], "is_in_descending_ord": [2, 3], "is_percentag": [2, 3], "is_priv": [2, 3], "is_team_statist": [2, 3], "is_top_statist": [2, 3], "precis": [2, 3], "statistic_group_id": [2, 3], "ad_unit_hero_id": [2, 3], "ad_unit_hero_template_id": [2, 3], "ad_unit_inline_id": [2, 3], "division_id": [2, 3], "division_nam": [2, 3], "league_nam": [2, 3], "league_url": [2, 3], "location_countri": [2, 3], "location_postal_cod": [2, 3], "owner_email": [2, 3], "owner_first_nam": [2, 3], "owner_last_nam": [2, 3], "season_nam": [2, 3], "sport_id": [2, 3], "class": [2, 3], "str": [2, 3], "arg": 2, "kwarg": [2, 3], "base": [2, 3], "apicli": 2, "The": [2, 3], "hypermedia": 2, "json": 2, "collect": 2, "base_url": 2, "v3": 2, "baseteamsnapobject": [2, 3], "tteamsnap": 2, "item": 2, "fetch": 2, "form": 2, "addit": 2, "filter": 2, "request": 2, "them": 2, "": [2, 3], "querystr": 2, "type__filt": 2, "valu": [2, 3], "e": 2, "event__start_d": 2, "2015": 2, "01": 2, "ani": 2, "specifi": 2, "return": [2, 3], "heterogen": 2, "command": 2, "delete_item": 2, "union": [2, 3], "int": 2, "none": 2, "get_item": 2, "dict": [2, 3], "link": 2, "link_nam": 2, "post_item": 2, "put_item": 2, "queri": 2, "top": 2, "level": 2, "3": 3, "866": 3, "enum": 3, "enumer": 3, "availability_summari": 3, "associ": 3, "repres": 3, "game": 3, "track": 3, "system": 3, "www": 3, "document": 3, "apiv3": 3, "event_lineup": 3, "event_lineup_entri": 3, "classmethod": 3, "teamsnapbaseobject": 3, "current": 3, "It": 3, "possibl": 3, "via": 3, "howev": 3, "record": 3, "also": 3, "refer": 3, "roster": 3, "our": 3, "web": 3, "mobil": 3, "app": 3, "member_statist": 3, "your": 3, "origin": 3, "full": 3, "crud": 3, "endpoint": 3}, "objects": {"": [[2, 0, 0, "-", "pyteamsnap"]], "pyteamsnap": [[2, 0, 0, "-", "client"], [3, 0, 0, "-", "models"]], "pyteamsnap.client": [[2, 1, 1, "", "TeamSnap"]], "pyteamsnap.client.TeamSnap": [[2, 2, 1, "", "base_url"], [2, 3, 1, "", "bulk_load"], [2, 3, 1, "", "command"], [2, 3, 1, "", "delete_item"], [2, 3, 1, "", "get_item"], [2, 3, 1, "", "link"], [2, 3, 1, "", "post_item"], [2, 3, 1, "", "put_item"], [2, 3, 1, "", "query"]], "pyteamsnap.models": [[3, 1, 1, "", "Availability"], [3, 1, 1, "", "AvailabilityStatusCode"], [3, 1, 1, "", "AvailabilitySummary"], [3, 1, 1, "", "Event"], [3, 1, 1, "", "EventLineup"], [3, 1, 1, "", "EventLineupEntry"], [3, 1, 1, "", "Location"], [3, 1, 1, "", "Me"], [3, 1, 1, "", "Member"], [3, 1, 1, "", "MemberStatistics"], [3, 1, 1, "", "Opponent"], [3, 1, 1, "", "Statistics"], [3, 1, 1, "", "Team"], [3, 1, 1, "", "User"]], "pyteamsnap.models.Availability": [[3, 2, 1, "", "event_id"], [3, 2, 1, "", "is_current_user"], [3, 2, 1, "", "member_id"], [3, 2, 1, "", "notes"], [3, 2, 1, "", "notes_author_member_id"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "status"], [3, 2, 1, "", "status_code"], [3, 2, 1, "", "team_id"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.AvailabilityStatusCode": [[3, 2, 1, "", "MAYBE"], [3, 2, 1, "", "NO"], [3, 2, 1, "", "YES"]], "pyteamsnap.models.AvailabilitySummary": [[3, 2, 1, "", "event_id"], [3, 2, 1, "", "going_count"], [3, 2, 1, "", "maybe_count"], [3, 2, 1, "", "not_going_count"], [3, 2, 1, "", "player_going_count"], [3, 2, 1, "", "player_maybe_count"], [3, 2, 1, "", "player_not_going_count"], [3, 2, 1, "", "player_unknown_count"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "team_id"], [3, 2, 1, "", "type"], [3, 2, 1, "", "unknown_count"], [3, 2, 1, "", "version"]], "pyteamsnap.models.Event": [[3, 2, 1, "", "additional_location_details"], [3, 2, 1, "", "arrival_date"], [3, 2, 1, "", "created_at"], [3, 2, 1, "", "division_location_id"], [3, 2, 1, "", "doesnt_count_towards_record"], [3, 2, 1, "", "duration_in_minutes"], [3, 2, 1, "", "end_date"], [3, 2, 1, "", "formatted_results"], [3, 2, 1, "", "formatted_title"], [3, 2, 1, "", "formatted_title_for_multi_team"], [3, 2, 1, "", "game_type"], [3, 2, 1, "", "game_type_code"], [3, 2, 1, "", "icon_color"], [3, 2, 1, "", "is_canceled"], [3, 2, 1, "", "is_game"], [3, 2, 1, "", "is_league_controlled"], [3, 2, 1, "", "is_overtime"], [3, 2, 1, "", "is_shootout"], [3, 2, 1, "", "is_tbd"], [3, 2, 1, "", "label"], [3, 2, 1, "", "location_id"], [3, 2, 1, "", "location_name"], [3, 2, 1, "", "minutes_to_arrive_early"], [3, 2, 1, "", "name"], [3, 2, 1, "", "notes"], [3, 2, 1, "", "opponent_id"], [3, 2, 1, "", "opponent_name"], [3, 2, 1, "", "points_for_opponent"], [3, 2, 1, "", "points_for_team"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "repeating_type"], [3, 2, 1, "", "repeating_type_code"], [3, 2, 1, "", "repeating_uuid"], [3, 2, 1, "", "results"], [3, 2, 1, "", "results_url"], [3, 2, 1, "", "shootout_points_for_opponent"], [3, 2, 1, "", "shootout_points_for_team"], [3, 2, 1, "", "source_time_zone_iana_name"], [3, 2, 1, "", "start_date"], [3, 2, 1, "", "team_id"], [3, 2, 1, "", "time_zone"], [3, 2, 1, "", "time_zone_description"], [3, 2, 1, "", "time_zone_iana_name"], [3, 2, 1, "", "time_zone_offset"], [3, 2, 1, "", "tracks_availability"], [3, 2, 1, "", "type"], [3, 2, 1, "", "uniform"], [3, 2, 1, "", "updated_at"], [3, 2, 1, "", "version"]], "pyteamsnap.models.EventLineup": [[3, 2, 1, "", "entries_count"], [3, 2, 1, "", "event_id"], [3, 2, 1, "", "is_published"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.EventLineupEntry": [[3, 2, 1, "", "availability_status_code"], [3, 2, 1, "", "event_id"], [3, 2, 1, "", "event_lineup_id"], [3, 2, 1, "", "label"], [3, 2, 1, "", "member_id"], [3, 2, 1, "", "member_name"], [3, 2, 1, "", "member_photo"], [3, 2, 1, "", "rel"], [3, 3, 1, "", "search"], [3, 2, 1, "", "sequence"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.Location": [[3, 2, 1, "", "address"], [3, 2, 1, "", "is_retired"], [3, 2, 1, "", "latitude"], [3, 2, 1, "", "longitude"], [3, 2, 1, "", "name"], [3, 2, 1, "", "notes"], [3, 2, 1, "", "phone"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "team_id"], [3, 2, 1, "", "type"], [3, 2, 1, "", "url"], [3, 2, 1, "", "version"]], "pyteamsnap.models.Me": [[3, 2, 1, "", "birthday"], [3, 2, 1, "", "email"], [3, 2, 1, "", "facebook_access_token"], [3, 2, 1, "", "facebook_id"], [3, 2, 1, "", "first_name"], [3, 2, 1, "", "is_lab_rat"], [3, 2, 1, "", "last_name"], [3, 2, 1, "", "password"], [3, 2, 1, "", "receives_newsletter"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.Member": [[3, 2, 1, "", "address_city"], [3, 2, 1, "", "address_state"], [3, 2, 1, "", "address_street1"], [3, 2, 1, "", "address_street2"], [3, 2, 1, "", "address_zip"], [3, 2, 1, "", "birthday"], [3, 2, 1, "", "first_name"], [3, 2, 1, "", "gender"], [3, 2, 1, "", "hide_address"], [3, 2, 1, "", "hide_age"], [3, 2, 1, "", "is_address_hidden"], [3, 2, 1, "", "is_age_hidden"], [3, 2, 1, "", "is_manager"], [3, 2, 1, "", "is_non_player"], [3, 2, 1, "", "is_ownership_pending"], [3, 2, 1, "", "jersey_number"], [3, 2, 1, "", "last_name"], [3, 2, 1, "", "position"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "source_action"], [3, 2, 1, "", "team_id"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.MemberStatistics": [[3, 2, 1, "", "average"], [3, 2, 1, "", "average_ranking"], [3, 2, 1, "", "average_ranking_for_query"], [3, 2, 1, "", "count_games_played"], [3, 2, 1, "", "id"], [3, 2, 1, "", "member_id"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "statistic_id"], [3, 2, 1, "", "team_id"], [3, 2, 1, "", "total"], [3, 2, 1, "", "total_ranking"], [3, 2, 1, "", "total_ranking_for_query"], [3, 2, 1, "", "type"]], "pyteamsnap.models.Opponent": [[3, 2, 1, "", "contacts_email"], [3, 2, 1, "", "contacts_name"], [3, 2, 1, "", "contacts_phone"], [3, 2, 1, "", "name"], [3, 2, 1, "", "notes"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "team_id"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.Statistics": [[3, 2, 1, "", "acronym"], [3, 2, 1, "", "always_display_decimals"], [3, 2, 1, "", "display_zero_totals"], [3, 2, 1, "", "formula"], [3, 2, 1, "", "is_in_descending_order"], [3, 2, 1, "", "is_percentage"], [3, 2, 1, "", "is_private"], [3, 2, 1, "", "is_team_statistic"], [3, 2, 1, "", "is_top_statistic"], [3, 2, 1, "", "name"], [3, 2, 1, "", "precision"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "statistic_group_id"], [3, 2, 1, "", "team_id"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.Team": [[3, 2, 1, "", "ad_unit_hero_id"], [3, 2, 1, "", "ad_unit_hero_template_id"], [3, 2, 1, "", "ad_unit_inline_id"], [3, 2, 1, "", "division_id"], [3, 2, 1, "", "division_name"], [3, 2, 1, "", "is_ownership_pending"], [3, 2, 1, "", "league_name"], [3, 2, 1, "", "league_url"], [3, 2, 1, "", "location_country"], [3, 2, 1, "", "location_postal_code"], [3, 2, 1, "", "name"], [3, 2, 1, "", "owner_email"], [3, 2, 1, "", "owner_first_name"], [3, 2, 1, "", "owner_last_name"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "season_name"], [3, 2, 1, "", "sport_id"], [3, 2, 1, "", "team"], [3, 2, 1, "", "time_zone"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]], "pyteamsnap.models.User": [[3, 2, 1, "", "birthday"], [3, 3, 1, "", "delete"], [3, 2, 1, "", "email"], [3, 2, 1, "", "facebook_access_token"], [3, 2, 1, "", "facebook_id"], [3, 2, 1, "", "first_name"], [3, 2, 1, "", "is_lab_rat"], [3, 2, 1, "", "last_name"], [3, 3, 1, "", "new"], [3, 2, 1, "", "password"], [3, 3, 1, "", "post"], [3, 2, 1, "", "receives_newsletter"], [3, 2, 1, "", "rel"], [3, 2, 1, "", "type"], [3, 2, 1, "", "version"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:attribute", "3": "py:method"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "attribute", "Python attribute"], "3": ["py", "method", "Python method"]}, "titleterms": {"pyteamsnap": [0, 1, 2, 3], "instal": 0, "get": 0, "start": 0, "document": 0, "packag": [2, 3], "subpackag": 2, "submodul": 2, "client": 2, "modul": [2, 3], "content": [2, 3], "model": 3}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 57}, "alltitles": {"pyteamsnap": [[0, "pyteamsnap"], [1, "pyteamsnap"]], "Installation": [[0, "installation"]], "Getting Started": [[0, "getting-started"]], "Documentation": [[0, "id1"]], "pyteamsnap package": [[2, "pyteamsnap-package"]], "Subpackages": [[2, "subpackages"]], "Submodules": [[2, "submodules"]], "pyteamsnap.client module": [[2, "module-pyteamsnap.client"]], "Module contents": [[2, "module-pyteamsnap"], [3, "module-pyteamsnap.models"]], "pyteamsnap.models package": [[3, "pyteamsnap-models-package"]]}, "indexentries": {"teamsnap (class in pyteamsnap.client)": [[2, "pyteamsnap.client.TeamSnap"]], "base_url (pyteamsnap.client.teamsnap attribute)": [[2, "pyteamsnap.client.TeamSnap.base_url"]], "bulk_load() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.bulk_load"]], "command() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.command"]], "delete_item() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.delete_item"]], "get_item() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.get_item"]], "link() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.link"]], "module": [[2, "module-pyteamsnap"], [2, "module-pyteamsnap.client"], [3, "module-pyteamsnap.models"]], "post_item() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.post_item"]], "put_item() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.put_item"]], "pyteamsnap": [[2, "module-pyteamsnap"]], "pyteamsnap.client": [[2, "module-pyteamsnap.client"]], "query() (pyteamsnap.client.teamsnap method)": [[2, "pyteamsnap.client.TeamSnap.query"]], "availability (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Availability"]], "availabilitystatuscode (class in pyteamsnap.models)": [[3, "pyteamsnap.models.AvailabilityStatusCode"]], "availabilitysummary (class in pyteamsnap.models)": [[3, "pyteamsnap.models.AvailabilitySummary"]], "event (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Event"]], "eventlineup (class in pyteamsnap.models)": [[3, "pyteamsnap.models.EventLineup"]], "eventlineupentry (class in pyteamsnap.models)": [[3, "pyteamsnap.models.EventLineupEntry"]], "location (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Location"]], "maybe (pyteamsnap.models.availabilitystatuscode attribute)": [[3, "pyteamsnap.models.AvailabilityStatusCode.MAYBE"]], "me (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Me"]], "member (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Member"]], "memberstatistics (class in pyteamsnap.models)": [[3, "pyteamsnap.models.MemberStatistics"]], "no (pyteamsnap.models.availabilitystatuscode attribute)": [[3, "pyteamsnap.models.AvailabilityStatusCode.NO"]], "opponent (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Opponent"]], "statistics (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Statistics"]], "team (class in pyteamsnap.models)": [[3, "pyteamsnap.models.Team"]], "user (class in pyteamsnap.models)": [[3, "pyteamsnap.models.User"]], "yes (pyteamsnap.models.availabilitystatuscode attribute)": [[3, "pyteamsnap.models.AvailabilityStatusCode.YES"]], "acronym (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.acronym"]], "ad_unit_hero_id (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.ad_unit_hero_id"]], "ad_unit_hero_template_id (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.ad_unit_hero_template_id"]], "ad_unit_inline_id (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.ad_unit_inline_id"]], "additional_location_details (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.additional_location_details"]], "address (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.address"]], "address_city (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.address_city"]], "address_state (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.address_state"]], "address_street1 (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.address_street1"]], "address_street2 (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.address_street2"]], "address_zip (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.address_zip"]], "always_display_decimals (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.always_display_decimals"]], "arrival_date (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.arrival_date"]], "availability_status_code (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.availability_status_code"]], "average (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.average"]], "average_ranking (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.average_ranking"]], "average_ranking_for_query (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.average_ranking_for_query"]], "birthday (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.birthday"]], "birthday (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.birthday"]], "birthday (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.birthday"]], "contacts_email (pyteamsnap.models.opponent attribute)": [[3, "pyteamsnap.models.Opponent.contacts_email"]], "contacts_name (pyteamsnap.models.opponent attribute)": [[3, "pyteamsnap.models.Opponent.contacts_name"]], "contacts_phone (pyteamsnap.models.opponent attribute)": [[3, "pyteamsnap.models.Opponent.contacts_phone"]], "count_games_played (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.count_games_played"]], "created_at (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.created_at"]], "delete() (pyteamsnap.models.user method)": [[3, "pyteamsnap.models.User.delete"]], "display_zero_totals (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.display_zero_totals"]], "division_id (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.division_id"]], "division_location_id (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.division_location_id"]], "division_name (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.division_name"]], "doesnt_count_towards_record (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.doesnt_count_towards_record"]], "duration_in_minutes (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.duration_in_minutes"]], "email (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.email"]], "email (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.email"]], "end_date (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.end_date"]], "entries_count (pyteamsnap.models.eventlineup attribute)": [[3, "pyteamsnap.models.EventLineup.entries_count"]], "event_id (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.event_id"]], "event_id (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.event_id"]], "event_id (pyteamsnap.models.eventlineup attribute)": [[3, "pyteamsnap.models.EventLineup.event_id"]], "event_id (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.event_id"]], "event_lineup_id (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.event_lineup_id"]], "facebook_access_token (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.facebook_access_token"]], "facebook_access_token (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.facebook_access_token"]], "facebook_id (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.facebook_id"]], "facebook_id (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.facebook_id"]], "first_name (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.first_name"]], "first_name (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.first_name"]], "first_name (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.first_name"]], "formatted_results (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.formatted_results"]], "formatted_title (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.formatted_title"]], "formatted_title_for_multi_team (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.formatted_title_for_multi_team"]], "formula (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.formula"]], "game_type (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.game_type"]], "game_type_code (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.game_type_code"]], "gender (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.gender"]], "going_count (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.going_count"]], "hide_address (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.hide_address"]], "hide_age (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.hide_age"]], "icon_color (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.icon_color"]], "id (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.id"]], "is_address_hidden (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.is_address_hidden"]], "is_age_hidden (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.is_age_hidden"]], "is_canceled (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.is_canceled"]], "is_current_user (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.is_current_user"]], "is_game (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.is_game"]], "is_in_descending_order (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.is_in_descending_order"]], "is_lab_rat (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.is_lab_rat"]], "is_lab_rat (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.is_lab_rat"]], "is_league_controlled (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.is_league_controlled"]], "is_manager (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.is_manager"]], "is_non_player (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.is_non_player"]], "is_overtime (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.is_overtime"]], "is_ownership_pending (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.is_ownership_pending"]], "is_ownership_pending (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.is_ownership_pending"]], "is_percentage (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.is_percentage"]], "is_private (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.is_private"]], "is_published (pyteamsnap.models.eventlineup attribute)": [[3, "pyteamsnap.models.EventLineup.is_published"]], "is_retired (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.is_retired"]], "is_shootout (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.is_shootout"]], "is_tbd (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.is_tbd"]], "is_team_statistic (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.is_team_statistic"]], "is_top_statistic (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.is_top_statistic"]], "jersey_number (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.jersey_number"]], "label (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.label"]], "label (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.label"]], "last_name (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.last_name"]], "last_name (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.last_name"]], "last_name (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.last_name"]], "latitude (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.latitude"]], "league_name (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.league_name"]], "league_url (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.league_url"]], "location_country (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.location_country"]], "location_id (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.location_id"]], "location_name (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.location_name"]], "location_postal_code (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.location_postal_code"]], "longitude (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.longitude"]], "maybe_count (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.maybe_count"]], "member_id (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.member_id"]], "member_id (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.member_id"]], "member_id (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.member_id"]], "member_name (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.member_name"]], "member_photo (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.member_photo"]], "minutes_to_arrive_early (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.minutes_to_arrive_early"]], "name (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.name"]], "name (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.name"]], "name (pyteamsnap.models.opponent attribute)": [[3, "pyteamsnap.models.Opponent.name"]], "name (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.name"]], "name (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.name"]], "new() (pyteamsnap.models.user method)": [[3, "pyteamsnap.models.User.new"]], "not_going_count (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.not_going_count"]], "notes (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.notes"]], "notes (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.notes"]], "notes (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.notes"]], "notes (pyteamsnap.models.opponent attribute)": [[3, "pyteamsnap.models.Opponent.notes"]], "notes_author_member_id (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.notes_author_member_id"]], "opponent_id (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.opponent_id"]], "opponent_name (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.opponent_name"]], "owner_email (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.owner_email"]], "owner_first_name (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.owner_first_name"]], "owner_last_name (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.owner_last_name"]], "password (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.password"]], "password (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.password"]], "phone (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.phone"]], "player_going_count (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.player_going_count"]], "player_maybe_count (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.player_maybe_count"]], "player_not_going_count (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.player_not_going_count"]], "player_unknown_count (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.player_unknown_count"]], "points_for_opponent (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.points_for_opponent"]], "points_for_team (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.points_for_team"]], "position (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.position"]], "post() (pyteamsnap.models.user method)": [[3, "pyteamsnap.models.User.post"]], "precision (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.precision"]], "pyteamsnap.models": [[3, "module-pyteamsnap.models"]], "receives_newsletter (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.receives_newsletter"]], "receives_newsletter (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.receives_newsletter"]], "rel (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.rel"]], "rel (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.rel"]], "rel (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.rel"]], "rel (pyteamsnap.models.eventlineup attribute)": [[3, "pyteamsnap.models.EventLineup.rel"]], "rel (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.rel"]], "rel (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.rel"]], "rel (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.rel"]], "rel (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.rel"]], "rel (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.rel"]], "rel (pyteamsnap.models.opponent attribute)": [[3, "pyteamsnap.models.Opponent.rel"]], "rel (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.rel"]], "rel (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.rel"]], "rel (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.rel"]], "repeating_type (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.repeating_type"]], "repeating_type_code (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.repeating_type_code"]], "repeating_uuid (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.repeating_uuid"]], "results (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.results"]], "results_url (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.results_url"]], "search() (pyteamsnap.models.eventlineupentry class method)": [[3, "pyteamsnap.models.EventLineupEntry.search"]], "season_name (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.season_name"]], "sequence (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.sequence"]], "shootout_points_for_opponent (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.shootout_points_for_opponent"]], "shootout_points_for_team (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.shootout_points_for_team"]], "source_action (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.source_action"]], "source_time_zone_iana_name (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.source_time_zone_iana_name"]], "sport_id (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.sport_id"]], "start_date (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.start_date"]], "statistic_group_id (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.statistic_group_id"]], "statistic_id (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.statistic_id"]], "status (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.status"]], "status_code (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.status_code"]], "team (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.team"]], "team_id (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.team_id"]], "team_id (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.team_id"]], "team_id (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.team_id"]], "team_id (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.team_id"]], "team_id (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.team_id"]], "team_id (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.team_id"]], "team_id (pyteamsnap.models.opponent attribute)": [[3, "pyteamsnap.models.Opponent.team_id"]], "team_id (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.team_id"]], "time_zone (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.time_zone"]], "time_zone (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.time_zone"]], "time_zone_description (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.time_zone_description"]], "time_zone_iana_name (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.time_zone_iana_name"]], "time_zone_offset (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.time_zone_offset"]], "total (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.total"]], "total_ranking (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.total_ranking"]], "total_ranking_for_query (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.total_ranking_for_query"]], "tracks_availability (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.tracks_availability"]], "type (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.type"]], "type (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.type"]], "type (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.type"]], "type (pyteamsnap.models.eventlineup attribute)": [[3, "pyteamsnap.models.EventLineup.type"]], "type (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.type"]], "type (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.type"]], "type (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.type"]], "type (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.type"]], "type (pyteamsnap.models.memberstatistics attribute)": [[3, "pyteamsnap.models.MemberStatistics.type"]], "type (pyteamsnap.models.opponent attribute)": [[3, "pyteamsnap.models.Opponent.type"]], "type (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.type"]], "type (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.type"]], "type (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.type"]], "uniform (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.uniform"]], "unknown_count (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.unknown_count"]], "updated_at (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.updated_at"]], "url (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.url"]], "version (pyteamsnap.models.availability attribute)": [[3, "pyteamsnap.models.Availability.version"]], "version (pyteamsnap.models.availabilitysummary attribute)": [[3, "pyteamsnap.models.AvailabilitySummary.version"]], "version (pyteamsnap.models.event attribute)": [[3, "pyteamsnap.models.Event.version"]], "version (pyteamsnap.models.eventlineup attribute)": [[3, "pyteamsnap.models.EventLineup.version"]], "version (pyteamsnap.models.eventlineupentry attribute)": [[3, "pyteamsnap.models.EventLineupEntry.version"]], "version (pyteamsnap.models.location attribute)": [[3, "pyteamsnap.models.Location.version"]], "version (pyteamsnap.models.me attribute)": [[3, "pyteamsnap.models.Me.version"]], "version (pyteamsnap.models.member attribute)": [[3, "pyteamsnap.models.Member.version"]], "version (pyteamsnap.models.opponent attribute)": [[3, "pyteamsnap.models.Opponent.version"]], "version (pyteamsnap.models.statistics attribute)": [[3, "pyteamsnap.models.Statistics.version"]], "version (pyteamsnap.models.team attribute)": [[3, "pyteamsnap.models.Team.version"]], "version (pyteamsnap.models.user attribute)": [[3, "pyteamsnap.models.User.version"]]}})
\ No newline at end of file
diff --git a/pyteamsnap/client.py b/pyteamsnap/client.py
index f95a3b1..40aabd7 100644
--- a/pyteamsnap/client.py
+++ b/pyteamsnap/client.py
@@ -6,8 +6,9 @@ from apiclient import (
JsonResponseHandler,
JsonRequestFormatter,
)
-from pyteamsnap.models.base import BaseApiObject
+from pyteamsnap.models.base import BaseTeamsnapObject
import datetime
+from pyteamsnap.formatters import CollectionJsonResponseHandler, CollectionJsonRequestFormatter
TTeamSnap = T.TypeVar("TTeamSnap", bound="TeamSnap")
@@ -24,14 +25,14 @@ class TeamSnap(APIClient):
super().__init__(
*args,
authentication_method=HeaderAuthentication(token=token),
- response_handler=JsonResponseHandler,
- request_formatter=JsonRequestFormatter,
+ response_handler=CollectionJsonResponseHandler,
+ request_formatter=CollectionJsonRequestFormatter,
**kwargs,
)
- self._root_collection = self.get(self.base_url)["collection"]
- self._links = self._by_rel(self.base_url, "links")
- self._queries = self._by_rel(self.base_url, "queries")
- self._commands = self._by_rel(self.base_url, "commands")
+ self._root_collection = self.get(self.base_url)
+ self._links = self._root_collection.links
+ self._queries = self._root_collection.queries
+ # self._commands = self._root_collection.commands # TODO add 'commands' in the future. It is non-standard
pass
def link(self, link_name):
@@ -39,12 +40,12 @@ class TeamSnap(APIClient):
return d.get(link_name)
def bulk_load(
- self, team_id, types: T.List[BaseApiObject], **kwargs
+ self, team_id, types: T.List[BaseTeamsnapObject], **kwargs
) -> T.List[TTeamSnap]:
"""
:param team_id:
- :param types: List of items to fetch, in the form of BaseApiObject classes
+ :param types: List of items to fetch, in the form of BaseTeamsnapObject classes
:param kwargs: Additional filters passed into requested types by passing them in the url's querystring
as type__filter=value (i.e. ?event__start_date=2015-01-01).
Any filter can be passed that is available on the search for the specified type.
@@ -52,61 +53,41 @@ class TeamSnap(APIClient):
"""
types_dict = {t.type: t for t in types}
r = self.query(
- rel="self",
+ rel="root",
query="bulk_load",
types=",".join(types_dict.keys()),
team_id=team_id,
- **kwargs,
+ **kwargs
)
result = []
for item in r:
- cls = types_dict[item["type"]]
+ cls = types_dict[item['type']]
instance = cls(self, data=item)
result.append(instance)
return result
- def _by_rel(self, url: str, record_key: str) -> dict:
- """Get a mapping of record_key to its collection.
-
- :param url:
- :param record_key: one of "href", "version", "links", "items", "queries", "commands", "template", "error"
- :return: A mapping of record_key to its collection
- """
- collection = self.get(url)["collection"]
- return {collection["rel"]: collection for collection in collection[record_key]}
-
def query(self, rel, query: str, **kwargs) -> list:
- queries = self._by_rel(self._get_href(rel), "queries")
- response = self.get(self._get_href(rel=query, links=queries), params=kwargs)
- return self.parse_response(response)
+ if rel == 'root':
+ queries = self._root_collection.queries
+ else:
+ href = self._root_collection.links.get(rel=rel).href
+ queries = self.get(href).queries
+
+ response = self.get(
+ queries.get(rel=query).href,
+ params=kwargs)
+ parsed_response = [{d.name: d.value for d in item.data} for item in response.items]
+ return parsed_response
def command(self, rel, command: str, **kwargs) -> list:
- commands = self._by_rel(self._get_href(rel), "commands")
- response = self.get(self._get_href(command, commands), params=kwargs)
- return self.parse_response(response)
-
- def _get_href(self, rel: str, links: dict = None, url: str = base_url) -> str:
- """
-
- :param rel:
- :param links:
- :param url:
- :return: A hyperlink from the links dictionary. Each item in the links dictionary is a
- dictionary with a rel and href key
- """
- try:
- if links is None:
- links = self._by_rel(url, "links")
-
- link = links[rel]["href"]
- except Exception as e:
- raise e
- return link
+ raise NotImplementedError
def get_item(self, rel: str, id: T.Union[int, str]) -> dict:
- r = self.get(f"{self.link(rel)}/{id}")
- return self.parse_response(r)[0]
+ href = self._root_collection.links.get(rel=rel).href
+ response = self.get(f"{href}/{id}")
+ item = response.items[0]
+ return {d.name: d.value for d in item.data}
def post_item(self, rel: str, data: dict) -> dict:
r = super(TeamSnap, self).post(f"{self.link(rel)}", data=data)
@@ -119,25 +100,3 @@ class TeamSnap(APIClient):
def delete_item(self, rel, id: T.Union[int, str]) -> None:
super(TeamSnap, self).delete(f"{self.link(rel)}/{id}")
return None
-
- @classmethod
- def parse_response(self, response: dict) -> list:
- result = []
- for item in response["collection"].get("items", []):
- details = {}
- for detail in item["data"]:
- value = detail["value"]
- value_type = detail["type"]
- if value:
- if value_type == "DateTime":
- value = datetime.datetime.strptime(value, "%Y-%m-%dT%H:%M:%S%z")
- elif value_type == "Boolean":
- if value is not True:
- value = False
- elif value_type == "Integer":
- value = int(value)
- details[detail["name"]] = value
- result.append(details)
-
- return result
- # return [{detail['name']: detail['value'] for detail in item} for item in items]
diff --git a/pyteamsnap/formatters.py b/pyteamsnap/formatters.py
new file mode 100644
index 0000000..d5249ed
--- /dev/null
+++ b/pyteamsnap/formatters.py
@@ -0,0 +1,57 @@
+from apiclient.response_handlers import BaseResponseHandler
+from apiclient.request_formatters import BaseRequestFormatter
+from apiclient.response import Response
+from typing import Optional
+from apiclient.exceptions import ResponseParseError
+from apiclient.utils.typing import JsonType, XmlType, OptionalJsonType, OptionalStr
+from json import JSONDecodeError
+from collection_json import Collection
+import json
+import datetime
+
+def date_hook(obj):
+ t = type(obj)
+
+ if t is dict:
+ return {k: date_hook(v) for k, v in obj.items()}
+ if t is list:
+ return [date_hook(elem) for elem in obj]
+ if t is str:
+ if "-" in obj and "Z" in obj and "Z" in obj and len(obj) == 20:
+ try:
+ return datetime.datetime.strptime(obj, "%Y-%m-%dT%H:%M:%S%z")
+ except ValueError as e:
+ raise e
+ elif obj.count('-') == 2 and len(obj) == 10:
+ try:
+ return datetime.datetime.strptime(obj, "%Y-%m-%d")
+ except ValueError as e:
+ raise e
+ return obj
+ return obj
+
+class CollectionJsonResponseHandler(BaseResponseHandler):
+ """Attempt to return the decoded response data as json."""
+
+ @staticmethod
+ def get_request_data(response: Response) -> Optional[JsonType]:
+ if response.get_raw_data() == "":
+ return None
+
+ try:
+ response_json_collection = Collection.from_json(response.get_raw_data(), object_hook=date_hook)
+ except JSONDecodeError as error:
+ raise ResponseParseError(
+ f"Unable to decode response data to json. data='{response.get_raw_data()}'"
+ ) from error
+ return response_json_collection
+
+class CollectionJsonRequestFormatter(BaseRequestFormatter):
+ """Format the outgoing data as json."""
+
+ content_type = "application/json"
+
+ @classmethod
+ def format(cls, data: OptionalJsonType) -> OptionalStr:
+ if data:
+ return json.dumps(data)
diff --git a/pyteamsnap/models/availability.py b/pyteamsnap/models/availability.py
index 3ec8368..dff0d3b 100644
--- a/pyteamsnap/models/availability.py
+++ b/pyteamsnap/models/availability.py
@@ -1,4 +1,4 @@
-from .base import BaseApiObject
+from .base import BaseTeamsnapObject
from enum import Enum
class AvailabilityStatusCode(Enum):
@@ -6,7 +6,7 @@ class AvailabilityStatusCode(Enum):
MAYBE = 2
NO = 0
-class Availability(BaseApiObject):
+class Availability(BaseTeamsnapObject):
rel = "availabilities"
type = "availability"
version = "3.866.0"
diff --git a/pyteamsnap/models/availabilitysummary.py b/pyteamsnap/models/availabilitysummary.py
index 801d46e..98a9d2b 100644
--- a/pyteamsnap/models/availabilitysummary.py
+++ b/pyteamsnap/models/availabilitysummary.py
@@ -1,7 +1,7 @@
-from .base import BaseApiObject
+from .base import BaseTeamsnapObject
-class AvailabilitySummary(BaseApiObject):
+class AvailabilitySummary(BaseTeamsnapObject):
rel = "availability_summaries"
type = "availability_summary"
version = "3.866.0"
@@ -18,3 +18,6 @@ class AvailabilitySummary(BaseApiObject):
"player_maybe_count",
"player_unknown_count",
]
+
+ def __str__(self):
+ return f"{self.going_count} going, {self.maybe_count} maybe going, {self.not_going_count} not going, {self.unknown_count} unknown."
diff --git a/pyteamsnap/models/base.py b/pyteamsnap/models/base.py
index 196941c..c9d2da9 100644
--- a/pyteamsnap/models/base.py
+++ b/pyteamsnap/models/base.py
@@ -1,22 +1,22 @@
from __future__ import annotations
import apiclient.exceptions
-from apiclient import (
- APIClient,
-)
+import pyteamsnap.client
import typing as T
from abc import ABC
from itertools import chain
-
+from collection_json import Collection
# Import "preview" of Self typing
# https://stackoverflow.com/a/70932112
from typing_extensions import Self
+
class NotPossibleError(Exception):
- """Raised for actions that are not possible to perform this action per API"""
+ """Raised for actions that are not possible to perform per API"""
pass
-class BaseApiObject(ABC):
+
+class BaseTeamsnapObject(ABC):
rel: str = None
version: str = None
@@ -27,21 +27,22 @@ class BaseApiObject(ABC):
]
def __init__(
- self, client: APIClient, data: T.Dict[str, T.Union[str, list]] = {}
+ self, client: pyteamsnap.client.TeamSnap, data: T.Dict[str, T.Union[str, list]] = {}
) -> None:
"""
- :param client:
+ :param client: TeamSnap client
:param data: Data to instantiate instance, defaults to empty dict.
"""
self.client = client
slots = list(chain.from_iterable(getattr(cls, '__slots__', []) for cls in self.__class__.__mro__))
for k, v in data.items():
- if k == "id" :
- setattr(self, 'id', v) #TODO remove this, here for backward compatibility, but bad idea
+ if k == "id":
+ setattr(self, 'id',
+ v) # remove id property from BaseTeamsnapObject, here for backward compatibility, but bad idea
setattr(self, 'id_', v)
- elif k in ['type', 'rel']: #read only, inherit to class type
+ elif k in ['type', 'rel']: # read only, inherit to class type
continue
elif k in slots:
setattr(self, k, v)
@@ -50,58 +51,82 @@ class BaseApiObject(ABC):
pass
pass
-
def __str__(self):
return self.name
def __repr__(self):
- return f''
-
+ return f'<{self.__class__.__name__} id={self.id_}>'
@property
def data(self) -> T.Dict[str, T.Union[str, list]]:
"""Data dictionary for object
- :return: dict: dict with keys:
+ :return: dict: dictionary with object's properties
"""
slots = chain.from_iterable(getattr(cls, '__slots__', []) for cls in self.__class__.__mro__)
- return {k:getattr(self, k, None) for k in slots}
+ data = {k: getattr(self, k, None) for k in slots}
+
+ data['id'] = data.pop('id_')
+
+ return data
@classmethod
- def search(cls, client: APIClient, **kwargs):
+ def search(cls, client: pyteamsnap.client.TeamSnap, **kwargs) -> T.List[Self]:
+ """
+
+ :param client:
+ :param kwargs:
+ :return: List of TeamSnapBaseObjects
+ """
try:
results = client.query(cls.rel, "search", **kwargs)
except apiclient.exceptions.ServerError as e:
raise e
- return [cls(client, data=r) for r in results]
+ return [cls(client, data=result) for result in results]
@classmethod
- def get(cls, client: APIClient, id: T.Union[int, str]) -> Self:
- r = client.get(f"{client.link(cls.rel)}/{id}")
- return cls(client, client.parse_response(r)[0])
+ def get(cls, client: pyteamsnap.client.TeamSnap, id_: T.Union[int, str]) -> Self:
+ """
+ Get one TeamsnapBaseObject from the client
+ :param client: T
+ :param id_: TeamSnap id of the desired object
+ :return:
+ """
+ result = client.get_item(cls.rel, id_)
+ return cls(client, data=result)
@classmethod
- def new(cls, client: Self) -> Self:
- return cls(client)
+ def new(cls, client: pyteamsnap.client.TeamSnap, data: dict = {}) -> Self:
+ """
+ Creates a new, blank TeamsnapBaseobject
+ :param client: TeamSnap client
+ :param data: TeamSnap client
+ :return:
+ """
+ return cls(client, data=data)
def post(self) -> Self:
- data = {
- "template": {
- "data": [{"name": k, "value": v} for k, v in self.data.items()]
- }
- }
- r = self.client.post_item(self.rel, data=data)
- return self
+ ''' Create object on
+
+ :return:
+ '''
+ data = [{"name": k, "value": v} for k, v in self.data.items()]
+ collection = Collection(template={'data':data})
+ response = self.client.post_item(self.rel, data=collection)
+ if response:
+ return self
+ else:
+ raise Exception
def put(self) -> Self:
- data = {
- "template": {
- "data": [{"name": k, "value": str(v)} for k, v in self.data.items()]
- }
- }
- id = self.data.get("id")
- r = self.client.put_item(self.rel, id=id, data=data)
- return self
+ data = [{"name": k, "value": v} for k, v in self.data.items()]
+ collection = Collection(template={'data': data})
+ id = collection.template.id.value
+ response = self.client.put_item(self.rel, id=id, data=data)
+ if response:
+ return self
+ else:
+ raise Exception
def delete(self):
self.client.delete_item(self.rel, id=self.data["id"])
diff --git a/pyteamsnap/models/event.py b/pyteamsnap/models/event.py
index 5014557..c114bfc 100644
--- a/pyteamsnap/models/event.py
+++ b/pyteamsnap/models/event.py
@@ -1,7 +1,7 @@
-from .base import BaseApiObject
+from .base import BaseTeamsnapObject
-class Event(BaseApiObject):
+class Event(BaseTeamsnapObject):
"""Associated object to a team; and represents an event or game that is tracked in the TeamSnap system.
https://www.teamsnap.com/documentation/apiv3/objects#Events
diff --git a/pyteamsnap/models/eventlineup.py b/pyteamsnap/models/eventlineup.py
index 2a531b6..49ec1b1 100644
--- a/pyteamsnap/models/eventlineup.py
+++ b/pyteamsnap/models/eventlineup.py
@@ -1,7 +1,7 @@
-from .base import BaseApiObject
+from .base import BaseTeamsnapObject
-class EventLineup(BaseApiObject):
+class EventLineup(BaseTeamsnapObject):
rel = "event_lineups"
type = "event_lineup"
version = "3.866.0"
diff --git a/pyteamsnap/models/eventlineupentry.py b/pyteamsnap/models/eventlineupentry.py
index 6be65f2..8e389cd 100644
--- a/pyteamsnap/models/eventlineupentry.py
+++ b/pyteamsnap/models/eventlineupentry.py
@@ -1,7 +1,7 @@
-from .base import BaseApiObject
+from .base import BaseTeamsnapObject
-class EventLineupEntry(BaseApiObject):
+class EventLineupEntry(BaseTeamsnapObject):
rel = "event_lineup_entries"
type = "event_lineup_entry"
version = "3.866.0"
diff --git a/pyteamsnap/models/location.py b/pyteamsnap/models/location.py
index bd5f34d..14e6685 100644
--- a/pyteamsnap/models/location.py
+++ b/pyteamsnap/models/location.py
@@ -1,7 +1,7 @@
-from .base import BaseApiObject
+from .base import BaseTeamsnapObject
-class Location(BaseApiObject):
+class Location(BaseTeamsnapObject):
rel = "locations"
type = "location"
version = "3.866.0"
diff --git a/pyteamsnap/models/me.py b/pyteamsnap/models/me.py
index 627602a..5a3fe07 100644
--- a/pyteamsnap/models/me.py
+++ b/pyteamsnap/models/me.py
@@ -11,7 +11,3 @@ class Me(User):
rel = "me"
type = "user"
version = "3.866.0"
-
- def __new__(self, client):
- data = client.parse_response(client.get(client.link(self.rel)))[0]
- return User(client=client, data=data)
diff --git a/pyteamsnap/models/member.py b/pyteamsnap/models/member.py
index 22c81d0..b552b4a 100644
--- a/pyteamsnap/models/member.py
+++ b/pyteamsnap/models/member.py
@@ -1,7 +1,7 @@
-from .base import BaseApiObject
+from .base import BaseTeamsnapObject
-class Member(BaseApiObject):
+class Member(BaseTeamsnapObject):
"""A member (also referred to as a roster in our web and mobile apps) is a member of a team.
https://www.teamsnap.com/documentation/apiv3/objects#Members
@@ -36,6 +36,3 @@ class Member(BaseApiObject):
def __str__(self):
return f"{self.first_name} {self.last_name}"
-
- def __repr__(self):
- return f''
diff --git a/pyteamsnap/models/memberstatistics.py b/pyteamsnap/models/memberstatistics.py
index 15e0aaf..366ebec 100644
--- a/pyteamsnap/models/memberstatistics.py
+++ b/pyteamsnap/models/memberstatistics.py
@@ -1,7 +1,7 @@
-from .base import BaseApiObject
+from .base import BaseTeamsnapObject
-class MemberStatistics(BaseApiObject):
+class MemberStatistics(BaseTeamsnapObject):
rel = "member_statistics"
type = "member_statistic"
diff --git a/pyteamsnap/models/opponent.py b/pyteamsnap/models/opponent.py
index 949d0f1..d5b6511 100644
--- a/pyteamsnap/models/opponent.py
+++ b/pyteamsnap/models/opponent.py
@@ -1,7 +1,7 @@
-from .base import BaseApiObject
+from .base import BaseTeamsnapObject
-class Opponent(BaseApiObject):
+class Opponent(BaseTeamsnapObject):
rel = "opponents"
type = "opponent"
version = "3.866.0"
diff --git a/pyteamsnap/models/statistics.py b/pyteamsnap/models/statistics.py
index 80430e7..63c6c20 100644
--- a/pyteamsnap/models/statistics.py
+++ b/pyteamsnap/models/statistics.py
@@ -1,7 +1,7 @@
-from .base import BaseApiObject
+from .base import BaseTeamsnapObject
-class Statistics(BaseApiObject):
+class Statistics(BaseTeamsnapObject):
rel = "statistics"
type = "statistic"
version = "3.866.0"
diff --git a/pyteamsnap/models/team.py b/pyteamsnap/models/team.py
index dc19110..68d8cf0 100644
--- a/pyteamsnap/models/team.py
+++ b/pyteamsnap/models/team.py
@@ -1,7 +1,7 @@
-from .base import BaseApiObject
+from .base import BaseTeamsnapObject
-class Team(BaseApiObject):
+class Team(BaseTeamsnapObject):
"""Associated teams from your origin object. Full CRUD is possible with the teams endpoint.
https://www.teamsnap.com/documentation/apiv3/objects#Teams
diff --git a/pyteamsnap/models/user.py b/pyteamsnap/models/user.py
index 47ebc90..5a3da9e 100644
--- a/pyteamsnap/models/user.py
+++ b/pyteamsnap/models/user.py
@@ -1,7 +1,7 @@
-from .base import BaseApiObject, NotPossibleError
+from .base import BaseTeamsnapObject, NotPossibleError
-class User(BaseApiObject):
+class User(BaseTeamsnapObject):
rel = "users"
type = "user"
diff --git a/requirements.txt b/requirements.txt
index e8ea6b0..129d4fb 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,3 @@
api-client==1.3.1
typing-extensions==4.4
+git+https://github.com/anthonyscorrea/collection-json.python.git#egg=collection-json
diff --git a/tests/base.py b/tests/base.py
index 2e50a5d..4c83563 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -8,7 +8,7 @@ from unittest import TestCase
from pyteamsnap import client
from os import getenv
-from pyteamsnap.models.base import BaseApiObject
+from pyteamsnap.models.base import BaseTeamsnapObject
import vcr
TEAMSNAP_TOKEN = getenv('TEAMSNAP_TOKEN')
TEAMSNAP_TEAM = getenv('TEAMSNAP_TEAM')
@@ -17,13 +17,14 @@ TEAMSNAP_EVENT = getenv('TEAMSNAP_EVENT')
vcr_options = {
'decode_compressed_response': True,
'cassette_library_dir':'tests/fixtures/cassettes',
+ 'record_mode':'new_episodes',
'filter_headers':['authorization']
}
class BaseModelTestCase:
"""Tests for `pyteamsnap` package."""
__test__= False
- TestClass: BaseApiObject = None
+ TestClass: BaseTeamsnapObject = None
@classmethod
def setUpClass(cls) -> None:
@@ -42,6 +43,10 @@ class BaseModelTestCase:
instance = search_results[0]
self.assertIsInstance(instance, self.TestClass)
self.assertTrue(len(instance.data))
+
+ retrieved_instance = self.TestClass.get(self.client, instance.id)
+ self.assertIsInstance(retrieved_instance, self.TestClass)
+ self.assertTrue(len(retrieved_instance.data))
return instance
diff --git a/tests/client.py b/tests/test_client.py
similarity index 96%
rename from tests/client.py
rename to tests/test_client.py
index 7a344bb..5752981 100644
--- a/tests/client.py
+++ b/tests/test_client.py
@@ -8,7 +8,7 @@ from unittest import TestCase
from pyteamsnap import client
from os import getenv
-from pyteamsnap.models.base import BaseApiObject
+from pyteamsnap.models.base import BaseTeamsnapObject
import vcr
TEAMSNAP_TOKEN = getenv('TEAMSNAP_TOKEN')
TEAMSNAP_TEAM = getenv('TEAMSNAP_TEAM')