Skip to content

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
@custom_define()
class DestinyCharacter(DestinyCharacterMixin):
    """
    A representation of a Destiny 2 character

    Attributes:
        membership_id: The user's id
        membership_type: The user's type, aka platform
        character_id: The character's id
    """

    membership_id: int = custom_field()
    membership_type: Union["BungieMembershipType", int] = custom_field(converter=enum_converter("BungieMembershipType"))
    character_id: int = custom_field()

_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
def _fuzzy_getattr(self, name: str) -> Any:
    """
    Returns the objs attribute that fully matches the name, or if that does not exist, the first attribute that includes the name

    Args:
        name: The name to match

    Raises:
        KeyError: If no match is found

    Returns:
        The attribute value
    """

    try:
        found_attr = getattr(self, name)
        return found_attr
    except AttributeError:
        for attr_name in self.__dir__():
            if name in attr_name:
                return getattr(self, attr_name)
        raise KeyError(f"`{name}` not found in `{self.__dir__()}`")

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
async def get_activity_history(
    self, count: int, mode: Union["DestinyActivityModeType", int], page: int, auth: Optional["AuthData"] = None
) -> "DestinyActivityHistoryResults":
    """
    Gets activity history stats for indicated character.

    Args:
        count: Number of rows to return
        mode: 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.
        page: Page number to return, starting with 0.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_activity_history(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        count=count,
        mode=mode,
        page=page,
        auth=auth,
    )

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
async def get_character(
    self, components: list[Union["DestinyComponentType", int]], auth: Optional["AuthData"] = None
) -> "DestinyCharacterResponse":
    """
    Returns character information for the supplied character.

    Args:
        components: 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.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_character(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        components=components,
        auth=auth,
    )

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
async def get_collectible_node_details(
    self,
    collectible_presentation_node_hash: int,
    components: list[Union["DestinyComponentType", int]],
    auth: Optional["AuthData"] = None,
) -> "DestinyCollectibleNodeDetailResponse":
    """
    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.

    Args:
        collectible_presentation_node_hash: 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.
        components: 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.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_collectible_node_details(
        character_id=self._fuzzy_getattr("character_id"),
        collectible_presentation_node_hash=collectible_presentation_node_hash,
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        components=components,
        auth=auth,
    )

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
async def get_destiny_aggregate_activity_stats(
    self, auth: Optional["AuthData"] = None
) -> "DestinyAggregateActivityResults":
    """
    Gets all activities the character has participated in together with aggregate statistics for those activities.

    Args:
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_destiny_aggregate_activity_stats(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        auth=auth,
    )

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
async def get_historical_stats(
    self,
    dayend: datetime,
    daystart: datetime,
    groups: list[Union["DestinyStatsGroupType", int]],
    modes: list[Union["DestinyActivityModeType", int]],
    period_type: Union["PeriodType", int],
    auth: Optional["AuthData"] = None,
) -> dict[str, "DestinyHistoricalStatsByPeriod"]:
    """
    Gets historical stats for indicated character.

    Args:
        dayend: 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.
        daystart: 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.
        groups: Group of stats to include, otherwise only general stats are returned. Comma separated list is allowed. Values: General, Weapons, Medals
        modes: Game modes to return. See the documentation for DestinyActivityModeType for valid values, and pass in string representation, comma delimited.
        period_type: Indicates a specific period type to return. Optional. May be: Daily, AllTime, or Activity
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_historical_stats(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        dayend=dayend,
        daystart=daystart,
        groups=groups,
        modes=modes,
        period_type=period_type,
        auth=auth,
    )

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
async def get_leaderboards_for_character(
    self, maxtop: int, modes: str, statid: str, auth: Optional["AuthData"] = None
) -> dict[str, dict[str, "DestinyLeaderboard"]]:
    """
    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.

    Args:
        maxtop: Maximum number of top players to return. Use a large number to get entire leaderboard.
        modes: List of game modes for which to get leaderboards. See the documentation for DestinyActivityModeType for valid values, and pass in string representation, comma delimited.
        statid: ID of stat to return rather than returning all Leaderboard stats.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_leaderboards_for_character(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        maxtop=maxtop,
        modes=modes,
        statid=statid,
        auth=auth,
    )

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
async def get_unique_weapon_history(self, auth: Optional["AuthData"] = None) -> "DestinyHistoricalWeaponStatsData":
    """
    Gets details about unique weapon usage, including all exotic weapons.

    Args:
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_unique_weapon_history(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        auth=auth,
    )

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
async def get_vendor(
    self, vendor_hash: int, components: list[Union["DestinyComponentType", int]], auth: Optional["AuthData"] = None
) -> "DestinyVendorResponse":
    """
    Get the details of a specific Vendor.

    Args:
        vendor_hash: The Hash identifier of the Vendor to be returned.
        components: 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.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_vendor(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        vendor_hash=vendor_hash,
        components=components,
        auth=auth,
    )

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
async def get_vendors(
    self,
    components: list[Union["DestinyComponentType", int]],
    filter: Union["DestinyVendorFilter", int],
    auth: Optional["AuthData"] = None,
) -> "DestinyVendorsResponse":
    """
    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.

    Args:
        components: 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.
        filter: The filter of what vendors and items to return, if any.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_vendors(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        components=components,
        filter=filter,
        auth=auth,
    )

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
async def yield_activity_history(
    self,
    mode: Union["DestinyActivityModeType", int],
    earliest_allowed_datetime: Optional[datetime] = None,
    latest_allowed_datetime: Optional[datetime] = None,
    auth: Optional["AuthData"] = None,
) -> AsyncGenerator["DestinyHistoricalStatsPeriodGroup", None]:
    """
    Yields character activity history. Sorted by date descending, the latest one first.

    Args:
        mode: 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.
        earliest_allowed_datetime: The earliest time the activity is allowed to have, fe. only entries after the 1/1/2020.
        latest_allowed_datetime: The latest time the activity is allowed to have, fe. only entries before the 1/1/2020.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        A generator for the model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    stop = False
    page = 0
    while True:
        if stop:
            break

        activities = await self.get_activity_history(count=250, mode=mode, page=page, auth=auth)

        # break if empty, fe. when pages are over
        if activities.activities is MISSING:
            break

        # yield the activities
        for activity in activities.activities:
            # check times if wanted
            if earliest_allowed_datetime or latest_allowed_datetime:
                # check if the activity started later than the earliest allowed, else pass this one and do the next
                # This works bc Bungie sorts the api with the newest entry on top
                if earliest_allowed_datetime:
                    if activity.period < earliest_allowed_datetime:
                        stop = True
                        break

                # check if the time is still in the timeframe, else break
                if latest_allowed_datetime:
                    if activity.period > latest_allowed_datetime:
                        continue

            yield activity
        page += 1

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
@custom_define()
class DestinyCharacterMixin(ClientMixin, FuzzyAttrFinder):
    async def yield_activity_history(
        self,
        mode: Union["DestinyActivityModeType", int],
        earliest_allowed_datetime: Optional[datetime] = None,
        latest_allowed_datetime: Optional[datetime] = None,
        auth: Optional["AuthData"] = None,
    ) -> AsyncGenerator["DestinyHistoricalStatsPeriodGroup", None]:
        """
        Yields character activity history. Sorted by date descending, the latest one first.

        Args:
            mode: 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.
            earliest_allowed_datetime: The earliest time the activity is allowed to have, fe. only entries after the 1/1/2020.
            latest_allowed_datetime: The latest time the activity is allowed to have, fe. only entries before the 1/1/2020.
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Returns:
            A generator for the model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
        """

        stop = False
        page = 0
        while True:
            if stop:
                break

            activities = await self.get_activity_history(count=250, mode=mode, page=page, auth=auth)

            # break if empty, fe. when pages are over
            if activities.activities is MISSING:
                break

            # yield the activities
            for activity in activities.activities:
                # check times if wanted
                if earliest_allowed_datetime or latest_allowed_datetime:
                    # check if the activity started later than the earliest allowed, else pass this one and do the next
                    # This works bc Bungie sorts the api with the newest entry on top
                    if earliest_allowed_datetime:
                        if activity.period < earliest_allowed_datetime:
                            stop = True
                            break

                    # check if the time is still in the timeframe, else break
                    if latest_allowed_datetime:
                        if activity.period > latest_allowed_datetime:
                            continue

                yield activity
            page += 1

    # DO NOT CHANGE ANY CODE BELOW. Automatically generated and overwritten

    async def get_character(
        self, components: list[Union["DestinyComponentType", int]], auth: Optional["AuthData"] = None
    ) -> "DestinyCharacterResponse":
        """
        Returns character information for the supplied character.

        Args:
            components: 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.
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Returns:
            The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
        """

        return await self._client.api.get_character(
            character_id=self._fuzzy_getattr("character_id"),
            destiny_membership_id=self._fuzzy_getattr("membership_id"),
            membership_type=self._fuzzy_getattr("membership_type"),
            components=components,
            auth=auth,
        )

    async def get_vendors(
        self,
        components: list[Union["DestinyComponentType", int]],
        filter: Union["DestinyVendorFilter", int],
        auth: Optional["AuthData"] = None,
    ) -> "DestinyVendorsResponse":
        """
        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.

        Args:
            components: 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.
            filter: The filter of what vendors and items to return, if any.
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Returns:
            The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
        """

        return await self._client.api.get_vendors(
            character_id=self._fuzzy_getattr("character_id"),
            destiny_membership_id=self._fuzzy_getattr("membership_id"),
            membership_type=self._fuzzy_getattr("membership_type"),
            components=components,
            filter=filter,
            auth=auth,
        )

    async def get_vendor(
        self, vendor_hash: int, components: list[Union["DestinyComponentType", int]], auth: Optional["AuthData"] = None
    ) -> "DestinyVendorResponse":
        """
        Get the details of a specific Vendor.

        Args:
            vendor_hash: The Hash identifier of the Vendor to be returned.
            components: 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.
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Returns:
            The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
        """

        return await self._client.api.get_vendor(
            character_id=self._fuzzy_getattr("character_id"),
            destiny_membership_id=self._fuzzy_getattr("membership_id"),
            membership_type=self._fuzzy_getattr("membership_type"),
            vendor_hash=vendor_hash,
            components=components,
            auth=auth,
        )

    async def get_collectible_node_details(
        self,
        collectible_presentation_node_hash: int,
        components: list[Union["DestinyComponentType", int]],
        auth: Optional["AuthData"] = None,
    ) -> "DestinyCollectibleNodeDetailResponse":
        """
        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.

        Args:
            collectible_presentation_node_hash: 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.
            components: 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.
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Returns:
            The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
        """

        return await self._client.api.get_collectible_node_details(
            character_id=self._fuzzy_getattr("character_id"),
            collectible_presentation_node_hash=collectible_presentation_node_hash,
            destiny_membership_id=self._fuzzy_getattr("membership_id"),
            membership_type=self._fuzzy_getattr("membership_type"),
            components=components,
            auth=auth,
        )

    async def get_leaderboards_for_character(
        self, maxtop: int, modes: str, statid: str, auth: Optional["AuthData"] = None
    ) -> dict[str, dict[str, "DestinyLeaderboard"]]:
        """
        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.

        Args:
            maxtop: Maximum number of top players to return. Use a large number to get entire leaderboard.
            modes: List of game modes for which to get leaderboards. See the documentation for DestinyActivityModeType for valid values, and pass in string representation, comma delimited.
            statid: ID of stat to return rather than returning all Leaderboard stats.
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Returns:
            The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
        """

        return await self._client.api.get_leaderboards_for_character(
            character_id=self._fuzzy_getattr("character_id"),
            destiny_membership_id=self._fuzzy_getattr("membership_id"),
            membership_type=self._fuzzy_getattr("membership_type"),
            maxtop=maxtop,
            modes=modes,
            statid=statid,
            auth=auth,
        )

    async def get_historical_stats(
        self,
        dayend: datetime,
        daystart: datetime,
        groups: list[Union["DestinyStatsGroupType", int]],
        modes: list[Union["DestinyActivityModeType", int]],
        period_type: Union["PeriodType", int],
        auth: Optional["AuthData"] = None,
    ) -> dict[str, "DestinyHistoricalStatsByPeriod"]:
        """
        Gets historical stats for indicated character.

        Args:
            dayend: 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.
            daystart: 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.
            groups: Group of stats to include, otherwise only general stats are returned. Comma separated list is allowed. Values: General, Weapons, Medals
            modes: Game modes to return. See the documentation for DestinyActivityModeType for valid values, and pass in string representation, comma delimited.
            period_type: Indicates a specific period type to return. Optional. May be: Daily, AllTime, or Activity
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Returns:
            The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
        """

        return await self._client.api.get_historical_stats(
            character_id=self._fuzzy_getattr("character_id"),
            destiny_membership_id=self._fuzzy_getattr("membership_id"),
            membership_type=self._fuzzy_getattr("membership_type"),
            dayend=dayend,
            daystart=daystart,
            groups=groups,
            modes=modes,
            period_type=period_type,
            auth=auth,
        )

    async def get_activity_history(
        self, count: int, mode: Union["DestinyActivityModeType", int], page: int, auth: Optional["AuthData"] = None
    ) -> "DestinyActivityHistoryResults":
        """
        Gets activity history stats for indicated character.

        Args:
            count: Number of rows to return
            mode: 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.
            page: Page number to return, starting with 0.
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Returns:
            The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
        """

        return await self._client.api.get_activity_history(
            character_id=self._fuzzy_getattr("character_id"),
            destiny_membership_id=self._fuzzy_getattr("membership_id"),
            membership_type=self._fuzzy_getattr("membership_type"),
            count=count,
            mode=mode,
            page=page,
            auth=auth,
        )

    async def get_unique_weapon_history(self, auth: Optional["AuthData"] = None) -> "DestinyHistoricalWeaponStatsData":
        """
        Gets details about unique weapon usage, including all exotic weapons.

        Args:
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Returns:
            The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
        """

        return await self._client.api.get_unique_weapon_history(
            character_id=self._fuzzy_getattr("character_id"),
            destiny_membership_id=self._fuzzy_getattr("membership_id"),
            membership_type=self._fuzzy_getattr("membership_type"),
            auth=auth,
        )

    async def get_destiny_aggregate_activity_stats(
        self, auth: Optional["AuthData"] = None
    ) -> "DestinyAggregateActivityResults":
        """
        Gets all activities the character has participated in together with aggregate statistics for those activities.

        Args:
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Returns:
            The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
        """

        return await self._client.api.get_destiny_aggregate_activity_stats(
            character_id=self._fuzzy_getattr("character_id"),
            destiny_membership_id=self._fuzzy_getattr("membership_id"),
            membership_type=self._fuzzy_getattr("membership_type"),
            auth=auth,
        )

_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
def _fuzzy_getattr(self, name: str) -> Any:
    """
    Returns the objs attribute that fully matches the name, or if that does not exist, the first attribute that includes the name

    Args:
        name: The name to match

    Raises:
        KeyError: If no match is found

    Returns:
        The attribute value
    """

    try:
        found_attr = getattr(self, name)
        return found_attr
    except AttributeError:
        for attr_name in self.__dir__():
            if name in attr_name:
                return getattr(self, attr_name)
        raise KeyError(f"`{name}` not found in `{self.__dir__()}`")

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
async def get_activity_history(
    self, count: int, mode: Union["DestinyActivityModeType", int], page: int, auth: Optional["AuthData"] = None
) -> "DestinyActivityHistoryResults":
    """
    Gets activity history stats for indicated character.

    Args:
        count: Number of rows to return
        mode: 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.
        page: Page number to return, starting with 0.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_activity_history(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        count=count,
        mode=mode,
        page=page,
        auth=auth,
    )

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
async def get_character(
    self, components: list[Union["DestinyComponentType", int]], auth: Optional["AuthData"] = None
) -> "DestinyCharacterResponse":
    """
    Returns character information for the supplied character.

    Args:
        components: 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.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_character(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        components=components,
        auth=auth,
    )

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
async def get_collectible_node_details(
    self,
    collectible_presentation_node_hash: int,
    components: list[Union["DestinyComponentType", int]],
    auth: Optional["AuthData"] = None,
) -> "DestinyCollectibleNodeDetailResponse":
    """
    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.

    Args:
        collectible_presentation_node_hash: 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.
        components: 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.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_collectible_node_details(
        character_id=self._fuzzy_getattr("character_id"),
        collectible_presentation_node_hash=collectible_presentation_node_hash,
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        components=components,
        auth=auth,
    )

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
async def get_destiny_aggregate_activity_stats(
    self, auth: Optional["AuthData"] = None
) -> "DestinyAggregateActivityResults":
    """
    Gets all activities the character has participated in together with aggregate statistics for those activities.

    Args:
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_destiny_aggregate_activity_stats(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        auth=auth,
    )

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
async def get_historical_stats(
    self,
    dayend: datetime,
    daystart: datetime,
    groups: list[Union["DestinyStatsGroupType", int]],
    modes: list[Union["DestinyActivityModeType", int]],
    period_type: Union["PeriodType", int],
    auth: Optional["AuthData"] = None,
) -> dict[str, "DestinyHistoricalStatsByPeriod"]:
    """
    Gets historical stats for indicated character.

    Args:
        dayend: 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.
        daystart: 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.
        groups: Group of stats to include, otherwise only general stats are returned. Comma separated list is allowed. Values: General, Weapons, Medals
        modes: Game modes to return. See the documentation for DestinyActivityModeType for valid values, and pass in string representation, comma delimited.
        period_type: Indicates a specific period type to return. Optional. May be: Daily, AllTime, or Activity
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_historical_stats(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        dayend=dayend,
        daystart=daystart,
        groups=groups,
        modes=modes,
        period_type=period_type,
        auth=auth,
    )

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
async def get_leaderboards_for_character(
    self, maxtop: int, modes: str, statid: str, auth: Optional["AuthData"] = None
) -> dict[str, dict[str, "DestinyLeaderboard"]]:
    """
    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.

    Args:
        maxtop: Maximum number of top players to return. Use a large number to get entire leaderboard.
        modes: List of game modes for which to get leaderboards. See the documentation for DestinyActivityModeType for valid values, and pass in string representation, comma delimited.
        statid: ID of stat to return rather than returning all Leaderboard stats.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_leaderboards_for_character(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        maxtop=maxtop,
        modes=modes,
        statid=statid,
        auth=auth,
    )

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
async def get_unique_weapon_history(self, auth: Optional["AuthData"] = None) -> "DestinyHistoricalWeaponStatsData":
    """
    Gets details about unique weapon usage, including all exotic weapons.

    Args:
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_unique_weapon_history(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        auth=auth,
    )

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
async def get_vendor(
    self, vendor_hash: int, components: list[Union["DestinyComponentType", int]], auth: Optional["AuthData"] = None
) -> "DestinyVendorResponse":
    """
    Get the details of a specific Vendor.

    Args:
        vendor_hash: The Hash identifier of the Vendor to be returned.
        components: 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.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_vendor(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        vendor_hash=vendor_hash,
        components=components,
        auth=auth,
    )

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
async def get_vendors(
    self,
    components: list[Union["DestinyComponentType", int]],
    filter: Union["DestinyVendorFilter", int],
    auth: Optional["AuthData"] = None,
) -> "DestinyVendorsResponse":
    """
    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.

    Args:
        components: 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.
        filter: The filter of what vendors and items to return, if any.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    return await self._client.api.get_vendors(
        character_id=self._fuzzy_getattr("character_id"),
        destiny_membership_id=self._fuzzy_getattr("membership_id"),
        membership_type=self._fuzzy_getattr("membership_type"),
        components=components,
        filter=filter,
        auth=auth,
    )

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
async def yield_activity_history(
    self,
    mode: Union["DestinyActivityModeType", int],
    earliest_allowed_datetime: Optional[datetime] = None,
    latest_allowed_datetime: Optional[datetime] = None,
    auth: Optional["AuthData"] = None,
) -> AsyncGenerator["DestinyHistoricalStatsPeriodGroup", None]:
    """
    Yields character activity history. Sorted by date descending, the latest one first.

    Args:
        mode: 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.
        earliest_allowed_datetime: The earliest time the activity is allowed to have, fe. only entries after the 1/1/2020.
        latest_allowed_datetime: The latest time the activity is allowed to have, fe. only entries before the 1/1/2020.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        A generator for the model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    stop = False
    page = 0
    while True:
        if stop:
            break

        activities = await self.get_activity_history(count=250, mode=mode, page=page, auth=auth)

        # break if empty, fe. when pages are over
        if activities.activities is MISSING:
            break

        # yield the activities
        for activity in activities.activities:
            # check times if wanted
            if earliest_allowed_datetime or latest_allowed_datetime:
                # check if the activity started later than the earliest allowed, else pass this one and do the next
                # This works bc Bungie sorts the api with the newest entry on top
                if earliest_allowed_datetime:
                    if activity.period < earliest_allowed_datetime:
                        stop = True
                        break

                # check if the time is still in the timeframe, else break
                if latest_allowed_datetime:
                    if activity.period > latest_allowed_datetime:
                        continue

            yield activity
        page += 1