Character Model
DestinyCharacter
Bases: DestinyCharacterMixin
A representation of a Destiny 2 character
Attributes:
| Name | Type | Description |
|---|---|---|
membership_id |
int
|
The user's id |
membership_type |
Union[BungieMembershipType, int]
|
The user's type, aka platform |
character_id |
int
|
The character's id |
Source code in src/bungio/models/basic/character.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
_fuzzy_getattr(name)
Returns the objs attribute that fully matches the name, or if that does not exist, the first attribute that includes the name
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name to match |
required |
Raises:
| Type | Description |
|---|---|
KeyError
|
If no match is found |
Returns:
| Type | Description |
|---|---|
Any
|
The attribute value |
Source code in src/bungio/models/base.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
get_activity_history(count, mode, page, auth=None)
async
Gets activity history stats for indicated character.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count
|
int
|
Number of rows to return |
required |
mode
|
Union[DestinyActivityModeType, int]
|
A filter for the activity mode to be returned. None returns all activities. See the documentation for DestinyActivityModeType for valid values, and pass in string representation. |
required |
page
|
int
|
Page number to return, starting with 0. |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyActivityHistoryResults
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | |
get_character(components, auth=None)
async
Returns character information for the supplied character.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
list[Union[DestinyComponentType, int]]
|
A comma separated list of components to return (as strings or numeric values). See the DestinyComponentType enum for valid components to request. You must request at least one component to receive results. |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyCharacterResponse
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
get_collectible_node_details(collectible_presentation_node_hash, components, auth=None)
async
Given a Presentation Node that has Collectibles as direct descendants, this will return item details about those descendants in the context of the requesting character.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collectible_presentation_node_hash
|
int
|
The hash identifier of the Presentation Node for whom we should return collectible details. Details will only be returned for collectibles that are direct descendants of this node. |
required |
components
|
list[Union[DestinyComponentType, int]]
|
A comma separated list of components to return (as strings or numeric values). See the DestinyComponentType enum for valid components to request. You must request at least one component to receive results. |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyCollectibleNodeDetailResponse
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | |
get_destiny_aggregate_activity_stats(auth=None)
async
Gets all activities the character has participated in together with aggregate statistics for those activities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyAggregateActivityResults
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
get_historical_stats(dayend, daystart, groups, modes, period_type, auth=None)
async
Gets historical stats for indicated character.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dayend
|
datetime
|
Last day to return when daily stats are requested. Use the format YYYY-MM-DD. Currently, we cannot allow more than 31 days of daily data to be requested in a single request. |
required |
daystart
|
datetime
|
First day to return when daily stats are requested. Use the format YYYY-MM-DD. Currently, we cannot allow more than 31 days of daily data to be requested in a single request. |
required |
groups
|
list[Union[DestinyStatsGroupType, int]]
|
Group of stats to include, otherwise only general stats are returned. Comma separated list is allowed. Values: General, Weapons, Medals |
required |
modes
|
list[Union[DestinyActivityModeType, int]]
|
Game modes to return. See the documentation for DestinyActivityModeType for valid values, and pass in string representation, comma delimited. |
required |
period_type
|
Union[PeriodType, int]
|
Indicates a specific period type to return. Optional. May be: Daily, AllTime, or Activity |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, DestinyHistoricalStatsByPeriod]
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | |
get_leaderboards_for_character(maxtop, modes, statid, auth=None)
async
Gets leaderboards with the signed in user's friends and the supplied destinyMembershipId as the focus. PREVIEW: This endpoint is still in beta, and may experience rough edges. The schema is in final form, but there may be bugs that prevent desirable operation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
maxtop
|
int
|
Maximum number of top players to return. Use a large number to get entire leaderboard. |
required |
modes
|
str
|
List of game modes for which to get leaderboards. See the documentation for DestinyActivityModeType for valid values, and pass in string representation, comma delimited. |
required |
statid
|
str
|
ID of stat to return rather than returning all Leaderboard stats. |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, DestinyLeaderboard]]
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
get_unique_weapon_history(auth=None)
async
Gets details about unique weapon usage, including all exotic weapons.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyHistoricalWeaponStatsData
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | |
get_vendor(vendor_hash, components, auth=None)
async
Get the details of a specific Vendor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vendor_hash
|
int
|
The Hash identifier of the Vendor to be returned. |
required |
components
|
list[Union[DestinyComponentType, int]]
|
A comma separated list of components to return (as strings or numeric values). See the DestinyComponentType enum for valid components to request. You must request at least one component to receive results. |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyVendorResponse
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
get_vendors(components, filter, auth=None)
async
Get currently available vendors from the list of vendors that can possibly have rotating inventory. Note that this does not include things like preview vendors and vendors-as-kiosks, neither of whom have rotating/dynamic inventories. Use their definitions as-is for those.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
list[Union[DestinyComponentType, int]]
|
A comma separated list of components to return (as strings or numeric values). See the DestinyComponentType enum for valid components to request. You must request at least one component to receive results. |
required |
filter
|
Union[DestinyVendorFilter, int]
|
The filter of what vendors and items to return, if any. |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyVendorsResponse
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
yield_activity_history(mode, earliest_allowed_datetime=None, latest_allowed_datetime=None, auth=None)
async
Yields character activity history. Sorted by date descending, the latest one first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Union[DestinyActivityModeType, int]
|
A filter for the activity mode to be returned. None returns all activities. See the documentation for DestinyActivityModeType for valid values, and pass in string representation. |
required |
earliest_allowed_datetime
|
Optional[datetime]
|
The earliest time the activity is allowed to have, fe. only entries after the 1/1/2020. |
None
|
latest_allowed_datetime
|
Optional[datetime]
|
The latest time the activity is allowed to have, fe. only entries before the 1/1/2020. |
None
|
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
AsyncGenerator[DestinyHistoricalStatsPeriodGroup, None]
|
A generator for the model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
DestinyCharacterMixin
Bases: ClientMixin, FuzzyAttrFinder
Source code in src/bungio/models/mixins/character.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
_fuzzy_getattr(name)
Returns the objs attribute that fully matches the name, or if that does not exist, the first attribute that includes the name
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name to match |
required |
Raises:
| Type | Description |
|---|---|
KeyError
|
If no match is found |
Returns:
| Type | Description |
|---|---|
Any
|
The attribute value |
Source code in src/bungio/models/base.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
get_activity_history(count, mode, page, auth=None)
async
Gets activity history stats for indicated character.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count
|
int
|
Number of rows to return |
required |
mode
|
Union[DestinyActivityModeType, int]
|
A filter for the activity mode to be returned. None returns all activities. See the documentation for DestinyActivityModeType for valid values, and pass in string representation. |
required |
page
|
int
|
Page number to return, starting with 0. |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyActivityHistoryResults
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | |
get_character(components, auth=None)
async
Returns character information for the supplied character.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
list[Union[DestinyComponentType, int]]
|
A comma separated list of components to return (as strings or numeric values). See the DestinyComponentType enum for valid components to request. You must request at least one component to receive results. |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyCharacterResponse
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
get_collectible_node_details(collectible_presentation_node_hash, components, auth=None)
async
Given a Presentation Node that has Collectibles as direct descendants, this will return item details about those descendants in the context of the requesting character.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collectible_presentation_node_hash
|
int
|
The hash identifier of the Presentation Node for whom we should return collectible details. Details will only be returned for collectibles that are direct descendants of this node. |
required |
components
|
list[Union[DestinyComponentType, int]]
|
A comma separated list of components to return (as strings or numeric values). See the DestinyComponentType enum for valid components to request. You must request at least one component to receive results. |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyCollectibleNodeDetailResponse
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | |
get_destiny_aggregate_activity_stats(auth=None)
async
Gets all activities the character has participated in together with aggregate statistics for those activities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyAggregateActivityResults
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
get_historical_stats(dayend, daystart, groups, modes, period_type, auth=None)
async
Gets historical stats for indicated character.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dayend
|
datetime
|
Last day to return when daily stats are requested. Use the format YYYY-MM-DD. Currently, we cannot allow more than 31 days of daily data to be requested in a single request. |
required |
daystart
|
datetime
|
First day to return when daily stats are requested. Use the format YYYY-MM-DD. Currently, we cannot allow more than 31 days of daily data to be requested in a single request. |
required |
groups
|
list[Union[DestinyStatsGroupType, int]]
|
Group of stats to include, otherwise only general stats are returned. Comma separated list is allowed. Values: General, Weapons, Medals |
required |
modes
|
list[Union[DestinyActivityModeType, int]]
|
Game modes to return. See the documentation for DestinyActivityModeType for valid values, and pass in string representation, comma delimited. |
required |
period_type
|
Union[PeriodType, int]
|
Indicates a specific period type to return. Optional. May be: Daily, AllTime, or Activity |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, DestinyHistoricalStatsByPeriod]
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | |
get_leaderboards_for_character(maxtop, modes, statid, auth=None)
async
Gets leaderboards with the signed in user's friends and the supplied destinyMembershipId as the focus. PREVIEW: This endpoint is still in beta, and may experience rough edges. The schema is in final form, but there may be bugs that prevent desirable operation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
maxtop
|
int
|
Maximum number of top players to return. Use a large number to get entire leaderboard. |
required |
modes
|
str
|
List of game modes for which to get leaderboards. See the documentation for DestinyActivityModeType for valid values, and pass in string representation, comma delimited. |
required |
statid
|
str
|
ID of stat to return rather than returning all Leaderboard stats. |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, DestinyLeaderboard]]
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
get_unique_weapon_history(auth=None)
async
Gets details about unique weapon usage, including all exotic weapons.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyHistoricalWeaponStatsData
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | |
get_vendor(vendor_hash, components, auth=None)
async
Get the details of a specific Vendor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vendor_hash
|
int
|
The Hash identifier of the Vendor to be returned. |
required |
components
|
list[Union[DestinyComponentType, int]]
|
A comma separated list of components to return (as strings or numeric values). See the DestinyComponentType enum for valid components to request. You must request at least one component to receive results. |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyVendorResponse
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
get_vendors(components, filter, auth=None)
async
Get currently available vendors from the list of vendors that can possibly have rotating inventory. Note that this does not include things like preview vendors and vendors-as-kiosks, neither of whom have rotating/dynamic inventories. Use their definitions as-is for those.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
list[Union[DestinyComponentType, int]]
|
A comma separated list of components to return (as strings or numeric values). See the DestinyComponentType enum for valid components to request. You must request at least one component to receive results. |
required |
filter
|
Union[DestinyVendorFilter, int]
|
The filter of what vendors and items to return, if any. |
required |
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
DestinyVendorsResponse
|
The model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
yield_activity_history(mode, earliest_allowed_datetime=None, latest_allowed_datetime=None, auth=None)
async
Yields character activity history. Sorted by date descending, the latest one first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Union[DestinyActivityModeType, int]
|
A filter for the activity mode to be returned. None returns all activities. See the documentation for DestinyActivityModeType for valid values, and pass in string representation. |
required |
earliest_allowed_datetime
|
Optional[datetime]
|
The earliest time the activity is allowed to have, fe. only entries after the 1/1/2020. |
None
|
latest_allowed_datetime
|
Optional[datetime]
|
The latest time the activity is allowed to have, fe. only entries before the 1/1/2020. |
None
|
auth
|
Optional[AuthData]
|
Authentication information. Required when users with a private profile are queried, or when Bungie feels like it |
None
|
Returns:
| Type | Description |
|---|---|
AsyncGenerator[DestinyHistoricalStatsPeriodGroup, None]
|
A generator for the model which is returned by bungie. General endpoint information. |
Source code in src/bungio/models/mixins/character.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |