Skip to content

Destiny API Models

DestinyProgression

Bases: BaseModel

Information about a current character's status with a Progression. A progression is a value that can increase with activity and has levels. Think Character Level and Reputation Levels. Combine this "live" data with the related DestinyProgressionDefinition for a full picture of the Progression.

Manifest Information

This model has some attributes which can be filled with additional information found in the manifest (manifest_...). Without additional work, these attributes will be None, since they require additional requests and database lookups.

To fill the manifest dependent attributes, either:

  • Run await ThisClass.fetch_manifest_information(), see here
  • Set Client.always_return_manifest_information to True, see here

Attributes:

Name Type Description
current_progress int

This is the total amount of progress obtained overall for this progression (for instance, the total amount of Character Level experience earned)

current_reset_count int

The number of resets of this progression you've executed this season, if applicable to this progression.

daily_limit int

If this progression has a daily limit, this is that limit.

daily_progress int

The amount of progress earned today for this progression.

level int

This is the level of the progression (for instance, the Character Level).

level_cap int

This is the maximum possible level you can achieve for this progression (for example, the maximum character level obtainable)

next_level_at int

The total amount of progression (i.e. "Experience") needed in order to reach the next level.

progress_to_next_level int

The amount of progression (i.e. "Experience") needed to reach the next level of this Progression. Jeez, progression is such an overloaded word.

progression_hash int

The hash identifier of the Progression in question. Use it to look up the DestinyProgressionDefinition in static data.

reward_item_socket_override_states dict[int, DestinyProgressionRewardItemSocketOverrideState]

Information about items stats and states that have socket overrides, if there is any data for it.

reward_item_states list[Union[DestinyProgressionRewardItemState, int]]

Information about historical rewards for this progression, if there is any data for it.

season_resets list[DestinyProgressionResetEntry]

Information about historical resets of this progression, if there is any data for it.

step_index int

Progressions define their levels in "steps". Since the last step may be repeatable, the user may be at a higher level than the actual Step achieved in the progression. Not necessarily useful, but potentially interesting for those cruising the API. Relate this to the "steps" property of the DestinyProgression to see which step the user is on, if you care about that. (Note that this is Content Version dependent since it refers to indexes.)

weekly_limit int

If this progression has a weekly limit, this is that limit.

weekly_progress int

The amount of progress earned toward this progression in the current week.

manifest_progression_hash Optional[DestinyProgressionDefinition]

Manifest information for progression_hash

Source code in src/bungio/models/bungie/destiny/__init__.py
27
28
29
30
31
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
@custom_define()
class DestinyProgression(BaseModel):
    """
    Information about a current character's status with a Progression. A progression is a value that can increase with activity and has levels. Think Character Level and Reputation Levels. Combine this "live" data with the related DestinyProgressionDefinition for a full picture of the Progression.

    Tip: Manifest Information
        This model has some attributes which can be filled with additional information found in the manifest (`manifest_...`).
        Without additional work, these attributes will be `None`, since they require additional requests and database lookups.

        To fill the manifest dependent attributes, either:

        - Run `await ThisClass.fetch_manifest_information()`, see [here](/API Reference/Models/base)
        - Set `Client.always_return_manifest_information` to `True`, see [here](/API Reference/client)

    Attributes:
        current_progress: This is the total amount of progress obtained overall for this progression (for instance, the total amount of Character Level experience earned)
        current_reset_count: The number of resets of this progression you've executed this season, if applicable to this progression.
        daily_limit: If this progression has a daily limit, this is that limit.
        daily_progress: The amount of progress earned today for this progression.
        level: This is the level of the progression (for instance, the Character Level).
        level_cap: This is the maximum possible level you can achieve for this progression (for example, the maximum character level obtainable)
        next_level_at: The total amount of progression (i.e. "Experience") needed in order to reach the next level.
        progress_to_next_level: The amount of progression (i.e. "Experience") needed to reach the next level of this Progression. Jeez, progression is such an overloaded word.
        progression_hash: The hash identifier of the Progression in question. Use it to look up the DestinyProgressionDefinition in static data.
        reward_item_socket_override_states: Information about items stats and states that have socket overrides, if there is any data for it.
        reward_item_states: Information about historical rewards for this progression, if there is any data for it.
        season_resets: Information about historical resets of this progression, if there is any data for it.
        step_index: Progressions define their levels in "steps". Since the last step may be repeatable, the user may be at a higher level than the actual Step achieved in the progression. Not necessarily useful, but potentially interesting for those cruising the API. Relate this to the "steps" property of the DestinyProgression to see which step the user is on, if you care about that. (Note that this is Content Version dependent since it refers to indexes.)
        weekly_limit: If this progression has a weekly limit, this is that limit.
        weekly_progress: The amount of progress earned toward this progression in the current week.
        manifest_progression_hash: Manifest information for `progression_hash`
    """

    current_progress: int = custom_field()
    current_reset_count: int = custom_field()
    daily_limit: int = custom_field()
    daily_progress: int = custom_field()
    level: int = custom_field()
    level_cap: int = custom_field()
    next_level_at: int = custom_field()
    progress_to_next_level: int = custom_field()
    progression_hash: int = custom_field()
    reward_item_socket_override_states: dict[int, "DestinyProgressionRewardItemSocketOverrideState"] = custom_field(
        metadata={"type": """dict[int, DestinyProgressionRewardItemSocketOverrideState]"""}
    )
    reward_item_states: list[Union["DestinyProgressionRewardItemState", int]] = custom_field(
        converter=enum_converter("DestinyProgressionRewardItemState")
    )
    season_resets: list["DestinyProgressionResetEntry"] = custom_field(
        metadata={"type": """list[DestinyProgressionResetEntry]"""}
    )
    step_index: int = custom_field()
    weekly_limit: int = custom_field()
    weekly_progress: int = custom_field()
    manifest_progression_hash: Optional["DestinyProgressionDefinition"] = custom_field(default=None)

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyProgressionResetEntry

Bases: BaseModel

Represents a season and the number of resets you had in that season. We do not necessarily - even for progressions with resets - track it over all seasons. So be careful and check the season numbers being returned.

None Attributes: resets: No description given by bungie. season: No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
84
85
86
87
88
89
90
91
92
93
94
95
96
@custom_define()
class DestinyProgressionResetEntry(BaseModel):
    """
    Represents a season and the number of resets you had in that season.  We do not necessarily - even for progressions with resets - track it over all seasons. So be careful and check the season numbers being returned.

    None
    Attributes:
        resets: _No description given by bungie._
        season: _No description given by bungie._
    """

    resets: int = custom_field()
    season: int = custom_field()

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyProgressionRewardItemState

Bases: BaseFlagEnum

Represents the different states a progression reward item can be in.

Source code in src/bungio/models/bungie/destiny/__init__.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
class DestinyProgressionRewardItemState(BaseFlagEnum):
    """
    Represents the different states a progression reward item can be in.
    """

    NONE = 0
    """_No description given by bungie._ """
    INVISIBLE = 1
    """If this is set, the reward should be hidden. """
    EARNED = 2
    """If this is set, the reward has been earned. """
    CLAIMED = 4
    """If this is set, the reward has been claimed. """
    CLAIM_ALLOWED = 8
    """If this is set, the reward is allowed to be claimed by this Character. An item can be earned but still can't be claimed in certain circumstances, like if it's only allowed for certain subclasses. It also might not be able to be claimed if you already claimed it! """

CLAIMED = 4 class-attribute instance-attribute

If this is set, the reward has been claimed.

CLAIM_ALLOWED = 8 class-attribute instance-attribute

If this is set, the reward is allowed to be claimed by this Character. An item can be earned but still can't be claimed in certain circumstances, like if it's only allowed for certain subclasses. It also might not be able to be claimed if you already claimed it!

EARNED = 2 class-attribute instance-attribute

If this is set, the reward has been earned.

INVISIBLE = 1 class-attribute instance-attribute

If this is set, the reward should be hidden.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyProgressionRewardItemSocketOverrideState

Bases: BaseModel

Represents the stats and item state if applicable for progression reward items with socket overrides

None Attributes: item_state: Information about the item state, specifically deepsight if there is any data for it reward_item_stats: Information about the computed stats from socket and plug overrides for this progression, if there is any data for it.

Source code in src/bungio/models/bungie/destiny/__init__.py
116
117
118
119
120
121
122
123
124
125
126
127
128
@custom_define()
class DestinyProgressionRewardItemSocketOverrideState(BaseModel):
    """
    Represents the stats and item state if applicable for progression reward items with socket overrides

    None
    Attributes:
        item_state: Information about the item state, specifically deepsight if there is any data for it
        reward_item_stats: Information about the computed stats from socket and plug overrides for this progression, if there is any data for it.
    """

    item_state: Union["ItemState", int] = custom_field(converter=enum_converter("ItemState"))
    reward_item_stats: dict[int, "DestinyStat"] = custom_field(metadata={"type": """dict[int, DestinyStat]"""})

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyStat

Bases: BaseModel

Represents a stat on an item or Character (NOT a Historical Stat, but a physical attribute stat like Attack, Defense etc...)

Manifest Information

This model has some attributes which can be filled with additional information found in the manifest (manifest_...). Without additional work, these attributes will be None, since they require additional requests and database lookups.

To fill the manifest dependent attributes, either:

  • Run await ThisClass.fetch_manifest_information(), see here
  • Set Client.always_return_manifest_information to True, see here

Attributes:

Name Type Description
stat_hash int

The hash identifier for the Stat. Use it to look up the DestinyStatDefinition for static data about the stat.

value int

The current value of the Stat.

manifest_stat_hash Optional[DestinyStatDefinition]

Manifest information for stat_hash

Source code in src/bungio/models/bungie/destiny/__init__.py
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
@custom_define()
class DestinyStat(BaseModel):
    """
    Represents a stat on an item *or* Character (NOT a Historical Stat, but a physical attribute stat like Attack, Defense etc...)

    Tip: Manifest Information
        This model has some attributes which can be filled with additional information found in the manifest (`manifest_...`).
        Without additional work, these attributes will be `None`, since they require additional requests and database lookups.

        To fill the manifest dependent attributes, either:

        - Run `await ThisClass.fetch_manifest_information()`, see [here](/API Reference/Models/base)
        - Set `Client.always_return_manifest_information` to `True`, see [here](/API Reference/client)

    Attributes:
        stat_hash: The hash identifier for the Stat. Use it to look up the DestinyStatDefinition for static data about the stat.
        value: The current value of the Stat.
        manifest_stat_hash: Manifest information for `stat_hash`
    """

    stat_hash: int = custom_field()
    value: int = custom_field()
    manifest_stat_hash: Optional["DestinyStatDefinition"] = custom_field(default=None)

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyStatAggregationType

Bases: BaseEnum

When a Stat (DestinyStatDefinition) is aggregated, this is the rules used for determining the level and formula used for aggregation. * CharacterAverage = apply a weighted average using the related DestinyStatGroupDefinition on the DestinyInventoryItemDefinition across the character's equipped items. See both of those definitions for details. * Character = don't aggregate: the stat should be located and used directly on the character. * Item = don't aggregate: the stat should be located and used directly on the item.

Source code in src/bungio/models/bungie/destiny/__init__.py
156
157
158
159
160
161
162
163
164
165
166
class DestinyStatAggregationType(BaseEnum):
    """
    When a Stat (DestinyStatDefinition) is aggregated, this is the rules used for determining the level and formula used for aggregation. * CharacterAverage = apply a weighted average using the related DestinyStatGroupDefinition on the DestinyInventoryItemDefinition across the character's equipped items. See both of those definitions for details. * Character = don't aggregate: the stat should be located and used directly on the character. * Item = don't aggregate: the stat should be located and used directly on the item.
    """

    CHARACTER_AVERAGE = 0
    """_No description given by bungie._ """
    CHARACTER = 1
    """_No description given by bungie._ """
    ITEM = 2
    """_No description given by bungie._ """

CHARACTER = 1 class-attribute instance-attribute

No description given by bungie.

CHARACTER_AVERAGE = 0 class-attribute instance-attribute

No description given by bungie.

ITEM = 2 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyStatCategory

Bases: BaseEnum

At last, stats have categories. Use this for whatever purpose you might wish.

Source code in src/bungio/models/bungie/destiny/__init__.py
169
170
171
172
173
174
175
176
177
178
179
180
181
class DestinyStatCategory(BaseEnum):
    """
    At last, stats have categories. Use this for whatever purpose you might wish.
    """

    GAMEPLAY = 0
    """_No description given by bungie._ """
    WEAPON = 1
    """_No description given by bungie._ """
    DEFENSE = 2
    """_No description given by bungie._ """
    PRIMARY = 3
    """_No description given by bungie._ """

DEFENSE = 2 class-attribute instance-attribute

No description given by bungie.

GAMEPLAY = 0 class-attribute instance-attribute

No description given by bungie.

PRIMARY = 3 class-attribute instance-attribute

No description given by bungie.

WEAPON = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

ItemState

Bases: BaseFlagEnum

A flags enumeration/bitmask where each bit represents a different possible state that the item can be in that may effect how the item is displayed to the user and what actions can be performed against it.

Source code in src/bungio/models/bungie/destiny/__init__.py
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
class ItemState(BaseFlagEnum):
    """
    A flags enumeration/bitmask where each bit represents a different possible state that the item can be in that may effect how the item is displayed to the user and what actions can be performed against it.
    """

    NONE = 0
    """_No description given by bungie._ """
    LOCKED = 1
    """If this bit is set, the item has been "locked" by the user and cannot be deleted. You may want to represent this visually with a "lock" icon. """
    TRACKED = 2
    """If this bit is set, the item is a quest that's being tracked by the user. You may want a visual indicator to show that this is a tracked quest. """
    MASTERWORK = 4
    """If this bit is set, the item has a Masterwork plug inserted. This usually coincides with having a special "glowing" effect applied to the item's icon. """
    CRAFTED = 8
    """If this bit is set, the item has been 'crafted' by the player. You may want to represent this visually with a "crafted" icon overlay. """
    HIGHLIGHTED_OBJECTIVE = 16
    """If this bit is set, the item has a 'highlighted' objective. You may want to represent this with an orange-red icon border color. """
    ENHANCED = 32
    """If this bit is set, the item has been 'enhanced' by the player. """

CRAFTED = 8 class-attribute instance-attribute

If this bit is set, the item has been 'crafted' by the player. You may want to represent this visually with a "crafted" icon overlay.

ENHANCED = 32 class-attribute instance-attribute

If this bit is set, the item has been 'enhanced' by the player.

HIGHLIGHTED_OBJECTIVE = 16 class-attribute instance-attribute

If this bit is set, the item has a 'highlighted' objective. You may want to represent this with an orange-red icon border color.

LOCKED = 1 class-attribute instance-attribute

If this bit is set, the item has been "locked" by the user and cannot be deleted. You may want to represent this visually with a "lock" icon.

MASTERWORK = 4 class-attribute instance-attribute

If this bit is set, the item has a Masterwork plug inserted. This usually coincides with having a special "glowing" effect applied to the item's icon.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

TRACKED = 2 class-attribute instance-attribute

If this bit is set, the item is a quest that's being tracked by the user. You may want a visual indicator to show that this is a tracked quest.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyProgressionScope

Bases: BaseEnum

There are many Progressions in Destiny (think Character Level, or Reputation). These are the various "Scopes" of Progressions, which affect many things: * Where/if they are stored * How they are calculated * Where they can be used in other game logic

Source code in src/bungio/models/bungie/destiny/__init__.py
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
class DestinyProgressionScope(BaseEnum):
    """
    There are many Progressions in Destiny (think Character Level, or Reputation). These are the various "Scopes" of Progressions, which affect many things: * Where/if they are stored * How they are calculated * Where they can be used in other game logic
    """

    ACCOUNT = 0
    """_No description given by bungie._ """
    CHARACTER = 1
    """_No description given by bungie._ """
    CLAN = 2
    """_No description given by bungie._ """
    ITEM = 3
    """_No description given by bungie._ """
    IMPLICIT_FROM_EQUIPMENT = 4
    """_No description given by bungie._ """
    MAPPED = 5
    """_No description given by bungie._ """
    MAPPED_AGGREGATE = 6
    """_No description given by bungie._ """
    MAPPED_STAT = 7
    """_No description given by bungie._ """
    MAPPED_UNLOCK_VALUE = 8
    """_No description given by bungie._ """

ACCOUNT = 0 class-attribute instance-attribute

No description given by bungie.

CHARACTER = 1 class-attribute instance-attribute

No description given by bungie.

CLAN = 2 class-attribute instance-attribute

No description given by bungie.

IMPLICIT_FROM_EQUIPMENT = 4 class-attribute instance-attribute

No description given by bungie.

ITEM = 3 class-attribute instance-attribute

No description given by bungie.

MAPPED = 5 class-attribute instance-attribute

No description given by bungie.

MAPPED_AGGREGATE = 6 class-attribute instance-attribute

No description given by bungie.

MAPPED_STAT = 7 class-attribute instance-attribute

No description given by bungie.

MAPPED_UNLOCK_VALUE = 8 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyProgressionStepDisplayEffect

Bases: BaseEnum

If progression is earned, this determines whether the progression shows visual effects on the character or its item - or neither.

Source code in src/bungio/models/bungie/destiny/__init__.py
230
231
232
233
234
235
236
237
238
239
240
class DestinyProgressionStepDisplayEffect(BaseEnum):
    """
    If progression is earned, this determines whether the progression shows visual effects on the character or its item - or neither.
    """

    NONE = 0
    """_No description given by bungie._ """
    CHARACTER = 1
    """_No description given by bungie._ """
    ITEM = 2
    """_No description given by bungie._ """

CHARACTER = 1 class-attribute instance-attribute

No description given by bungie.

ITEM = 2 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyItemQuantity

Bases: BaseModel

Used in a number of Destiny contracts to return data about an item stack and its quantity. Can optionally return an itemInstanceId if the item is instanced - in which case, the quantity returned will be 1. If it's not... uh, let me know okay? Thanks.

Manifest Information

This model has some attributes which can be filled with additional information found in the manifest (manifest_...). Without additional work, these attributes will be None, since they require additional requests and database lookups.

To fill the manifest dependent attributes, either:

  • Run await ThisClass.fetch_manifest_information(), see here
  • Set Client.always_return_manifest_information to True, see here

Attributes:

Name Type Description
has_conditional_visibility bool

Indicates that this item quantity may be conditionally shown or hidden, based on various sources of state. For example: server flags, account state, or character progress.

item_hash int

The hash identifier for the item in question. Use it to look up the item's DestinyInventoryItemDefinition.

item_instance_id int

If this quantity is referring to a specific instance of an item, this will have the item's instance ID. Normally, this will be null.

quantity int

The amount of the item needed/available depending on the context of where DestinyItemQuantity is being used.

manifest_item_hash Optional[DestinyInventoryItemDefinition]

Manifest information for item_hash

Source code in src/bungio/models/bungie/destiny/__init__.py
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
@custom_define()
class DestinyItemQuantity(BaseModel):
    """
    Used in a number of Destiny contracts to return data about an item stack and its quantity. Can optionally return an itemInstanceId if the item is instanced - in which case, the quantity returned will be 1. If it's not... uh, let me know okay? Thanks.

    Tip: Manifest Information
        This model has some attributes which can be filled with additional information found in the manifest (`manifest_...`).
        Without additional work, these attributes will be `None`, since they require additional requests and database lookups.

        To fill the manifest dependent attributes, either:

        - Run `await ThisClass.fetch_manifest_information()`, see [here](/API Reference/Models/base)
        - Set `Client.always_return_manifest_information` to `True`, see [here](/API Reference/client)

    Attributes:
        has_conditional_visibility: Indicates that this item quantity may be conditionally shown or hidden, based on various sources of state. For example: server flags, account state, or character progress.
        item_hash: The hash identifier for the item in question. Use it to look up the item's DestinyInventoryItemDefinition.
        item_instance_id: If this quantity is referring to a specific instance of an item, this will have the item's instance ID. Normally, this will be null.
        quantity: The amount of the item needed/available depending on the context of where DestinyItemQuantity is being used.
        manifest_item_hash: Manifest information for `item_hash`
    """

    has_conditional_visibility: bool = custom_field()
    item_hash: int = custom_field()
    item_instance_id: int = custom_field(metadata={"int64": True})
    quantity: int = custom_field()
    manifest_item_hash: Optional["DestinyInventoryItemDefinition"] = custom_field(default=None)

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

SocketTypeActionType

Bases: BaseEnum

Indicates the type of actions that can be performed

Source code in src/bungio/models/bungie/destiny/__init__.py
272
273
274
275
276
277
278
279
280
281
282
class SocketTypeActionType(BaseEnum):
    """
    Indicates the type of actions that can be performed
    """

    INSERT_PLUG = 0
    """_No description given by bungie._ """
    INFUSE_ITEM = 1
    """_No description given by bungie._ """
    REINITIALIZE_SOCKET = 2
    """_No description given by bungie._ """

INFUSE_ITEM = 1 class-attribute instance-attribute

No description given by bungie.

INSERT_PLUG = 0 class-attribute instance-attribute

No description given by bungie.

REINITIALIZE_SOCKET = 2 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinySocketVisibility

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
285
286
287
288
289
290
291
292
293
294
295
296
297
class DestinySocketVisibility(BaseEnum):
    """
    _No description given by bungie._
    """

    VISIBLE = 0
    """_No description given by bungie._ """
    HIDDEN = 1
    """_No description given by bungie._ """
    HIDDEN_WHEN_EMPTY = 2
    """_No description given by bungie._ """
    HIDDEN_IF_NO_PLUGS_AVAILABLE = 3
    """_No description given by bungie._ """

HIDDEN = 1 class-attribute instance-attribute

No description given by bungie.

HIDDEN_IF_NO_PLUGS_AVAILABLE = 3 class-attribute instance-attribute

No description given by bungie.

HIDDEN_WHEN_EMPTY = 2 class-attribute instance-attribute

No description given by bungie.

VISIBLE = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinySocketCategoryStyle

Bases: BaseEnum

Represents the possible and known UI styles used by the game for rendering Socket Categories.

Source code in src/bungio/models/bungie/destiny/__init__.py
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
class DestinySocketCategoryStyle(BaseEnum):
    """
    Represents the possible and known UI styles used by the game for rendering Socket Categories.
    """

    UNKNOWN = 0
    """_No description given by bungie._ """
    REUSABLE = 1
    """_No description given by bungie._ """
    CONSUMABLE = 2
    """_No description given by bungie._ """
    UNLOCKABLE = 3
    """_No description given by bungie._ """
    INTRINSIC = 4
    """_No description given by bungie._ """
    ENERGY_METER = 5
    """_No description given by bungie._ """
    LARGE_PERK = 6
    """_No description given by bungie._ """
    ABILITIES = 7
    """_No description given by bungie._ """
    SUPERS = 8
    """_No description given by bungie._ """

ABILITIES = 7 class-attribute instance-attribute

No description given by bungie.

CONSUMABLE = 2 class-attribute instance-attribute

No description given by bungie.

ENERGY_METER = 5 class-attribute instance-attribute

No description given by bungie.

INTRINSIC = 4 class-attribute instance-attribute

No description given by bungie.

LARGE_PERK = 6 class-attribute instance-attribute

No description given by bungie.

REUSABLE = 1 class-attribute instance-attribute

No description given by bungie.

SUPERS = 8 class-attribute instance-attribute

No description given by bungie.

UNKNOWN = 0 class-attribute instance-attribute

No description given by bungie.

UNLOCKABLE = 3 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

TierType

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
class TierType(BaseEnum):
    """
    _No description given by bungie._
    """

    UNKNOWN = 0
    """_No description given by bungie._ """
    CURRENCY = 1
    """_No description given by bungie._ """
    BASIC = 2
    """_No description given by bungie._ """
    COMMON = 3
    """_No description given by bungie._ """
    RARE = 4
    """_No description given by bungie._ """
    SUPERIOR = 5
    """_No description given by bungie._ """
    EXOTIC = 6
    """_No description given by bungie._ """

BASIC = 2 class-attribute instance-attribute

No description given by bungie.

COMMON = 3 class-attribute instance-attribute

No description given by bungie.

CURRENCY = 1 class-attribute instance-attribute

No description given by bungie.

EXOTIC = 6 class-attribute instance-attribute

No description given by bungie.

RARE = 4 class-attribute instance-attribute

No description given by bungie.

SUPERIOR = 5 class-attribute instance-attribute

No description given by bungie.

UNKNOWN = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

BucketScope

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
346
347
348
349
350
351
352
353
354
class BucketScope(BaseEnum):
    """
    _No description given by bungie._
    """

    CHARACTER = 0
    """_No description given by bungie._ """
    ACCOUNT = 1
    """_No description given by bungie._ """

ACCOUNT = 1 class-attribute instance-attribute

No description given by bungie.

CHARACTER = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

BucketCategory

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
class BucketCategory(BaseEnum):
    """
    _No description given by bungie._
    """

    INVISIBLE = 0
    """_No description given by bungie._ """
    ITEM = 1
    """_No description given by bungie._ """
    CURRENCY = 2
    """_No description given by bungie._ """
    EQUIPPABLE = 3
    """_No description given by bungie._ """
    IGNORED = 4
    """_No description given by bungie._ """

CURRENCY = 2 class-attribute instance-attribute

No description given by bungie.

EQUIPPABLE = 3 class-attribute instance-attribute

No description given by bungie.

IGNORED = 4 class-attribute instance-attribute

No description given by bungie.

INVISIBLE = 0 class-attribute instance-attribute

No description given by bungie.

ITEM = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

ItemLocation

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
class ItemLocation(BaseEnum):
    """
    _No description given by bungie._
    """

    UNKNOWN = 0
    """_No description given by bungie._ """
    INVENTORY = 1
    """_No description given by bungie._ """
    VAULT = 2
    """_No description given by bungie._ """
    VENDOR = 3
    """_No description given by bungie._ """
    POSTMASTER = 4
    """_No description given by bungie._ """

INVENTORY = 1 class-attribute instance-attribute

No description given by bungie.

POSTMASTER = 4 class-attribute instance-attribute

No description given by bungie.

UNKNOWN = 0 class-attribute instance-attribute

No description given by bungie.

VAULT = 2 class-attribute instance-attribute

No description given by bungie.

VENDOR = 3 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

EquippingItemBlockAttributes

Bases: BaseFlagEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
391
392
393
394
395
396
397
398
399
class EquippingItemBlockAttributes(BaseFlagEnum):
    """
    _No description given by bungie._
    """

    NONE = 0
    """_No description given by bungie._ """
    EQUIP_ON_ACQUIRE = 1
    """_No description given by bungie._ """

EQUIP_ON_ACQUIRE = 1 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyAmmunitionType

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
class DestinyAmmunitionType(BaseEnum):
    """
    _No description given by bungie._
    """

    NONE = 0
    """_No description given by bungie._ """
    PRIMARY = 1
    """_No description given by bungie._ """
    SPECIAL = 2
    """_No description given by bungie._ """
    HEAVY = 3
    """_No description given by bungie._ """
    UNKNOWN = 4
    """_No description given by bungie._ """

HEAVY = 3 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

PRIMARY = 1 class-attribute instance-attribute

No description given by bungie.

SPECIAL = 2 class-attribute instance-attribute

No description given by bungie.

UNKNOWN = 4 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DamageType

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
class DamageType(BaseEnum):
    """
    _No description given by bungie._
    """

    NONE = 0
    """_No description given by bungie._ """
    KINETIC = 1
    """_No description given by bungie._ """
    ARC = 2
    """_No description given by bungie._ """
    THERMAL = 3
    """_No description given by bungie._ """
    VOID = 4
    """_No description given by bungie._ """
    RAID = 5
    """_No description given by bungie._ """
    STASIS = 6
    """_No description given by bungie._ """
    STRAND = 7
    """_No description given by bungie._ """

ARC = 2 class-attribute instance-attribute

No description given by bungie.

KINETIC = 1 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

RAID = 5 class-attribute instance-attribute

No description given by bungie.

STASIS = 6 class-attribute instance-attribute

No description given by bungie.

STRAND = 7 class-attribute instance-attribute

No description given by bungie.

THERMAL = 3 class-attribute instance-attribute

No description given by bungie.

VOID = 4 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DyeReference

Bases: BaseModel

No description given by bungie.

None Attributes: channel_hash: No description given by bungie. dye_hash: No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
442
443
444
445
446
447
448
449
450
451
452
453
454
@custom_define()
class DyeReference(BaseModel):
    """
    _No description given by bungie._

    None
    Attributes:
        channel_hash: _No description given by bungie._
        dye_hash: _No description given by bungie._
    """

    channel_hash: int = custom_field()
    dye_hash: int = custom_field()

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyClass

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
457
458
459
460
461
462
463
464
465
466
467
468
469
class DestinyClass(BaseEnum):
    """
    _No description given by bungie._
    """

    TITAN = 0
    """_No description given by bungie._ """
    HUNTER = 1
    """_No description given by bungie._ """
    WARLOCK = 2
    """_No description given by bungie._ """
    UNKNOWN = 3
    """_No description given by bungie._ """

HUNTER = 1 class-attribute instance-attribute

No description given by bungie.

TITAN = 0 class-attribute instance-attribute

No description given by bungie.

UNKNOWN = 3 class-attribute instance-attribute

No description given by bungie.

WARLOCK = 2 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyGender

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
472
473
474
475
476
477
478
479
480
481
482
class DestinyGender(BaseEnum):
    """
    _No description given by bungie._
    """

    MALE = 0
    """_No description given by bungie._ """
    FEMALE = 1
    """_No description given by bungie._ """
    UNKNOWN = 2
    """_No description given by bungie._ """

FEMALE = 1 class-attribute instance-attribute

No description given by bungie.

MALE = 0 class-attribute instance-attribute

No description given by bungie.

UNKNOWN = 2 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyVendorProgressionType

Bases: BaseEnum

Describes the type of progression that a vendor has.

Source code in src/bungio/models/bungie/destiny/__init__.py
485
486
487
488
489
490
491
492
493
494
495
class DestinyVendorProgressionType(BaseEnum):
    """
    Describes the type of progression that a vendor has.
    """

    DEFAULT = 0
    """The original rank progression from token redemption. """
    RITUAL = 1
    """Progression from ranks in ritual content. For example: Crucible (Shaxx), Gambit (Drifter), and Season 13 Battlegrounds (War Table). """
    NO_SEASONAL_REFRESH = 2
    """A vendor progression with no seasonal refresh. For example: Xur in the Eternity destination for the 30th Anniversary. """

DEFAULT = 0 class-attribute instance-attribute

The original rank progression from token redemption.

NO_SEASONAL_REFRESH = 2 class-attribute instance-attribute

A vendor progression with no seasonal refresh. For example: Xur in the Eternity destination for the 30th Anniversary.

RITUAL = 1 class-attribute instance-attribute

Progression from ranks in ritual content. For example: Crucible (Shaxx), Gambit (Drifter), and Season 13 Battlegrounds (War Table).

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

VendorDisplayCategorySortOrder

Bases: BaseEnum

Display categories can have custom sort orders. These are the possible options.

Source code in src/bungio/models/bungie/destiny/__init__.py
498
499
500
501
502
503
504
505
506
class VendorDisplayCategorySortOrder(BaseEnum):
    """
    Display categories can have custom sort orders. These are the possible options.
    """

    DEFAULT = 0
    """_No description given by bungie._ """
    SORT_BY_TIER = 1
    """_No description given by bungie._ """

DEFAULT = 0 class-attribute instance-attribute

No description given by bungie.

SORT_BY_TIER = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyVendorInteractionRewardSelection

Bases: BaseEnum

When a Vendor Interaction provides rewards, they'll either let you choose one or let you have all of them. This determines which it will be.

Source code in src/bungio/models/bungie/destiny/__init__.py
509
510
511
512
513
514
515
516
517
518
519
class DestinyVendorInteractionRewardSelection(BaseEnum):
    """
    When a Vendor Interaction provides rewards, they'll either let you choose one or let you have all of them. This determines which it will be.
    """

    NONE = 0
    """_No description given by bungie._ """
    ONE = 1
    """_No description given by bungie._ """
    ALL = 2
    """_No description given by bungie._ """

ALL = 2 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

ONE = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyVendorReplyType

Bases: BaseEnum

This determines the type of reply that a Vendor will have during an Interaction.

Source code in src/bungio/models/bungie/destiny/__init__.py
522
523
524
525
526
527
528
529
530
531
532
class DestinyVendorReplyType(BaseEnum):
    """
    This determines the type of reply that a Vendor will have during an Interaction.
    """

    ACCEPT = 0
    """_No description given by bungie._ """
    DECLINE = 1
    """_No description given by bungie._ """
    COMPLETE = 2
    """_No description given by bungie._ """

ACCEPT = 0 class-attribute instance-attribute

No description given by bungie.

COMPLETE = 2 class-attribute instance-attribute

No description given by bungie.

DECLINE = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

VendorInteractionType

Bases: BaseEnum

An enumeration of the known UI interactions for Vendors.

Source code in src/bungio/models/bungie/destiny/__init__.py
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
class VendorInteractionType(BaseEnum):
    """
    An enumeration of the known UI interactions for Vendors.
    """

    UNKNOWN = 0
    """_No description given by bungie._ """
    UNDEFINED = 1
    """An empty interaction. If this ends up in content, it is probably a game bug. """
    QUEST_COMPLETE = 2
    """An interaction shown when you complete a quest and receive a reward. """
    QUEST_CONTINUE = 3
    """An interaction shown when you talk to a Vendor as an intermediary step of a quest. """
    REPUTATION_PREVIEW = 4
    """An interaction shown when you are previewing the vendor's reputation rewards. """
    RANK_UP_REWARD = 5
    """An interaction shown when you rank up with the vendor. """
    TOKEN_TURN_IN = 6
    """An interaction shown when you have tokens to turn in for the vendor. """
    QUEST_ACCEPT = 7
    """An interaction shown when you're accepting a new quest. """
    PROGRESS_TAB = 8
    """Honestly, this doesn't seem consistent to me. It is used to give you choices in the Cryptarch as well as some reward prompts by the Eververse vendor. I'll have to look into that further at some point. """
    END = 9
    """These seem even less consistent. I don't know what these are. """
    START = 10
    """Also seem inconsistent. I also don't know what these are offhand. """

END = 9 class-attribute instance-attribute

These seem even less consistent. I don't know what these are.

PROGRESS_TAB = 8 class-attribute instance-attribute

Honestly, this doesn't seem consistent to me. It is used to give you choices in the Cryptarch as well as some reward prompts by the Eververse vendor. I'll have to look into that further at some point.

QUEST_ACCEPT = 7 class-attribute instance-attribute

An interaction shown when you're accepting a new quest.

QUEST_COMPLETE = 2 class-attribute instance-attribute

An interaction shown when you complete a quest and receive a reward.

QUEST_CONTINUE = 3 class-attribute instance-attribute

An interaction shown when you talk to a Vendor as an intermediary step of a quest.

RANK_UP_REWARD = 5 class-attribute instance-attribute

An interaction shown when you rank up with the vendor.

REPUTATION_PREVIEW = 4 class-attribute instance-attribute

An interaction shown when you are previewing the vendor's reputation rewards.

START = 10 class-attribute instance-attribute

Also seem inconsistent. I also don't know what these are offhand.

TOKEN_TURN_IN = 6 class-attribute instance-attribute

An interaction shown when you have tokens to turn in for the vendor.

UNDEFINED = 1 class-attribute instance-attribute

An empty interaction. If this ends up in content, it is probably a game bug.

UNKNOWN = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyItemSortType

Bases: BaseEnum

Determines how items are sorted in an inventory bucket.

Source code in src/bungio/models/bungie/destiny/__init__.py
564
565
566
567
568
569
570
571
572
573
574
class DestinyItemSortType(BaseEnum):
    """
    Determines how items are sorted in an inventory bucket.
    """

    ITEM_ID = 0
    """_No description given by bungie._ """
    TIMESTAMP = 1
    """_No description given by bungie._ """
    STACK_SIZE = 2
    """_No description given by bungie._ """

ITEM_ID = 0 class-attribute instance-attribute

No description given by bungie.

STACK_SIZE = 2 class-attribute instance-attribute

No description given by bungie.

TIMESTAMP = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyVendorItemRefundPolicy

Bases: BaseEnum

The action that happens when the user attempts to refund an item.

Source code in src/bungio/models/bungie/destiny/__init__.py
577
578
579
580
581
582
583
584
585
586
587
class DestinyVendorItemRefundPolicy(BaseEnum):
    """
    The action that happens when the user attempts to refund an item.
    """

    NOT_REFUNDABLE = 0
    """_No description given by bungie._ """
    DELETES_ITEM = 1
    """_No description given by bungie._ """
    REVOKES_LICENSE = 2
    """_No description given by bungie._ """

DELETES_ITEM = 1 class-attribute instance-attribute

No description given by bungie.

NOT_REFUNDABLE = 0 class-attribute instance-attribute

No description given by bungie.

REVOKES_LICENSE = 2 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyGatingScope

Bases: BaseEnum

This enumeration represents the most restrictive type of gating that is being performed by an entity. This is useful as a shortcut to avoid a lot of lookups when determining whether the gating on an Entity applies to everyone equally, or to their specific Profile or Character states. None = There is no gating on this item. Global = The gating on this item is based entirely on global game state. It will be gated the same for everyone. Clan = The gating on this item is at the Clan level. For instance, if you're gated by Clan level this will be the case. Profile = The gating includes Profile-specific checks, but not on the Profile's characters. An example of this might be when you acquire an Emblem: the Emblem will be available in your Kiosk for all characters in your Profile from that point onward. Character = The gating includes Character-specific checks, including character level restrictions. An example of this might be an item that you can't purchase from a Vendor until you reach a specific Character Level. Item = The gating includes item-specific checks. For BNet, this generally implies that we'll show this data only on a character level or deeper. AssumedWorstCase = The unlocks and checks being used for this calculation are of an unknown type and are used for unknown purposes. For instance, if some great person decided that an unlock value should be globally scoped, but then the game changes it using character-specific data in a way that BNet doesn't know about. Because of the open-ended potential for this to occur, many unlock checks for "globally" scoped unlock data may be assumed as the worst case unless it has been specifically whitelisted as otherwise. That sucks, but them's the breaks.

Source code in src/bungio/models/bungie/destiny/__init__.py
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
class DestinyGatingScope(BaseEnum):
    """
    This enumeration represents the most restrictive type of gating that is being performed by an entity. This is useful as a shortcut to avoid a lot of lookups when determining whether the gating on an Entity applies to everyone equally, or to their specific Profile or Character states. None = There is no gating on this item. Global = The gating on this item is based entirely on global game state. It will be gated the same for everyone. Clan = The gating on this item is at the Clan level. For instance, if you're gated by Clan level this will be the case. Profile = The gating includes Profile-specific checks, but not on the Profile's characters. An example of this might be when you acquire an Emblem: the Emblem will be available in your Kiosk for all characters in your Profile from that point onward. Character = The gating includes Character-specific checks, including character level restrictions. An example of this might be an item that you can't purchase from a Vendor until you reach a specific Character Level. Item = The gating includes item-specific checks. For BNet, this generally implies that we'll show this data only on a character level or deeper. AssumedWorstCase = The unlocks and checks being used for this calculation are of an unknown type and are used for unknown purposes. For instance, if some great person decided that an unlock value should be globally scoped, but then the game changes it using character-specific data in a way that BNet doesn't know about. Because of the open-ended potential for this to occur, many unlock checks for "globally" scoped unlock data may be assumed as the worst case unless it has been specifically whitelisted as otherwise. That sucks, but them's the breaks.
    """

    NONE = 0
    """_No description given by bungie._ """
    GLOBAL = 1
    """_No description given by bungie._ """
    CLAN = 2
    """_No description given by bungie._ """
    PROFILE = 3
    """_No description given by bungie._ """
    CHARACTER = 4
    """_No description given by bungie._ """
    ITEM = 5
    """_No description given by bungie._ """
    ASSUMED_WORST_CASE = 6
    """_No description given by bungie._ """

ASSUMED_WORST_CASE = 6 class-attribute instance-attribute

No description given by bungie.

CHARACTER = 4 class-attribute instance-attribute

No description given by bungie.

CLAN = 2 class-attribute instance-attribute

No description given by bungie.

GLOBAL = 1 class-attribute instance-attribute

No description given by bungie.

ITEM = 5 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

PROFILE = 3 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

ActivityGraphNodeHighlightType

Bases: BaseEnum

The various known UI styles in which an item can be highlighted. It'll be up to you to determine what you want to show based on this highlighting, BNet doesn't have any assets that correspond to these states. And yeah, RiseOfIron and Comet have their own special highlight states. Don't ask me, I can't imagine they're still used.

Source code in src/bungio/models/bungie/destiny/__init__.py
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
class ActivityGraphNodeHighlightType(BaseEnum):
    """
    The various known UI styles in which an item can be highlighted. It'll be up to you to determine what you want to show based on this highlighting, BNet doesn't have any assets that correspond to these states. And yeah, RiseOfIron and Comet have their own special highlight states. Don't ask me, I can't imagine they're still used.
    """

    NONE = 0
    """_No description given by bungie._ """
    NORMAL = 1
    """_No description given by bungie._ """
    HYPER = 2
    """_No description given by bungie._ """
    COMET = 3
    """_No description given by bungie._ """
    RISE_OF_IRON = 4
    """_No description given by bungie._ """

COMET = 3 class-attribute instance-attribute

No description given by bungie.

HYPER = 2 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

NORMAL = 1 class-attribute instance-attribute

No description given by bungie.

RISE_OF_IRON = 4 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyUnlockValueUIStyle

Bases: BaseEnum

If you're showing an unlock value in the UI, this is the format in which it should be shown. You'll have to build your own algorithms on the client side to determine how best to render these options.

Source code in src/bungio/models/bungie/destiny/__init__.py
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
class DestinyUnlockValueUIStyle(BaseEnum):
    """
    If you're showing an unlock value in the UI, this is the format in which it should be shown. You'll have to build your own algorithms on the client side to determine how best to render these options.
    """

    AUTOMATIC = 0
    """Generally, Automatic means "Just show the number" """
    FRACTION = 1
    """Show the number as a fractional value. For this to make sense, the value being displayed should have a comparable upper bound, like the progress to the next level of a Progression. """
    CHECKBOX = 2
    """Show the number as a checkbox. 0 Will mean unchecked, any other value will mean checked. """
    PERCENTAGE = 3
    """Show the number as a percentage. For this to make sense, the value being displayed should have a comparable upper bound, like the progress to the next level of a Progression. """
    DATE_TIME = 4
    """Show the number as a date and time. The number will be the number of seconds since the Unix Epoch (January 1st, 1970 at midnight UTC). It'll be up to you to convert this into a date and time format understandable to the user in their time zone. """
    FRACTION_FLOAT = 5
    """Show the number as a floating point value that represents a fraction, where 0 is min and 1 is max. For this to make sense, the value being displayed should have a comparable upper bound, like the progress to the next level of a Progression. """
    INTEGER = 6
    """Show the number as a straight-up integer. """
    TIME_DURATION = 7
    """Show the number as a time duration. The value will be returned as seconds. """
    HIDDEN = 8
    """Don't bother showing the value at all, it's not easily human-interpretable, and used for some internal purpose. """
    MULTIPLIER = 9
    """Example: "1.5x" """
    GREEN_PIPS = 10
    """Show the value as a series of green pips, like the wins in a Trials of Osiris score card. """
    RED_PIPS = 11
    """Show the value as a series of red pips, like the losses in a Trials of Osiris score card. """
    EXPLICIT_PERCENTAGE = 12
    """Show the value as a percentage. For example: "51%" - Does no division, only appends '%' """
    RAW_FLOAT = 13
    """Show the value as a floating-point number. For example: "4.52" NOTE: Passed along from Investment as whole number with last two digits as decimal values (452 -> 4.52) """
    LEVEL_AND_REWARD = 14
    """Show the value as a level and a reward. """

AUTOMATIC = 0 class-attribute instance-attribute

Generally, Automatic means "Just show the number"

CHECKBOX = 2 class-attribute instance-attribute

Show the number as a checkbox. 0 Will mean unchecked, any other value will mean checked.

DATE_TIME = 4 class-attribute instance-attribute

Show the number as a date and time. The number will be the number of seconds since the Unix Epoch (January 1st, 1970 at midnight UTC). It'll be up to you to convert this into a date and time format understandable to the user in their time zone.

EXPLICIT_PERCENTAGE = 12 class-attribute instance-attribute

Show the value as a percentage. For example: "51%" - Does no division, only appends '%'

FRACTION = 1 class-attribute instance-attribute

Show the number as a fractional value. For this to make sense, the value being displayed should have a comparable upper bound, like the progress to the next level of a Progression.

FRACTION_FLOAT = 5 class-attribute instance-attribute

Show the number as a floating point value that represents a fraction, where 0 is min and 1 is max. For this to make sense, the value being displayed should have a comparable upper bound, like the progress to the next level of a Progression.

GREEN_PIPS = 10 class-attribute instance-attribute

Show the value as a series of green pips, like the wins in a Trials of Osiris score card.

HIDDEN = 8 class-attribute instance-attribute

Don't bother showing the value at all, it's not easily human-interpretable, and used for some internal purpose.

INTEGER = 6 class-attribute instance-attribute

Show the number as a straight-up integer.

LEVEL_AND_REWARD = 14 class-attribute instance-attribute

Show the value as a level and a reward.

MULTIPLIER = 9 class-attribute instance-attribute

Example: "1.5x"

PERCENTAGE = 3 class-attribute instance-attribute

Show the number as a percentage. For this to make sense, the value being displayed should have a comparable upper bound, like the progress to the next level of a Progression.

RAW_FLOAT = 13 class-attribute instance-attribute

Show the value as a floating-point number. For example: "4.52" NOTE: Passed along from Investment as whole number with last two digits as decimal values (452 -> 4.52)

RED_PIPS = 11 class-attribute instance-attribute

Show the value as a series of red pips, like the losses in a Trials of Osiris score card.

TIME_DURATION = 7 class-attribute instance-attribute

Show the number as a time duration. The value will be returned as seconds.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyObjectiveGrantStyle

Bases: BaseEnum

Some Objectives provide perks, generally as part of providing some kind of interesting modifier for a Challenge or Quest. This indicates when the Perk is granted.

Source code in src/bungio/models/bungie/destiny/__init__.py
665
666
667
668
669
670
671
672
673
674
675
class DestinyObjectiveGrantStyle(BaseEnum):
    """
    Some Objectives provide perks, generally as part of providing some kind of interesting modifier for a Challenge or Quest. This indicates when the Perk is granted.
    """

    WHEN_INCOMPLETE = 0
    """_No description given by bungie._ """
    WHEN_COMPLETE = 1
    """_No description given by bungie._ """
    ALWAYS = 2
    """_No description given by bungie._ """

ALWAYS = 2 class-attribute instance-attribute

No description given by bungie.

WHEN_COMPLETE = 1 class-attribute instance-attribute

No description given by bungie.

WHEN_INCOMPLETE = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyObjectiveUiStyle

Bases: BaseEnum

If the objective has a known UI label, this enumeration will represent it.

Source code in src/bungio/models/bungie/destiny/__init__.py
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
class DestinyObjectiveUiStyle(BaseEnum):
    """
    If the objective has a known UI label, this enumeration will represent it.
    """

    NONE = 0
    """_No description given by bungie._ """
    HIGHLIGHTED = 1
    """_No description given by bungie._ """
    CRAFTING_WEAPON_LEVEL = 2
    """_No description given by bungie._ """
    CRAFTING_WEAPON_LEVEL_PROGRESS = 3
    """_No description given by bungie._ """
    CRAFTING_WEAPON_TIMESTAMP = 4
    """_No description given by bungie._ """
    CRAFTING_MEMENTOS = 5
    """_No description given by bungie._ """
    CRAFTING_MEMENTO_TITLE = 6
    """_No description given by bungie._ """
    DISCOVERABLE_MYSTERY0 = 7
    """_No description given by bungie._ """
    DISCOVERABLE_MYSTERY1 = 8
    """_No description given by bungie._ """
    DISCOVERABLE_MYSTERY2 = 9
    """_No description given by bungie._ """
    DISCOVERABLE_MYSTERY3 = 10
    """_No description given by bungie._ """
    DISCOVERABLE_MYSTERY4 = 11
    """_No description given by bungie._ """
    DISCOVERABLE_EXOTIC = 12
    """_No description given by bungie._ """

CRAFTING_MEMENTOS = 5 class-attribute instance-attribute

No description given by bungie.

CRAFTING_MEMENTO_TITLE = 6 class-attribute instance-attribute

No description given by bungie.

CRAFTING_WEAPON_LEVEL = 2 class-attribute instance-attribute

No description given by bungie.

CRAFTING_WEAPON_LEVEL_PROGRESS = 3 class-attribute instance-attribute

No description given by bungie.

CRAFTING_WEAPON_TIMESTAMP = 4 class-attribute instance-attribute

No description given by bungie.

DISCOVERABLE_EXOTIC = 12 class-attribute instance-attribute

No description given by bungie.

DISCOVERABLE_MYSTERY0 = 7 class-attribute instance-attribute

No description given by bungie.

DISCOVERABLE_MYSTERY1 = 8 class-attribute instance-attribute

No description given by bungie.

DISCOVERABLE_MYSTERY2 = 9 class-attribute instance-attribute

No description given by bungie.

DISCOVERABLE_MYSTERY3 = 10 class-attribute instance-attribute

No description given by bungie.

DISCOVERABLE_MYSTERY4 = 11 class-attribute instance-attribute

No description given by bungie.

HIGHLIGHTED = 1 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyActivityNavPointType

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
class DestinyActivityNavPointType(BaseEnum):
    """
    _No description given by bungie._
    """

    INACTIVE = 0
    """_No description given by bungie._ """
    PRIMARY_OBJECTIVE = 1
    """_No description given by bungie._ """
    SECONDARY_OBJECTIVE = 2
    """_No description given by bungie._ """
    TRAVEL_OBJECTIVE = 3
    """_No description given by bungie._ """
    PUBLIC_EVENT_OBJECTIVE = 4
    """_No description given by bungie._ """
    AMMO_CACHE = 5
    """_No description given by bungie._ """
    POINT_TYPE_FLAG = 6
    """_No description given by bungie._ """
    CAPTURE_POINT = 7
    """_No description given by bungie._ """
    DEFENSIVE_ENCOUNTER = 8
    """_No description given by bungie._ """
    GHOST_INTERACTION = 9
    """_No description given by bungie._ """
    KILL_AI = 10
    """_No description given by bungie._ """
    QUEST_ITEM = 11
    """_No description given by bungie._ """
    PATROL_MISSION = 12
    """_No description given by bungie._ """
    INCOMING = 13
    """_No description given by bungie._ """
    ARENA_OBJECTIVE = 14
    """_No description given by bungie._ """
    AUTOMATION_HINT = 15
    """_No description given by bungie._ """
    TRACKED_QUEST = 16
    """_No description given by bungie._ """

AMMO_CACHE = 5 class-attribute instance-attribute

No description given by bungie.

ARENA_OBJECTIVE = 14 class-attribute instance-attribute

No description given by bungie.

AUTOMATION_HINT = 15 class-attribute instance-attribute

No description given by bungie.

CAPTURE_POINT = 7 class-attribute instance-attribute

No description given by bungie.

DEFENSIVE_ENCOUNTER = 8 class-attribute instance-attribute

No description given by bungie.

GHOST_INTERACTION = 9 class-attribute instance-attribute

No description given by bungie.

INACTIVE = 0 class-attribute instance-attribute

No description given by bungie.

INCOMING = 13 class-attribute instance-attribute

No description given by bungie.

KILL_AI = 10 class-attribute instance-attribute

No description given by bungie.

PATROL_MISSION = 12 class-attribute instance-attribute

No description given by bungie.

POINT_TYPE_FLAG = 6 class-attribute instance-attribute

No description given by bungie.

PRIMARY_OBJECTIVE = 1 class-attribute instance-attribute

No description given by bungie.

PUBLIC_EVENT_OBJECTIVE = 4 class-attribute instance-attribute

No description given by bungie.

QUEST_ITEM = 11 class-attribute instance-attribute

No description given by bungie.

SECONDARY_OBJECTIVE = 2 class-attribute instance-attribute

No description given by bungie.

TRACKED_QUEST = 16 class-attribute instance-attribute

No description given by bungie.

TRAVEL_OBJECTIVE = 3 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyActivityModeCategory

Bases: BaseEnum

Activity Modes are grouped into a few possible broad categories.

Source code in src/bungio/models/bungie/destiny/__init__.py
752
753
754
755
756
757
758
759
760
761
762
763
764
class DestinyActivityModeCategory(BaseEnum):
    """
    Activity Modes are grouped into a few possible broad categories.
    """

    NONE = 0
    """Activities that are neither PVP nor PVE, such as social activities. """
    PV_E = 1
    """PvE activities, where you shoot aliens in the face. """
    PV_P = 2
    """PvP activities, where you shoot your "friends". """
    PV_E_COMPETITIVE = 3
    """PVE competitive activities, where you shoot whoever you want whenever you want. Or run around collecting small glowing triangles. """

NONE = 0 class-attribute instance-attribute

Activities that are neither PVP nor PVE, such as social activities.

PV_E = 1 class-attribute instance-attribute

PvE activities, where you shoot aliens in the face.

PV_E_COMPETITIVE = 3 class-attribute instance-attribute

PVE competitive activities, where you shoot whoever you want whenever you want. Or run around collecting small glowing triangles.

PV_P = 2 class-attribute instance-attribute

PvP activities, where you shoot your "friends".

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyItemSubType

Bases: BaseEnum

This Enumeration further classifies items by more specific categorizations than DestinyItemType. The "Sub-Type" is where we classify and categorize items one step further in specificity: "Auto Rifle" instead of just "Weapon" for example, or "Vanguard Bounty" instead of merely "Bounty". These sub-types are provided for historical compatibility with Destiny 1, but an ideal alternative is to use DestinyItemCategoryDefinitions and the DestinyItemDefinition.itemCategories property instead. Item Categories allow for arbitrary hierarchies of specificity, and for items to belong to multiple categories across multiple hierarchies simultaneously. For this enum, we pick a single type as a "best guess" fit. NOTE: This is not all of the item types available, and some of these are holdovers from Destiny 1 that may or may not still exist.

Source code in src/bungio/models/bungie/destiny/__init__.py
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
class DestinyItemSubType(BaseEnum):
    """
    This Enumeration further classifies items by more specific categorizations than DestinyItemType. The "Sub-Type" is where we classify and categorize items one step further in specificity: "Auto Rifle" instead of just "Weapon" for example, or "Vanguard Bounty" instead of merely "Bounty". These sub-types are provided for historical compatibility with Destiny 1, but an ideal alternative is to use DestinyItemCategoryDefinitions and the DestinyItemDefinition.itemCategories property instead. Item Categories allow for arbitrary hierarchies of specificity, and for items to belong to multiple categories across multiple hierarchies simultaneously. For this enum, we pick a single type as a "best guess" fit. NOTE: This is not all of the item types available, and some of these are holdovers from Destiny 1 that may or may not still exist.
    """

    NONE = 0
    """_No description given by bungie._ """
    CRUCIBLE = 1
    """DEPRECATED. Items can be both "Crucible" and something else interesting. """
    VANGUARD = 2
    """DEPRECATED. An item can both be "Vanguard" and something else. """
    EXOTIC = 5
    """DEPRECATED. An item can both be Exotic and something else. """
    AUTO_RIFLE = 6
    """_No description given by bungie._ """
    SHOTGUN = 7
    """_No description given by bungie._ """
    MACHINEGUN = 8
    """_No description given by bungie._ """
    HAND_CANNON = 9
    """_No description given by bungie._ """
    ROCKET_LAUNCHER = 10
    """_No description given by bungie._ """
    FUSION_RIFLE = 11
    """_No description given by bungie._ """
    SNIPER_RIFLE = 12
    """_No description given by bungie._ """
    PULSE_RIFLE = 13
    """_No description given by bungie._ """
    SCOUT_RIFLE = 14
    """_No description given by bungie._ """
    CRM = 16
    """DEPRECATED. An item can both be CRM and something else. """
    SIDEARM = 17
    """_No description given by bungie._ """
    SWORD = 18
    """_No description given by bungie._ """
    MASK = 19
    """_No description given by bungie._ """
    SHADER = 20
    """_No description given by bungie._ """
    ORNAMENT = 21
    """_No description given by bungie._ """
    FUSION_RIFLE_LINE = 22
    """_No description given by bungie._ """
    GRENADE_LAUNCHER = 23
    """_No description given by bungie._ """
    SUBMACHINE_GUN = 24
    """_No description given by bungie._ """
    TRACE_RIFLE = 25
    """_No description given by bungie._ """
    HELMET_ARMOR = 26
    """_No description given by bungie._ """
    GAUNTLETS_ARMOR = 27
    """_No description given by bungie._ """
    CHEST_ARMOR = 28
    """_No description given by bungie._ """
    LEG_ARMOR = 29
    """_No description given by bungie._ """
    CLASS_ARMOR = 30
    """_No description given by bungie._ """
    BOW = 31
    """_No description given by bungie._ """
    DUMMY_REPEATABLE_BOUNTY = 32
    """_No description given by bungie._ """
    GLAIVE = 33
    """_No description given by bungie._ """

AUTO_RIFLE = 6 class-attribute instance-attribute

No description given by bungie.

BOW = 31 class-attribute instance-attribute

No description given by bungie.

CHEST_ARMOR = 28 class-attribute instance-attribute

No description given by bungie.

CLASS_ARMOR = 30 class-attribute instance-attribute

No description given by bungie.

CRM = 16 class-attribute instance-attribute

DEPRECATED. An item can both be CRM and something else.

CRUCIBLE = 1 class-attribute instance-attribute

DEPRECATED. Items can be both "Crucible" and something else interesting.

DUMMY_REPEATABLE_BOUNTY = 32 class-attribute instance-attribute

No description given by bungie.

EXOTIC = 5 class-attribute instance-attribute

DEPRECATED. An item can both be Exotic and something else.

FUSION_RIFLE = 11 class-attribute instance-attribute

No description given by bungie.

FUSION_RIFLE_LINE = 22 class-attribute instance-attribute

No description given by bungie.

GAUNTLETS_ARMOR = 27 class-attribute instance-attribute

No description given by bungie.

GLAIVE = 33 class-attribute instance-attribute

No description given by bungie.

GRENADE_LAUNCHER = 23 class-attribute instance-attribute

No description given by bungie.

HAND_CANNON = 9 class-attribute instance-attribute

No description given by bungie.

HELMET_ARMOR = 26 class-attribute instance-attribute

No description given by bungie.

LEG_ARMOR = 29 class-attribute instance-attribute

No description given by bungie.

MACHINEGUN = 8 class-attribute instance-attribute

No description given by bungie.

MASK = 19 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

ORNAMENT = 21 class-attribute instance-attribute

No description given by bungie.

PULSE_RIFLE = 13 class-attribute instance-attribute

No description given by bungie.

ROCKET_LAUNCHER = 10 class-attribute instance-attribute

No description given by bungie.

SCOUT_RIFLE = 14 class-attribute instance-attribute

No description given by bungie.

SHADER = 20 class-attribute instance-attribute

No description given by bungie.

SHOTGUN = 7 class-attribute instance-attribute

No description given by bungie.

SIDEARM = 17 class-attribute instance-attribute

No description given by bungie.

SNIPER_RIFLE = 12 class-attribute instance-attribute

No description given by bungie.

SUBMACHINE_GUN = 24 class-attribute instance-attribute

No description given by bungie.

SWORD = 18 class-attribute instance-attribute

No description given by bungie.

TRACE_RIFLE = 25 class-attribute instance-attribute

No description given by bungie.

VANGUARD = 2 class-attribute instance-attribute

DEPRECATED. An item can both be "Vanguard" and something else.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyActivityDifficultyId

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
class DestinyActivityDifficultyId(BaseEnum):
    """
    _No description given by bungie._
    """

    TRIVIAL = 0
    """_No description given by bungie._ """
    EASY = 1
    """_No description given by bungie._ """
    NORMAL = 2
    """_No description given by bungie._ """
    CHALLENGING = 3
    """_No description given by bungie._ """
    HARD = 4
    """_No description given by bungie._ """
    BRAVE = 5
    """_No description given by bungie._ """
    ALMOST_IMPOSSIBLE = 6
    """_No description given by bungie._ """
    IMPOSSIBLE = 7
    """_No description given by bungie._ """
    COUNT = 8
    """_No description given by bungie._ """

ALMOST_IMPOSSIBLE = 6 class-attribute instance-attribute

No description given by bungie.

BRAVE = 5 class-attribute instance-attribute

No description given by bungie.

CHALLENGING = 3 class-attribute instance-attribute

No description given by bungie.

COUNT = 8 class-attribute instance-attribute

No description given by bungie.

EASY = 1 class-attribute instance-attribute

No description given by bungie.

HARD = 4 class-attribute instance-attribute

No description given by bungie.

IMPOSSIBLE = 7 class-attribute instance-attribute

No description given by bungie.

NORMAL = 2 class-attribute instance-attribute

No description given by bungie.

TRIVIAL = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyActivitySkullDynamicUse

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
861
862
863
864
865
866
867
868
869
870
871
872
873
class DestinyActivitySkullDynamicUse(BaseEnum):
    """
    _No description given by bungie._
    """

    UNKNOWN = 0
    """_No description given by bungie._ """
    ALLOWED = 1
    """_No description given by bungie._ """
    DISALLOWED = 2
    """_No description given by bungie._ """
    COUNT = 3
    """_No description given by bungie._ """

ALLOWED = 1 class-attribute instance-attribute

No description given by bungie.

COUNT = 3 class-attribute instance-attribute

No description given by bungie.

DISALLOWED = 2 class-attribute instance-attribute

No description given by bungie.

UNKNOWN = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyActivityModifierDisplayCategory

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
class DestinyActivityModifierDisplayCategory(BaseEnum):
    """
    _No description given by bungie._
    """

    NONE = 0
    """_No description given by bungie._ """
    MODE_RULES = 1
    """_No description given by bungie._ """
    SELF_BUILDCRAFT = 2
    """_No description given by bungie._ """
    ENEMY_ADJUSTMENT = 3
    """_No description given by bungie._ """
    ENEMY_BUILDCRAFT = 4
    """_No description given by bungie._ """
    SEASONAL = 5
    """_No description given by bungie._ """
    FUN = 6
    """_No description given by bungie._ """
    COUNT = 7
    """_No description given by bungie._ """

COUNT = 7 class-attribute instance-attribute

No description given by bungie.

ENEMY_ADJUSTMENT = 3 class-attribute instance-attribute

No description given by bungie.

ENEMY_BUILDCRAFT = 4 class-attribute instance-attribute

No description given by bungie.

FUN = 6 class-attribute instance-attribute

No description given by bungie.

MODE_RULES = 1 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

SEASONAL = 5 class-attribute instance-attribute

No description given by bungie.

SELF_BUILDCRAFT = 2 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyActivityModifierConnotation

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
class DestinyActivityModifierConnotation(BaseEnum):
    """
    _No description given by bungie._
    """

    NEUTRAL = 0
    """_No description given by bungie._ """
    POSITIVE = 1
    """_No description given by bungie._ """
    NEGATIVE = 2
    """_No description given by bungie._ """
    AFFIX = 3
    """_No description given by bungie._ """
    INFORMATIONAL = 4
    """_No description given by bungie._ """
    REWARD = 5
    """_No description given by bungie._ """
    EVENT = 6
    """_No description given by bungie._ """
    COUNT = 7
    """_No description given by bungie._ """

AFFIX = 3 class-attribute instance-attribute

No description given by bungie.

COUNT = 7 class-attribute instance-attribute

No description given by bungie.

EVENT = 6 class-attribute instance-attribute

No description given by bungie.

INFORMATIONAL = 4 class-attribute instance-attribute

No description given by bungie.

NEGATIVE = 2 class-attribute instance-attribute

No description given by bungie.

NEUTRAL = 0 class-attribute instance-attribute

No description given by bungie.

POSITIVE = 1 class-attribute instance-attribute

No description given by bungie.

REWARD = 5 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyActivityDifficultyTierType

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
922
923
924
925
926
927
928
929
930
931
932
class DestinyActivityDifficultyTierType(BaseEnum):
    """
    _No description given by bungie._
    """

    DEFAULT = 0
    """_No description given by bungie._ """
    TRAINING = 1
    """_No description given by bungie._ """
    COUNT = 2
    """_No description given by bungie._ """

COUNT = 2 class-attribute instance-attribute

No description given by bungie.

DEFAULT = 0 class-attribute instance-attribute

No description given by bungie.

TRAINING = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyGraphNodeState

Bases: BaseEnum

Represents a potential state of an Activity Graph node.

Source code in src/bungio/models/bungie/destiny/__init__.py
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
class DestinyGraphNodeState(BaseEnum):
    """
    Represents a potential state of an Activity Graph node.
    """

    HIDDEN = 0
    """_No description given by bungie._ """
    VISIBLE = 1
    """_No description given by bungie._ """
    TEASER = 2
    """_No description given by bungie._ """
    INCOMPLETE = 3
    """_No description given by bungie._ """
    COMPLETED = 4
    """_No description given by bungie._ """

COMPLETED = 4 class-attribute instance-attribute

No description given by bungie.

HIDDEN = 0 class-attribute instance-attribute

No description given by bungie.

INCOMPLETE = 3 class-attribute instance-attribute

No description given by bungie.

TEASER = 2 class-attribute instance-attribute

No description given by bungie.

VISIBLE = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyPresentationNodeType

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
class DestinyPresentationNodeType(BaseEnum):
    """
    _No description given by bungie._
    """

    DEFAULT = 0
    """_No description given by bungie._ """
    CATEGORY = 1
    """_No description given by bungie._ """
    COLLECTIBLES = 2
    """_No description given by bungie._ """
    RECORDS = 3
    """_No description given by bungie._ """
    METRIC = 4
    """_No description given by bungie._ """
    CRAFTABLE = 5
    """_No description given by bungie._ """

CATEGORY = 1 class-attribute instance-attribute

No description given by bungie.

COLLECTIBLES = 2 class-attribute instance-attribute

No description given by bungie.

CRAFTABLE = 5 class-attribute instance-attribute

No description given by bungie.

DEFAULT = 0 class-attribute instance-attribute

No description given by bungie.

METRIC = 4 class-attribute instance-attribute

No description given by bungie.

RECORDS = 3 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyScope

Bases: BaseEnum

There's a lot of places where we need to know scope on more than just a profile or character level. For everything else, there's this more generic sense of scope.

Source code in src/bungio/models/bungie/destiny/__init__.py
971
972
973
974
975
976
977
978
979
class DestinyScope(BaseEnum):
    """
    There's a lot of places where we need to know scope on more than just a profile or character level. For everything else, there's this more generic sense of scope.
    """

    PROFILE = 0
    """_No description given by bungie._ """
    CHARACTER = 1
    """_No description given by bungie._ """

CHARACTER = 1 class-attribute instance-attribute

No description given by bungie.

PROFILE = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyPresentationDisplayStyle

Bases: BaseEnum

A hint for how the presentation node should be displayed when shown in a list. How you use this is your UI is up to you.

Source code in src/bungio/models/bungie/destiny/__init__.py
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
class DestinyPresentationDisplayStyle(BaseEnum):
    """
    A hint for how the presentation node should be displayed when shown in a list. How you use this is your UI is up to you.
    """

    CATEGORY = 0
    """Display the item as a category, through which sub-items are filtered. """
    BADGE = 1
    """_No description given by bungie._ """
    MEDALS = 2
    """_No description given by bungie._ """
    COLLECTIBLE = 3
    """_No description given by bungie._ """
    RECORD = 4
    """_No description given by bungie._ """
    SEASONAL_TRIUMPH = 5
    """_No description given by bungie._ """
    GUARDIAN_RANK = 6
    """_No description given by bungie._ """
    CATEGORY_COLLECTIBLES = 7
    """_No description given by bungie._ """
    CATEGORY_CURRENCIES = 8
    """_No description given by bungie._ """
    CATEGORY_EMBLEMS = 9
    """_No description given by bungie._ """
    CATEGORY_EMOTES = 10
    """_No description given by bungie._ """
    CATEGORY_ENGRAMS = 11
    """_No description given by bungie._ """
    CATEGORY_FINISHERS = 12
    """_No description given by bungie._ """
    CATEGORY_GHOSTS = 13
    """_No description given by bungie._ """
    CATEGORY_MISC = 14
    """_No description given by bungie._ """
    CATEGORY_MODS = 15
    """_No description given by bungie._ """
    CATEGORY_ORNAMENTS = 16
    """_No description given by bungie._ """
    CATEGORY_SHADERS = 17
    """_No description given by bungie._ """
    CATEGORY_SHIPS = 18
    """_No description given by bungie._ """
    CATEGORY_SPAWNFX = 19
    """_No description given by bungie._ """
    CATEGORY_UPGRADE_MATERIALS = 20
    """_No description given by bungie._ """

BADGE = 1 class-attribute instance-attribute

No description given by bungie.

CATEGORY = 0 class-attribute instance-attribute

Display the item as a category, through which sub-items are filtered.

CATEGORY_COLLECTIBLES = 7 class-attribute instance-attribute

No description given by bungie.

CATEGORY_CURRENCIES = 8 class-attribute instance-attribute

No description given by bungie.

CATEGORY_EMBLEMS = 9 class-attribute instance-attribute

No description given by bungie.

CATEGORY_EMOTES = 10 class-attribute instance-attribute

No description given by bungie.

CATEGORY_ENGRAMS = 11 class-attribute instance-attribute

No description given by bungie.

CATEGORY_FINISHERS = 12 class-attribute instance-attribute

No description given by bungie.

CATEGORY_GHOSTS = 13 class-attribute instance-attribute

No description given by bungie.

CATEGORY_MISC = 14 class-attribute instance-attribute

No description given by bungie.

CATEGORY_MODS = 15 class-attribute instance-attribute

No description given by bungie.

CATEGORY_ORNAMENTS = 16 class-attribute instance-attribute

No description given by bungie.

CATEGORY_SHADERS = 17 class-attribute instance-attribute

No description given by bungie.

CATEGORY_SHIPS = 18 class-attribute instance-attribute

No description given by bungie.

CATEGORY_SPAWNFX = 19 class-attribute instance-attribute

No description given by bungie.

CATEGORY_UPGRADE_MATERIALS = 20 class-attribute instance-attribute

No description given by bungie.

COLLECTIBLE = 3 class-attribute instance-attribute

No description given by bungie.

GUARDIAN_RANK = 6 class-attribute instance-attribute

No description given by bungie.

MEDALS = 2 class-attribute instance-attribute

No description given by bungie.

RECORD = 4 class-attribute instance-attribute

No description given by bungie.

SEASONAL_TRIUMPH = 5 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyRecordValueStyle

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
class DestinyRecordValueStyle(BaseEnum):
    """
    _No description given by bungie._
    """

    INTEGER = 0
    """_No description given by bungie._ """
    PERCENTAGE = 1
    """_No description given by bungie._ """
    MILLISECONDS = 2
    """_No description given by bungie._ """
    BOOLEAN = 3
    """_No description given by bungie._ """
    DECIMAL = 4
    """_No description given by bungie._ """

BOOLEAN = 3 class-attribute instance-attribute

No description given by bungie.

DECIMAL = 4 class-attribute instance-attribute

No description given by bungie.

INTEGER = 0 class-attribute instance-attribute

No description given by bungie.

MILLISECONDS = 2 class-attribute instance-attribute

No description given by bungie.

PERCENTAGE = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyRecordToastStyle

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
class DestinyRecordToastStyle(BaseEnum):
    """
    _No description given by bungie._
    """

    NONE = 0
    """_No description given by bungie._ """
    RECORD = 1
    """_No description given by bungie._ """
    LORE = 2
    """_No description given by bungie._ """
    BADGE = 3
    """_No description given by bungie._ """
    META_RECORD = 4
    """_No description given by bungie._ """
    MEDAL_COMPLETE = 5
    """_No description given by bungie._ """
    SEASON_CHALLENGE_COMPLETE = 6
    """_No description given by bungie._ """
    GILDED_TITLE_COMPLETE = 7
    """_No description given by bungie._ """
    CRAFTING_RECIPE_UNLOCKED = 8
    """_No description given by bungie._ """
    TOAST_GUARDIAN_RANK_DETAILS = 9
    """_No description given by bungie._ """
    PATHFINDER_OBJECTIVE_COMPLETE_RITUALS = 10
    """_No description given by bungie._ """
    PATHFINDER_OBJECTIVE_COMPLETE_SCHISM = 11
    """_No description given by bungie._ """
    PATHFINDER_OBJECTIVE_COMPLETE_PVP = 12
    """_No description given by bungie._ """
    PATHFINDER_OBJECTIVE_COMPLETE_STRIKES = 13
    """_No description given by bungie._ """
    PATHFINDER_OBJECTIVE_COMPLETE_GAMBIT = 14
    """_No description given by bungie._ """
    SEASON_WEEKLY_COMPLETE = 15
    """_No description given by bungie._ """
    SEASON_DAILY_COMPLETE = 16
    """_No description given by bungie._ """

BADGE = 3 class-attribute instance-attribute

No description given by bungie.

CRAFTING_RECIPE_UNLOCKED = 8 class-attribute instance-attribute

No description given by bungie.

GILDED_TITLE_COMPLETE = 7 class-attribute instance-attribute

No description given by bungie.

LORE = 2 class-attribute instance-attribute

No description given by bungie.

MEDAL_COMPLETE = 5 class-attribute instance-attribute

No description given by bungie.

META_RECORD = 4 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

PATHFINDER_OBJECTIVE_COMPLETE_GAMBIT = 14 class-attribute instance-attribute

No description given by bungie.

PATHFINDER_OBJECTIVE_COMPLETE_PVP = 12 class-attribute instance-attribute

No description given by bungie.

PATHFINDER_OBJECTIVE_COMPLETE_RITUALS = 10 class-attribute instance-attribute

No description given by bungie.

PATHFINDER_OBJECTIVE_COMPLETE_SCHISM = 11 class-attribute instance-attribute

No description given by bungie.

PATHFINDER_OBJECTIVE_COMPLETE_STRIKES = 13 class-attribute instance-attribute

No description given by bungie.

RECORD = 1 class-attribute instance-attribute

No description given by bungie.

SEASON_CHALLENGE_COMPLETE = 6 class-attribute instance-attribute

No description given by bungie.

SEASON_DAILY_COMPLETE = 16 class-attribute instance-attribute

No description given by bungie.

SEASON_WEEKLY_COMPLETE = 15 class-attribute instance-attribute

No description given by bungie.

TOAST_GUARDIAN_RANK_DETAILS = 9 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyPresentationScreenStyle

Bases: BaseEnum

A hint for what screen should be shown when this presentation node is clicked into. How you use this is your UI is up to you.

Source code in src/bungio/models/bungie/destiny/__init__.py
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
class DestinyPresentationScreenStyle(BaseEnum):
    """
    A hint for what screen should be shown when this presentation node is clicked into. How you use this is your UI is up to you.
    """

    DEFAULT = 0
    """Use the "default" view for the presentation nodes. """
    CATEGORY_SETS = 1
    """Show sub-items as "category sets". In-game, you'd see these as a vertical list of child presentation nodes - armor sets for example - and the icons of items within those sets displayed horizontally. """
    BADGE = 2
    """Show sub-items as Badges. (I know, I know. We don't need no stinkin' badges har har har) """

BADGE = 2 class-attribute instance-attribute

Show sub-items as Badges. (I know, I know. We don't need no stinkin' badges har har har)

CATEGORY_SETS = 1 class-attribute instance-attribute

Show sub-items as "category sets". In-game, you'd see these as a vertical list of child presentation nodes - armor sets for example - and the icons of items within those sets displayed horizontally.

DEFAULT = 0 class-attribute instance-attribute

Use the "default" view for the presentation nodes.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

PlugUiStyles

Bases: BaseFlagEnum

If the plug has a specific custom style, this enumeration will represent that style/those styles.

Source code in src/bungio/models/bungie/destiny/__init__.py
1102
1103
1104
1105
1106
1107
1108
1109
1110
class PlugUiStyles(BaseFlagEnum):
    """
    If the plug has a specific custom style, this enumeration will represent that style/those styles.
    """

    NONE = 0
    """_No description given by bungie._ """
    MASTERWORK = 1
    """_No description given by bungie._ """

MASTERWORK = 1 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

PlugAvailabilityMode

Bases: BaseEnum

This enum determines whether the plug is available to be inserted. - Normal means that all existing rules for plug insertion apply. - UnavailableIfSocketContainsMatchingPlugCategory means that the plug is only available if the socket does NOT match the plug category. - AvailableIfSocketContainsMatchingPlugCategory means that the plug is only available if the socket DOES match the plug category. For category matching, use the plug's "plugCategoryIdentifier" property, comparing it to

Source code in src/bungio/models/bungie/destiny/__init__.py
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
class PlugAvailabilityMode(BaseEnum):
    """
    This enum determines whether the plug is available to be inserted. - Normal means that all existing rules for plug insertion apply. - UnavailableIfSocketContainsMatchingPlugCategory means that the plug is only available if the socket does NOT match the plug category. - AvailableIfSocketContainsMatchingPlugCategory means that the plug is only available if the socket DOES match the plug category. For category matching, use the plug's "plugCategoryIdentifier" property, comparing it to
    """

    NORMAL = 0
    """_No description given by bungie._ """
    UNAVAILABLE_IF_SOCKET_CONTAINS_MATCHING_PLUG_CATEGORY = 1
    """_No description given by bungie._ """
    AVAILABLE_IF_SOCKET_CONTAINS_MATCHING_PLUG_CATEGORY = 2
    """_No description given by bungie._ """

AVAILABLE_IF_SOCKET_CONTAINS_MATCHING_PLUG_CATEGORY = 2 class-attribute instance-attribute

No description given by bungie.

NORMAL = 0 class-attribute instance-attribute

No description given by bungie.

UNAVAILABLE_IF_SOCKET_CONTAINS_MATCHING_PLUG_CATEGORY = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyEnergyType

Bases: BaseEnum

Represents the socket energy types for Armor 2.0, Ghosts 2.0, and Stasis subclasses.

Source code in src/bungio/models/bungie/destiny/__init__.py
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
class DestinyEnergyType(BaseEnum):
    """
    Represents the socket energy types for Armor 2.0, Ghosts 2.0, and Stasis subclasses.
    """

    ANY = 0
    """_No description given by bungie._ """
    ARC = 1
    """_No description given by bungie._ """
    THERMAL = 2
    """_No description given by bungie._ """
    VOID = 3
    """_No description given by bungie._ """
    GHOST = 4
    """_No description given by bungie._ """
    SUBCLASS = 5
    """_No description given by bungie._ """
    STASIS = 6
    """_No description given by bungie._ """

ANY = 0 class-attribute instance-attribute

No description given by bungie.

ARC = 1 class-attribute instance-attribute

No description given by bungie.

GHOST = 4 class-attribute instance-attribute

No description given by bungie.

STASIS = 6 class-attribute instance-attribute

No description given by bungie.

SUBCLASS = 5 class-attribute instance-attribute

No description given by bungie.

THERMAL = 2 class-attribute instance-attribute

No description given by bungie.

VOID = 3 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

SocketPlugSources

Bases: BaseFlagEnum

Indicates how a socket is populated, and where you should look for valid plug data. This is a flags enumeration/bitmask field, as you may have to look in multiple sources across multiple components for valid plugs. For instance, a socket could have plugs that are sourced from its own definition, as well as plugs that are sourced from Character-scoped AND profile-scoped Plug Sets. Only by combining plug data for every indicated source will you be able to know all of the plugs available for a socket.

Source code in src/bungio/models/bungie/destiny/__init__.py
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
class SocketPlugSources(BaseFlagEnum):
    """
    Indicates how a socket is populated, and where you should look for valid plug data.  This is a flags enumeration/bitmask field, as you may have to look in multiple sources across multiple components for valid plugs.  For instance, a socket could have plugs that are sourced from its own definition, as well as plugs that are sourced from Character-scoped AND profile-scoped Plug Sets. Only by combining plug data for every indicated source will you be able to know all of the plugs available for a socket.
    """

    NONE = 0
    """If there's no way we can detect to insert new plugs. """
    INVENTORY_SOURCED = 1
    """Use plugs found in the player's inventory, based on the socket type rules (see DestinySocketTypeDefinition for more info) Note that a socket - like Shaders - can have *both* reusable plugs and inventory items inserted theoretically. """
    REUSABLE_PLUG_ITEMS = 2
    """Use the DestinyItemSocketsComponent.sockets.reusablePlugs property to determine which plugs are valid for this socket. This may have to be combined with other sources, such as plug sets, if those flags are set.  Note that "Reusable" plugs may not necessarily come from a plug set, nor from the "reusablePlugItems" in the socket's Definition data. They can sometimes be "randomized" in which case the only source of truth at the moment is still the runtime DestinyItemSocketsComponent.sockets.reusablePlugs property. """
    PROFILE_PLUG_SET = 4
    """Use the ProfilePlugSets (DestinyProfileResponse.profilePlugSets) component data to determine which plugs are valid for this socket. """
    CHARACTER_PLUG_SET = 8
    """Use the CharacterPlugSets (DestinyProfileResponse.characterPlugSets) component data to determine which plugs are valid for this socket. """

CHARACTER_PLUG_SET = 8 class-attribute instance-attribute

Use the CharacterPlugSets (DestinyProfileResponse.characterPlugSets) component data to determine which plugs are valid for this socket.

INVENTORY_SOURCED = 1 class-attribute instance-attribute

Use plugs found in the player's inventory, based on the socket type rules (see DestinySocketTypeDefinition for more info) Note that a socket - like Shaders - can have both reusable plugs and inventory items inserted theoretically.

NONE = 0 class-attribute instance-attribute

If there's no way we can detect to insert new plugs.

PROFILE_PLUG_SET = 4 class-attribute instance-attribute

Use the ProfilePlugSets (DestinyProfileResponse.profilePlugSets) component data to determine which plugs are valid for this socket.

REUSABLE_PLUG_ITEMS = 2 class-attribute instance-attribute

Use the DestinyItemSocketsComponent.sockets.reusablePlugs property to determine which plugs are valid for this socket. This may have to be combined with other sources, such as plug sets, if those flags are set. Note that "Reusable" plugs may not necessarily come from a plug set, nor from the "reusablePlugItems" in the socket's Definition data. They can sometimes be "randomized" in which case the only source of truth at the moment is still the runtime DestinyItemSocketsComponent.sockets.reusablePlugs property.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

ItemPerkVisibility

Bases: BaseEnum

Indicates how a perk should be shown, or if it should be, in the game UI. Maybe useful for those of you trying to filter out internal-use-only perks (or for those of you trying to figure out what they do!)

Source code in src/bungio/models/bungie/destiny/__init__.py
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
class ItemPerkVisibility(BaseEnum):
    """
    Indicates how a perk should be shown, or if it should be, in the game UI. Maybe useful for those of you trying to filter out internal-use-only perks (or for those of you trying to figure out what they do!)
    """

    VISIBLE = 0
    """_No description given by bungie._ """
    DISABLED = 1
    """_No description given by bungie._ """
    HIDDEN = 2
    """_No description given by bungie._ """

DISABLED = 1 class-attribute instance-attribute

No description given by bungie.

HIDDEN = 2 class-attribute instance-attribute

No description given by bungie.

VISIBLE = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

SpecialItemType

Bases: BaseEnum

As you run into items that need to be classified for Milestone purposes in ways that we cannot infer via direct data, add a new classification here and use a string constant to represent it in the local item config file. NOTE: This is not all of the item types available, and some of these are holdovers from Destiny 1 that may or may not still exist.

Source code in src/bungio/models/bungie/destiny/__init__.py
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
class SpecialItemType(BaseEnum):
    """
    As you run into items that need to be classified for Milestone purposes in ways that we cannot infer via direct data, add a new classification here and use a string constant to represent it in the local item config file. NOTE: This is not all of the item types available, and some of these are holdovers from Destiny 1 that may or may not still exist.
    """

    NONE = 0
    """_No description given by bungie._ """
    SPECIAL_CURRENCY = 1
    """_No description given by bungie._ """
    ARMOR = 8
    """_No description given by bungie._ """
    WEAPON = 9
    """_No description given by bungie._ """
    ENGRAM = 23
    """_No description given by bungie._ """
    CONSUMABLE = 24
    """_No description given by bungie._ """
    EXCHANGE_MATERIAL = 25
    """_No description given by bungie._ """
    MISSION_REWARD = 27
    """_No description given by bungie._ """
    CURRENCY = 29
    """_No description given by bungie._ """

ARMOR = 8 class-attribute instance-attribute

No description given by bungie.

CONSUMABLE = 24 class-attribute instance-attribute

No description given by bungie.

CURRENCY = 29 class-attribute instance-attribute

No description given by bungie.

ENGRAM = 23 class-attribute instance-attribute

No description given by bungie.

EXCHANGE_MATERIAL = 25 class-attribute instance-attribute

No description given by bungie.

MISSION_REWARD = 27 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

SPECIAL_CURRENCY = 1 class-attribute instance-attribute

No description given by bungie.

WEAPON = 9 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyItemType

Bases: BaseEnum

An enumeration that indicates the high-level "type" of the item, attempting to iron out the context specific differences for specific instances of an entity. For instance, though a weapon may be of various weapon "Types", in DestinyItemType they are all classified as "Weapon". This allows for better filtering on a higher level of abstraction for the concept of types. This enum is provided for historical compatibility with Destiny 1, but an ideal alternative is to use DestinyItemCategoryDefinitions and the DestinyItemDefinition.itemCategories property instead. Item Categories allow for arbitrary hierarchies of specificity, and for items to belong to multiple categories across multiple hierarchies simultaneously. For this enum, we pick a single type as a "best guess" fit. NOTE: This is not all of the item types available, and some of these are holdovers from Destiny 1 that may or may not still exist. I keep updating these because they're so damn convenient. I guess I shouldn't fight it.

Source code in src/bungio/models/bungie/destiny/__init__.py
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
class DestinyItemType(BaseEnum):
    """
    An enumeration that indicates the high-level "type" of the item, attempting to iron out the context specific differences for specific instances of an entity. For instance, though a weapon may be of various weapon "Types", in DestinyItemType they are all classified as "Weapon". This allows for better filtering on a higher level of abstraction for the concept of types.  This enum is provided for historical compatibility with Destiny 1, but an ideal alternative is to use DestinyItemCategoryDefinitions and the DestinyItemDefinition.itemCategories property instead. Item Categories allow for arbitrary hierarchies of specificity, and for items to belong to multiple categories across multiple hierarchies simultaneously. For this enum, we pick a single type as a "best guess" fit.  NOTE: This is not all of the item types available, and some of these are holdovers from Destiny 1 that may or may not still exist.  I keep updating these because they're so damn convenient. I guess I shouldn't fight it.
    """

    NONE = 0
    """_No description given by bungie._ """
    CURRENCY = 1
    """_No description given by bungie._ """
    ARMOR = 2
    """_No description given by bungie._ """
    WEAPON = 3
    """_No description given by bungie._ """
    MESSAGE = 7
    """_No description given by bungie._ """
    ENGRAM = 8
    """_No description given by bungie._ """
    CONSUMABLE = 9
    """_No description given by bungie._ """
    EXCHANGE_MATERIAL = 10
    """_No description given by bungie._ """
    MISSION_REWARD = 11
    """_No description given by bungie._ """
    QUEST_STEP = 12
    """_No description given by bungie._ """
    QUEST_STEP_COMPLETE = 13
    """_No description given by bungie._ """
    EMBLEM = 14
    """_No description given by bungie._ """
    QUEST = 15
    """_No description given by bungie._ """
    SUBCLASS = 16
    """_No description given by bungie._ """
    CLAN_BANNER = 17
    """_No description given by bungie._ """
    AURA = 18
    """_No description given by bungie._ """
    MOD = 19
    """_No description given by bungie._ """
    DUMMY = 20
    """_No description given by bungie._ """
    SHIP = 21
    """_No description given by bungie._ """
    VEHICLE = 22
    """_No description given by bungie._ """
    EMOTE = 23
    """_No description given by bungie._ """
    GHOST = 24
    """_No description given by bungie._ """
    PACKAGE = 25
    """_No description given by bungie._ """
    BOUNTY = 26
    """_No description given by bungie._ """
    WRAPPER = 27
    """_No description given by bungie._ """
    SEASONAL_ARTIFACT = 28
    """_No description given by bungie._ """
    FINISHER = 29
    """_No description given by bungie._ """
    PATTERN = 30
    """_No description given by bungie._ """

ARMOR = 2 class-attribute instance-attribute

No description given by bungie.

AURA = 18 class-attribute instance-attribute

No description given by bungie.

BOUNTY = 26 class-attribute instance-attribute

No description given by bungie.

CLAN_BANNER = 17 class-attribute instance-attribute

No description given by bungie.

CONSUMABLE = 9 class-attribute instance-attribute

No description given by bungie.

CURRENCY = 1 class-attribute instance-attribute

No description given by bungie.

DUMMY = 20 class-attribute instance-attribute

No description given by bungie.

EMBLEM = 14 class-attribute instance-attribute

No description given by bungie.

EMOTE = 23 class-attribute instance-attribute

No description given by bungie.

ENGRAM = 8 class-attribute instance-attribute

No description given by bungie.

EXCHANGE_MATERIAL = 10 class-attribute instance-attribute

No description given by bungie.

FINISHER = 29 class-attribute instance-attribute

No description given by bungie.

GHOST = 24 class-attribute instance-attribute

No description given by bungie.

MESSAGE = 7 class-attribute instance-attribute

No description given by bungie.

MISSION_REWARD = 11 class-attribute instance-attribute

No description given by bungie.

MOD = 19 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

PACKAGE = 25 class-attribute instance-attribute

No description given by bungie.

PATTERN = 30 class-attribute instance-attribute

No description given by bungie.

QUEST = 15 class-attribute instance-attribute

No description given by bungie.

QUEST_STEP = 12 class-attribute instance-attribute

No description given by bungie.

QUEST_STEP_COMPLETE = 13 class-attribute instance-attribute

No description given by bungie.

SEASONAL_ARTIFACT = 28 class-attribute instance-attribute

No description given by bungie.

SHIP = 21 class-attribute instance-attribute

No description given by bungie.

SUBCLASS = 16 class-attribute instance-attribute

No description given by bungie.

VEHICLE = 22 class-attribute instance-attribute

No description given by bungie.

WEAPON = 3 class-attribute instance-attribute

No description given by bungie.

WRAPPER = 27 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyBreakerType

Bases: BaseEnum

A plug can optionally have a "Breaker Type": a special ability that can affect units in unique ways. Activating this plug can grant one of these types.

Source code in src/bungio/models/bungie/destiny/__init__.py
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
class DestinyBreakerType(BaseEnum):
    """
    A plug can optionally have a "Breaker Type": a special ability that can affect units in unique ways. Activating this plug can grant one of these types.
    """

    NONE = 0
    """_No description given by bungie._ """
    SHIELD_PIERCING = 1
    """_No description given by bungie._ """
    DISRUPTION = 2
    """_No description given by bungie._ """
    STAGGER = 3
    """_No description given by bungie._ """

DISRUPTION = 2 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

SHIELD_PIERCING = 1 class-attribute instance-attribute

No description given by bungie.

STAGGER = 3 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyProgressionRewardItemAcquisitionBehavior

Bases: BaseEnum

Represents the different kinds of acquisition behavior for progression reward items.

Source code in src/bungio/models/bungie/destiny/__init__.py
1280
1281
1282
1283
1284
1285
1286
1287
1288
class DestinyProgressionRewardItemAcquisitionBehavior(BaseEnum):
    """
    Represents the different kinds of acquisition behavior for progression reward items.
    """

    INSTANT = 0
    """_No description given by bungie._ """
    PLAYER_CLAIM_REQUIRED = 1
    """_No description given by bungie._ """

INSTANT = 0 class-attribute instance-attribute

No description given by bungie.

PLAYER_CLAIM_REQUIRED = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

ItemBindStatus

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
class ItemBindStatus(BaseEnum):
    """
    _No description given by bungie._
    """

    NOT_BOUND = 0
    """_No description given by bungie._ """
    BOUND_TO_CHARACTER = 1
    """_No description given by bungie._ """
    BOUND_TO_ACCOUNT = 2
    """_No description given by bungie._ """
    BOUND_TO_GUILD = 3
    """_No description given by bungie._ """

BOUND_TO_ACCOUNT = 2 class-attribute instance-attribute

No description given by bungie.

BOUND_TO_CHARACTER = 1 class-attribute instance-attribute

No description given by bungie.

BOUND_TO_GUILD = 3 class-attribute instance-attribute

No description given by bungie.

NOT_BOUND = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

TransferStatuses

Bases: BaseFlagEnum

Whether you can transfer an item, and why not if you can't.

Source code in src/bungio/models/bungie/destiny/__init__.py
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
class TransferStatuses(BaseFlagEnum):
    """
    Whether you can transfer an item, and why not if you can't.
    """

    CAN_TRANSFER = 0
    """The item can be transferred. """
    ITEM_IS_EQUIPPED = 1
    """You can't transfer the item because it is equipped on a character. """
    NOT_TRANSFERRABLE = 2
    """The item is defined as not transferrable in its DestinyInventoryItemDefinition.nonTransferrable property. """
    NO_ROOM_IN_DESTINATION = 4
    """You could transfer the item, but the place you're trying to put it has run out of room! Check your remaining Vault and/or character space. """

CAN_TRANSFER = 0 class-attribute instance-attribute

The item can be transferred.

ITEM_IS_EQUIPPED = 1 class-attribute instance-attribute

You can't transfer the item because it is equipped on a character.

NOT_TRANSFERRABLE = 2 class-attribute instance-attribute

The item is defined as not transferrable in its DestinyInventoryItemDefinition.nonTransferrable property.

NO_ROOM_IN_DESTINATION = 4 class-attribute instance-attribute

You could transfer the item, but the place you're trying to put it has run out of room! Check your remaining Vault and/or character space.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyGameVersions

Bases: BaseFlagEnum

A flags enumeration/bitmask indicating the versions of the game that a given user has purchased.

Source code in src/bungio/models/bungie/destiny/__init__.py
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
class DestinyGameVersions(BaseFlagEnum):
    """
    A flags enumeration/bitmask indicating the versions of the game that a given user has purchased.
    """

    NONE = 0
    """_No description given by bungie._ """
    DESTINY2 = 1
    """_No description given by bungie._ """
    D_L_C1 = 2
    """_No description given by bungie._ """
    D_L_C2 = 4
    """_No description given by bungie._ """
    FORSAKEN = 8
    """_No description given by bungie._ """
    YEAR_TWO_ANNUAL_PASS = 16
    """_No description given by bungie._ """
    SHADOWKEEP = 32
    """_No description given by bungie._ """
    BEYOND_LIGHT = 64
    """_No description given by bungie._ """
    ANNIVERSARY30TH = 128
    """_No description given by bungie._ """
    THE_WITCH_QUEEN = 256
    """_No description given by bungie._ """
    LIGHTFALL = 512
    """_No description given by bungie._ """
    THE_FINAL_SHAPE = 1024
    """_No description given by bungie._ """
    EDGE_OF_FATE = 2048
    """_No description given by bungie._ """
    RENEGADES = 4096
    """_No description given by bungie._ """

ANNIVERSARY30TH = 128 class-attribute instance-attribute

No description given by bungie.

BEYOND_LIGHT = 64 class-attribute instance-attribute

No description given by bungie.

DESTINY2 = 1 class-attribute instance-attribute

No description given by bungie.

D_L_C1 = 2 class-attribute instance-attribute

No description given by bungie.

D_L_C2 = 4 class-attribute instance-attribute

No description given by bungie.

EDGE_OF_FATE = 2048 class-attribute instance-attribute

No description given by bungie.

FORSAKEN = 8 class-attribute instance-attribute

No description given by bungie.

LIGHTFALL = 512 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

RENEGADES = 4096 class-attribute instance-attribute

No description given by bungie.

SHADOWKEEP = 32 class-attribute instance-attribute

No description given by bungie.

THE_FINAL_SHAPE = 1024 class-attribute instance-attribute

No description given by bungie.

THE_WITCH_QUEEN = 256 class-attribute instance-attribute

No description given by bungie.

YEAR_TWO_ANNUAL_PASS = 16 class-attribute instance-attribute

No description given by bungie.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyComponentType

Bases: BaseEnum

Represents the possible components that can be returned from Destiny "Get" calls such as GetProfile, GetCharacter, GetVendor etc... When making one of these requests, you will pass one or more of these components as a comma separated list in the "?components=" querystring parameter. For instance, if you want baseline Profile data, Character Data, and character progressions, you would pass "?components=Profiles,Characters,CharacterProgressions" You may use either the numerical or string values.

Source code in src/bungio/models/bungie/destiny/__init__.py
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
class DestinyComponentType(BaseEnum):
    """
    Represents the possible components that can be returned from Destiny "Get" calls such as GetProfile, GetCharacter, GetVendor etc... When making one of these requests, you will pass one or more of these components as a comma separated list in the "?components=" querystring parameter. For instance, if you want baseline Profile data, Character Data, and character progressions, you would pass "?components=Profiles,Characters,CharacterProgressions" You may use either the numerical or string values.
    """

    NONE = 0
    """_No description given by bungie._ """
    PROFILES = 100
    """Profiles is the most basic component, only relevant when calling GetProfile. This returns basic information about the profile, which is almost nothing: a list of characterIds, some information about the last time you logged in, and that most sobering statistic: how long you've played. """
    VENDOR_RECEIPTS = 101
    """Only applicable for GetProfile, this will return information about receipts for refundable vendor items. """
    PROFILE_INVENTORIES = 102
    """Asking for this will get you the profile-level inventories, such as your Vault buckets (yeah, the Vault is really inventory buckets located on your Profile) """
    PROFILE_CURRENCIES = 103
    """This will get you a summary of items on your Profile that we consider to be "currencies", such as Glimmer. I mean, if there's Glimmer in Destiny 2. I didn't say there was Glimmer. """
    PROFILE_PROGRESSION = 104
    """This will get you any progression-related information that exists on a Profile-wide level, across all characters. """
    PLATFORM_SILVER = 105
    """This will get you information about the silver that this profile has on every platform on which it plays.  You may only request this component for the logged in user's Profile, and will not recieve it if you request it for another Profile. """
    CHARACTERS = 200
    """This will get you summary info about each of the characters in the profile. """
    CHARACTER_INVENTORIES = 201
    """This will get you information about any non-equipped items on the character or character(s) in question, if you're allowed to see it. You have to either be authenticated as that user, or that user must allow anonymous viewing of their non-equipped items in Bungie.Net settings to actually get results. """
    CHARACTER_PROGRESSIONS = 202
    """This will get you information about the progression (faction, experience, etc... "levels") relevant to each character, if you are the currently authenticated user or the user has elected to allow anonymous viewing of its progression info. """
    CHARACTER_RENDER_DATA = 203
    """This will get you just enough information to be able to render the character in 3D if you have written a 3D rendering library for Destiny Characters, or "borrowed" ours. It's okay, I won't tell anyone if you're using it. I'm no snitch. (actually, we don't care if you use it - go to town) """
    CHARACTER_ACTIVITIES = 204
    """This will return info about activities that a user can see and gating on it, if you are the currently authenticated user or the user has elected to allow anonymous viewing of its progression info. Note that the data returned by this can be unfortunately problematic and relatively unreliable in some cases. We'll eventually work on making it more consistently reliable. """
    CHARACTER_EQUIPMENT = 205
    """This will return info about the equipped items on the character(s). Everyone can see this. """
    CHARACTER_LOADOUTS = 206
    """This will return info about the loadouts of the character(s). """
    ITEM_INSTANCES = 300
    """This will return basic info about instanced items - whether they can be equipped, their tracked status, and some info commonly needed in many places (current damage type, primary stat value, etc) """
    ITEM_OBJECTIVES = 301
    """Items can have Objectives (DestinyObjectiveDefinition) bound to them. If they do, this will return info for items that have such bound objectives. """
    ITEM_PERKS = 302
    """Items can have perks (DestinySandboxPerkDefinition). If they do, this will return info for what perks are active on items. """
    ITEM_RENDER_DATA = 303
    """If you just want to render the weapon, this is just enough info to do that rendering. """
    ITEM_STATS = 304
    """Items can have stats, like rate of fire. Asking for this component will return requested item's stats if they have stats. """
    ITEM_SOCKETS = 305
    """Items can have sockets, where plugs can be inserted. Asking for this component will return all info relevant to the sockets on items that have them. """
    ITEM_TALENT_GRIDS = 306
    """Items can have talent grids, though that matters a lot less frequently than it used to. Asking for this component will return all relevant info about activated Nodes and Steps on this talent grid, like the good ol' days. """
    ITEM_COMMON_DATA = 307
    """Items that *aren't* instanced still have important information you need to know: how much of it you have, the itemHash so you can look up their DestinyInventoryItemDefinition, whether they're locked, etc... Both instanced and non-instanced items will have these properties. You will get this automatically with Inventory components - you only need to pass this when calling GetItem on a specific item. """
    ITEM_PLUG_STATES = 308
    """Items that are "Plugs" can be inserted into sockets. This returns statuses about those plugs and why they can/can't be inserted. I hear you giggling, there's nothing funny about inserting plugs. Get your head out of the gutter and pay attention! """
    ITEM_PLUG_OBJECTIVES = 309
    """Sometimes, plugs have objectives on them. This data can get really large, so we split it into its own component. Please, don't grab it unless you need it. """
    ITEM_REUSABLE_PLUGS = 310
    """Sometimes, designers create thousands of reusable plugs and suddenly your response sizes are almost 3MB, and something has to give.  Reusable Plugs were split off as their own component, away from ItemSockets, as a result of the Plug changes in Shadowkeep that made plug data infeasibly large for the most common use cases.  Request this component if and only if you need to know what plugs *could* be inserted into a socket, and need to know it before "drilling" into the details of an item in your application (for instance, if you're doing some sort of interesting sorting or aggregation based on available plugs.  When you get this, you will also need to combine it with "Plug Sets" data if you want a full picture of all of the available plugs: this component will only return plugs that have state data that is per-item. See Plug Sets for available plugs that have Character, Profile, or no state-specific restrictions. """
    VENDORS = 400
    """When obtaining vendor information, this will return summary information about the Vendor or Vendors being returned. """
    VENDOR_CATEGORIES = 401
    """When obtaining vendor information, this will return information about the categories of items provided by the Vendor. """
    VENDOR_SALES = 402
    """When obtaining vendor information, this will return the information about items being sold by the Vendor. """
    KIOSKS = 500
    """Asking for this component will return you the account's Kiosk statuses: that is, what items have been filled out/acquired. But only if you are the currently authenticated user or the user has elected to allow anonymous viewing of its progression info. """
    CURRENCY_LOOKUPS = 600
    """A "shortcut" component that will give you all of the item hashes/quantities of items that the requested character can use to determine if an action (purchasing, socket insertion) has the required currency. (recall that all currencies are just items, and that some vendor purchases require items that you might not traditionally consider to be a "currency", like plugs/mods!) """
    PRESENTATION_NODES = 700
    """Returns summary status information about all "Presentation Nodes". See DestinyPresentationNodeDefinition for more details, but the gist is that these are entities used by the game UI to bucket Collectibles and Records into a hierarchy of categories. You may ask for and use this data if you want to perform similar bucketing in your own UI: or you can skip it and roll your own. """
    COLLECTIBLES = 800
    """Returns summary status information about all "Collectibles". These are records of what items you've discovered while playing Destiny, and some other basic information. For detailed information, you will have to call a separate endpoint devoted to the purpose. """
    RECORDS = 900
    """Returns summary status information about all "Records" (also known in the game as "Triumphs". I know, it's confusing because there's also "Moments of Triumph" that will themselves be represented as "Triumphs.") """
    TRANSITORY = 1000
    """Returns information that Bungie considers to be "Transitory": data that may change too frequently or come from a non-authoritative source such that we don't consider the data to be fully trustworthy, but that might prove useful for some limited use cases. We can provide no guarantee of timeliness nor consistency for this data: buyer beware with the Transitory component. """
    METRICS = 1100
    """Returns summary status information about all "Metrics" (also known in the game as "Stat Trackers"). """
    STRING_VARIABLES = 1200
    """Returns a mapping of localized string variable hashes to values, on a per-account or per-character basis. """
    CRAFTABLES = 1300
    """Returns summary status information about all "Craftables" aka crafting recipe items. """
    SOCIAL_COMMENDATIONS = 1400
    """Returns score values for all commendations and commendation nodes. """

CHARACTERS = 200 class-attribute instance-attribute

This will get you summary info about each of the characters in the profile.

CHARACTER_ACTIVITIES = 204 class-attribute instance-attribute

This will return info about activities that a user can see and gating on it, if you are the currently authenticated user or the user has elected to allow anonymous viewing of its progression info. Note that the data returned by this can be unfortunately problematic and relatively unreliable in some cases. We'll eventually work on making it more consistently reliable.

CHARACTER_EQUIPMENT = 205 class-attribute instance-attribute

This will return info about the equipped items on the character(s). Everyone can see this.

CHARACTER_INVENTORIES = 201 class-attribute instance-attribute

This will get you information about any non-equipped items on the character or character(s) in question, if you're allowed to see it. You have to either be authenticated as that user, or that user must allow anonymous viewing of their non-equipped items in Bungie.Net settings to actually get results.

CHARACTER_LOADOUTS = 206 class-attribute instance-attribute

This will return info about the loadouts of the character(s).

CHARACTER_PROGRESSIONS = 202 class-attribute instance-attribute

This will get you information about the progression (faction, experience, etc... "levels") relevant to each character, if you are the currently authenticated user or the user has elected to allow anonymous viewing of its progression info.

CHARACTER_RENDER_DATA = 203 class-attribute instance-attribute

This will get you just enough information to be able to render the character in 3D if you have written a 3D rendering library for Destiny Characters, or "borrowed" ours. It's okay, I won't tell anyone if you're using it. I'm no snitch. (actually, we don't care if you use it - go to town)

COLLECTIBLES = 800 class-attribute instance-attribute

Returns summary status information about all "Collectibles". These are records of what items you've discovered while playing Destiny, and some other basic information. For detailed information, you will have to call a separate endpoint devoted to the purpose.

CRAFTABLES = 1300 class-attribute instance-attribute

Returns summary status information about all "Craftables" aka crafting recipe items.

CURRENCY_LOOKUPS = 600 class-attribute instance-attribute

A "shortcut" component that will give you all of the item hashes/quantities of items that the requested character can use to determine if an action (purchasing, socket insertion) has the required currency. (recall that all currencies are just items, and that some vendor purchases require items that you might not traditionally consider to be a "currency", like plugs/mods!)

ITEM_COMMON_DATA = 307 class-attribute instance-attribute

Items that aren't instanced still have important information you need to know: how much of it you have, the itemHash so you can look up their DestinyInventoryItemDefinition, whether they're locked, etc... Both instanced and non-instanced items will have these properties. You will get this automatically with Inventory components - you only need to pass this when calling GetItem on a specific item.

ITEM_INSTANCES = 300 class-attribute instance-attribute

This will return basic info about instanced items - whether they can be equipped, their tracked status, and some info commonly needed in many places (current damage type, primary stat value, etc)

ITEM_OBJECTIVES = 301 class-attribute instance-attribute

Items can have Objectives (DestinyObjectiveDefinition) bound to them. If they do, this will return info for items that have such bound objectives.

ITEM_PERKS = 302 class-attribute instance-attribute

Items can have perks (DestinySandboxPerkDefinition). If they do, this will return info for what perks are active on items.

ITEM_PLUG_OBJECTIVES = 309 class-attribute instance-attribute

Sometimes, plugs have objectives on them. This data can get really large, so we split it into its own component. Please, don't grab it unless you need it.

ITEM_PLUG_STATES = 308 class-attribute instance-attribute

Items that are "Plugs" can be inserted into sockets. This returns statuses about those plugs and why they can/can't be inserted. I hear you giggling, there's nothing funny about inserting plugs. Get your head out of the gutter and pay attention!

ITEM_RENDER_DATA = 303 class-attribute instance-attribute

If you just want to render the weapon, this is just enough info to do that rendering.

ITEM_REUSABLE_PLUGS = 310 class-attribute instance-attribute

Sometimes, designers create thousands of reusable plugs and suddenly your response sizes are almost 3MB, and something has to give. Reusable Plugs were split off as their own component, away from ItemSockets, as a result of the Plug changes in Shadowkeep that made plug data infeasibly large for the most common use cases. Request this component if and only if you need to know what plugs could be inserted into a socket, and need to know it before "drilling" into the details of an item in your application (for instance, if you're doing some sort of interesting sorting or aggregation based on available plugs. When you get this, you will also need to combine it with "Plug Sets" data if you want a full picture of all of the available plugs: this component will only return plugs that have state data that is per-item. See Plug Sets for available plugs that have Character, Profile, or no state-specific restrictions.

ITEM_SOCKETS = 305 class-attribute instance-attribute

Items can have sockets, where plugs can be inserted. Asking for this component will return all info relevant to the sockets on items that have them.

ITEM_STATS = 304 class-attribute instance-attribute

Items can have stats, like rate of fire. Asking for this component will return requested item's stats if they have stats.

ITEM_TALENT_GRIDS = 306 class-attribute instance-attribute

Items can have talent grids, though that matters a lot less frequently than it used to. Asking for this component will return all relevant info about activated Nodes and Steps on this talent grid, like the good ol' days.

KIOSKS = 500 class-attribute instance-attribute

Asking for this component will return you the account's Kiosk statuses: that is, what items have been filled out/acquired. But only if you are the currently authenticated user or the user has elected to allow anonymous viewing of its progression info.

METRICS = 1100 class-attribute instance-attribute

Returns summary status information about all "Metrics" (also known in the game as "Stat Trackers").

NONE = 0 class-attribute instance-attribute

No description given by bungie.

PLATFORM_SILVER = 105 class-attribute instance-attribute

This will get you information about the silver that this profile has on every platform on which it plays. You may only request this component for the logged in user's Profile, and will not recieve it if you request it for another Profile.

PRESENTATION_NODES = 700 class-attribute instance-attribute

Returns summary status information about all "Presentation Nodes". See DestinyPresentationNodeDefinition for more details, but the gist is that these are entities used by the game UI to bucket Collectibles and Records into a hierarchy of categories. You may ask for and use this data if you want to perform similar bucketing in your own UI: or you can skip it and roll your own.

PROFILES = 100 class-attribute instance-attribute

Profiles is the most basic component, only relevant when calling GetProfile. This returns basic information about the profile, which is almost nothing: a list of characterIds, some information about the last time you logged in, and that most sobering statistic: how long you've played.

PROFILE_CURRENCIES = 103 class-attribute instance-attribute

This will get you a summary of items on your Profile that we consider to be "currencies", such as Glimmer. I mean, if there's Glimmer in Destiny 2. I didn't say there was Glimmer.

PROFILE_INVENTORIES = 102 class-attribute instance-attribute

Asking for this will get you the profile-level inventories, such as your Vault buckets (yeah, the Vault is really inventory buckets located on your Profile)

PROFILE_PROGRESSION = 104 class-attribute instance-attribute

This will get you any progression-related information that exists on a Profile-wide level, across all characters.

RECORDS = 900 class-attribute instance-attribute

Returns summary status information about all "Records" (also known in the game as "Triumphs". I know, it's confusing because there's also "Moments of Triumph" that will themselves be represented as "Triumphs.")

SOCIAL_COMMENDATIONS = 1400 class-attribute instance-attribute

Returns score values for all commendations and commendation nodes.

STRING_VARIABLES = 1200 class-attribute instance-attribute

Returns a mapping of localized string variable hashes to values, on a per-account or per-character basis.

TRANSITORY = 1000 class-attribute instance-attribute

Returns information that Bungie considers to be "Transitory": data that may change too frequently or come from a non-authoritative source such that we don't consider the data to be fully trustworthy, but that might prove useful for some limited use cases. We can provide no guarantee of timeliness nor consistency for this data: buyer beware with the Transitory component.

VENDORS = 400 class-attribute instance-attribute

When obtaining vendor information, this will return summary information about the Vendor or Vendors being returned.

VENDOR_CATEGORIES = 401 class-attribute instance-attribute

When obtaining vendor information, this will return information about the categories of items provided by the Vendor.

VENDOR_RECEIPTS = 101 class-attribute instance-attribute

Only applicable for GetProfile, this will return information about receipts for refundable vendor items.

VENDOR_SALES = 402 class-attribute instance-attribute

When obtaining vendor information, this will return the information about items being sold by the Vendor.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyPresentationNodeState

Bases: BaseFlagEnum

I know this doesn't look like a Flags Enumeration/bitmask right now, but I assure you it is. This is the possible states that a Presentation Node can be in, and it is almost certain that its potential states will increase in the future. So don't treat it like a straight up enumeration.

Source code in src/bungio/models/bungie/destiny/__init__.py
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
class DestinyPresentationNodeState(BaseFlagEnum):
    """
    I know this doesn't look like a Flags Enumeration/bitmask right now, but I assure you it is. This is the possible states that a Presentation Node can be in, and it is almost certain that its potential states will increase in the future. So don't treat it like a straight up enumeration.
    """

    NONE = 0
    """_No description given by bungie._ """
    INVISIBLE = 1
    """If this is set, the game recommends that you not show this node. But you know your life, do what you've got to do. """
    OBSCURED = 2
    """Turns out Presentation Nodes can also be obscured. If they are, this is set. """

INVISIBLE = 1 class-attribute instance-attribute

If this is set, the game recommends that you not show this node. But you know your life, do what you've got to do.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

OBSCURED = 2 class-attribute instance-attribute

Turns out Presentation Nodes can also be obscured. If they are, this is set.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyRecordState

Bases: BaseFlagEnum

A Flags enumeration/bitmask where each bit represents a possible state that a Record/Triumph can be in.

Source code in src/bungio/models/bungie/destiny/__init__.py
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
class DestinyRecordState(BaseFlagEnum):
    """
    A Flags enumeration/bitmask where each bit represents a possible state that a Record/Triumph can be in.
    """

    NONE = 0
    """If there are no flags set, the record is in a state where it *could* be redeemed, but it has not been yet. """
    RECORD_REDEEMED = 1
    """If this is set, the completed record has been redeemed. """
    REWARD_UNAVAILABLE = 2
    """If this is set, there's a reward available from this Record but it's unavailable for redemption. """
    OBJECTIVE_NOT_COMPLETED = 4
    """If this is set, the objective for this Record has not yet been completed. """
    OBSCURED = 8
    """If this is set, the game recommends that you replace the display text of this Record with DestinyRecordDefinition.stateInfo.obscuredDescription. """
    INVISIBLE = 16
    """If this is set, the game recommends that you not show this record. Do what you will with this recommendation. """
    ENTITLEMENT_UNOWNED = 32
    """If this is set, you can't complete this record because you lack some permission that's required to complete it. """
    CAN_EQUIP_TITLE = 64
    """If this is set, the record has a title (check DestinyRecordDefinition for title info) and you can equip it. """

CAN_EQUIP_TITLE = 64 class-attribute instance-attribute

If this is set, the record has a title (check DestinyRecordDefinition for title info) and you can equip it.

ENTITLEMENT_UNOWNED = 32 class-attribute instance-attribute

If this is set, you can't complete this record because you lack some permission that's required to complete it.

INVISIBLE = 16 class-attribute instance-attribute

If this is set, the game recommends that you not show this record. Do what you will with this recommendation.

NONE = 0 class-attribute instance-attribute

If there are no flags set, the record is in a state where it could be redeemed, but it has not been yet.

OBJECTIVE_NOT_COMPLETED = 4 class-attribute instance-attribute

If this is set, the objective for this Record has not yet been completed.

OBSCURED = 8 class-attribute instance-attribute

If this is set, the game recommends that you replace the display text of this Record with DestinyRecordDefinition.stateInfo.obscuredDescription.

RECORD_REDEEMED = 1 class-attribute instance-attribute

If this is set, the completed record has been redeemed.

REWARD_UNAVAILABLE = 2 class-attribute instance-attribute

If this is set, there's a reward available from this Record but it's unavailable for redemption.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyCollectibleState

Bases: BaseFlagEnum

A Flags Enumeration/bitmask where each bit represents a different state that the Collectible can be in. A collectible can be in any number of these states, and you can choose to use or ignore any or all of them when making your own UI that shows Collectible info. Our displays are going to honor them, but we're also the kind of people who only pretend to inhale before quickly passing it to the left. So, you know, do what you got to do. (All joking aside, please note the caveat I mention around the Invisible flag: there are cases where it is in the best interest of your users to honor these flags even if you're a "show all the data" person. Collector-oriented compulsion is a very unfortunate and real thing, and I would hate to instill that compulsion in others through showing them items that they cannot earn. Please consider this when you are making your own apps/sites.)

Source code in src/bungio/models/bungie/destiny/__init__.py
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
class DestinyCollectibleState(BaseFlagEnum):
    """
    A Flags Enumeration/bitmask where each bit represents a different state that the Collectible can be in. A collectible can be in any number of these states, and you can choose to use or ignore any or all of them when making your own UI that shows Collectible info. Our displays are going to honor them, but we're also the kind of people who only pretend to inhale before quickly passing it to the left. So, you know, do what you got to do. (All joking aside, please note the caveat I mention around the Invisible flag: there are cases where it is in the best interest of your users to honor these flags even if you're a "show all the data" person. Collector-oriented compulsion is a very unfortunate and real thing, and I would hate to instill that compulsion in others through showing them items that they cannot earn. Please consider this when you are making your own apps/sites.)
    """

    NONE = 0
    """_No description given by bungie._ """
    NOT_ACQUIRED = 1
    """If this flag is set, you have not yet obtained this collectible. """
    OBSCURED = 2
    """If this flag is set, the item is "obscured" to you: you can/should use the alternate item hash found in DestinyCollectibleDefinition.stateInfo.obscuredOverrideItemHash when displaying this collectible instead of the default display info. """
    INVISIBLE = 4
    """If this flag is set, the collectible should not be shown to the user. Please do consider honoring this flag. It is used - for example - to hide items that a person didn't get from the Eververse. I can't prevent these from being returned in definitions, because some people may have acquired them and thus they should show up: but I would hate for people to start feeling some variant of a Collector's Remorse about these items, and thus increasing their purchasing based on that compulsion. That would be a very unfortunate outcome, and one that I wouldn't like to see happen. So please, whether or not I'm your mom, consider honoring this flag and don't show people invisible collectibles. """
    CANNOT_AFFORD_MATERIAL_REQUIREMENTS = 8
    """If this flag is set, the collectible requires payment for creating an instance of the item, and you are lacking in currency. Bring the benjamins next time. Or spinmetal. Whatever. """
    INVENTORY_SPACE_UNAVAILABLE = 16
    """If this flag is set, you can't pull this item out of your collection because there's no room left in your inventory. """
    UNIQUENESS_VIOLATION = 32
    """If this flag is set, you already have one of these items and can't have a second one. """
    PURCHASE_DISABLED = 64
    """If this flag is set, the ability to pull this item out of your collection has been disabled. """

CANNOT_AFFORD_MATERIAL_REQUIREMENTS = 8 class-attribute instance-attribute

If this flag is set, the collectible requires payment for creating an instance of the item, and you are lacking in currency. Bring the benjamins next time. Or spinmetal. Whatever.

INVENTORY_SPACE_UNAVAILABLE = 16 class-attribute instance-attribute

If this flag is set, you can't pull this item out of your collection because there's no room left in your inventory.

INVISIBLE = 4 class-attribute instance-attribute

If this flag is set, the collectible should not be shown to the user. Please do consider honoring this flag. It is used - for example - to hide items that a person didn't get from the Eververse. I can't prevent these from being returned in definitions, because some people may have acquired them and thus they should show up: but I would hate for people to start feeling some variant of a Collector's Remorse about these items, and thus increasing their purchasing based on that compulsion. That would be a very unfortunate outcome, and one that I wouldn't like to see happen. So please, whether or not I'm your mom, consider honoring this flag and don't show people invisible collectibles.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

NOT_ACQUIRED = 1 class-attribute instance-attribute

If this flag is set, you have not yet obtained this collectible.

OBSCURED = 2 class-attribute instance-attribute

If this flag is set, the item is "obscured" to you: you can/should use the alternate item hash found in DestinyCollectibleDefinition.stateInfo.obscuredOverrideItemHash when displaying this collectible instead of the default display info.

PURCHASE_DISABLED = 64 class-attribute instance-attribute

If this flag is set, the ability to pull this item out of your collection has been disabled.

UNIQUENESS_VIOLATION = 32 class-attribute instance-attribute

If this flag is set, you already have one of these items and can't have a second one.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyPartyMemberStates

Bases: BaseFlagEnum

A flags enumeration that represents a Fireteam Member's status.

Source code in src/bungio/models/bungie/destiny/__init__.py
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
class DestinyPartyMemberStates(BaseFlagEnum):
    """
    A flags enumeration that represents a Fireteam Member's status.
    """

    NONE = 0
    """_No description given by bungie._ """
    FIRETEAM_MEMBER = 1
    """This one's pretty obvious - they're on your Fireteam. """
    POSSE_MEMBER = 2
    """I don't know what it means to be in a 'Posse', but apparently this is it. """
    GROUP_MEMBER = 4
    """Nor do I understand the difference between them being in a 'Group' vs. a 'Fireteam'. I'll update these docs once I get more info. If I get more info. If you're reading this, I never got more info. You're on your own, kid. """
    PARTY_LEADER = 8
    """This person is the party leader. """

FIRETEAM_MEMBER = 1 class-attribute instance-attribute

This one's pretty obvious - they're on your Fireteam.

GROUP_MEMBER = 4 class-attribute instance-attribute

Nor do I understand the difference between them being in a 'Group' vs. a 'Fireteam'. I'll update these docs once I get more info. If I get more info. If you're reading this, I never got more info. You're on your own, kid.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

PARTY_LEADER = 8 class-attribute instance-attribute

This person is the party leader.

POSSE_MEMBER = 2 class-attribute instance-attribute

I don't know what it means to be in a 'Posse', but apparently this is it.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyGamePrivacySetting

Bases: BaseEnum

A player can choose to restrict requests to join their Fireteam to specific states. These are the possible states a user can choose.

Source code in src/bungio/models/bungie/destiny/__init__.py
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
class DestinyGamePrivacySetting(BaseEnum):
    """
    A player can choose to restrict requests to join their Fireteam to specific states. These are the possible states a user can choose.
    """

    OPEN = 0
    """_No description given by bungie._ """
    CLAN_AND_FRIENDS_ONLY = 1
    """_No description given by bungie._ """
    FRIENDS_ONLY = 2
    """_No description given by bungie._ """
    INVITATION_ONLY = 3
    """_No description given by bungie._ """
    CLOSED = 4
    """_No description given by bungie._ """

CLAN_AND_FRIENDS_ONLY = 1 class-attribute instance-attribute

No description given by bungie.

CLOSED = 4 class-attribute instance-attribute

No description given by bungie.

FRIENDS_ONLY = 2 class-attribute instance-attribute

No description given by bungie.

INVITATION_ONLY = 3 class-attribute instance-attribute

No description given by bungie.

OPEN = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyJoinClosedReasons

Bases: BaseFlagEnum

A Flags enumeration representing the reasons why a person can't join this user's fireteam.

Source code in src/bungio/models/bungie/destiny/__init__.py
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
class DestinyJoinClosedReasons(BaseFlagEnum):
    """
    A Flags enumeration representing the reasons why a person can't join this user's fireteam.
    """

    NONE = 0
    """_No description given by bungie._ """
    IN_MATCHMAKING = 1
    """The user is currently in matchmaking. """
    LOADING = 2
    """The user is currently in a loading screen. """
    SOLO_MODE = 4
    """The user is in an activity that requires solo play. """
    INTERNAL_REASONS = 8
    """The user can't be joined for one of a variety of internal reasons. Basically, the game can't let you join at this time, but for reasons that aren't under the control of this user. """
    DISALLOWED_BY_GAME_STATE = 16
    """The user's current activity/quest/other transitory game state is preventing joining. """
    OFFLINE = 32768
    """The user appears to be offline. """

DISALLOWED_BY_GAME_STATE = 16 class-attribute instance-attribute

The user's current activity/quest/other transitory game state is preventing joining.

INTERNAL_REASONS = 8 class-attribute instance-attribute

The user can't be joined for one of a variety of internal reasons. Basically, the game can't let you join at this time, but for reasons that aren't under the control of this user.

IN_MATCHMAKING = 1 class-attribute instance-attribute

The user is currently in matchmaking.

LOADING = 2 class-attribute instance-attribute

The user is currently in a loading screen.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

OFFLINE = 32768 class-attribute instance-attribute

The user appears to be offline.

SOLO_MODE = 4 class-attribute instance-attribute

The user is in an activity that requires solo play.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyRace

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
class DestinyRace(BaseEnum):
    """
    _No description given by bungie._
    """

    HUMAN = 0
    """_No description given by bungie._ """
    AWOKEN = 1
    """_No description given by bungie._ """
    EXO = 2
    """_No description given by bungie._ """
    UNKNOWN = 3
    """_No description given by bungie._ """

AWOKEN = 1 class-attribute instance-attribute

No description given by bungie.

EXO = 2 class-attribute instance-attribute

No description given by bungie.

HUMAN = 0 class-attribute instance-attribute

No description given by bungie.

UNKNOWN = 3 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyActivity

Bases: BaseModel

Represents the "Live" data that we can obtain about a Character's status with a specific Activity. This will tell you whether the character can participate in the activity, as well as some other basic mutable information. Meant to be combined with static DestinyActivityDefinition data for a full picture of the Activity.

Manifest Information

This model has some attributes which can be filled with additional information found in the manifest (manifest_...). Without additional work, these attributes will be None, since they require additional requests and database lookups.

To fill the manifest dependent attributes, either:

  • Run await ThisClass.fetch_manifest_information(), see here
  • Set Client.always_return_manifest_information to True, see here

Attributes:

Name Type Description
activity_hash int

The hash identifier of the Activity. Use this to look up the DestinyActivityDefinition of the activity.

boolean_activity_options dict[int, bool]

The set of activity options for this activity, keyed by an identifier that's unique for this activity (not guaranteed to be unique between or across all activities, though should be unique for every variant of a given conceptual activity: for instance, the original D2 Raid has many variant DestinyActivityDefinitions. While other activities could potentially have the same option hashes, for any given D2 base Raid variant the hash will be unique). As a concrete example of this data, the hashes you get for Raids will correspond to the currently active "Challenge Mode". We don't have any human readable information for these, but savvy 3rd party app users could manually associate the key (a hash identifier for the "option" that is enabled/disabled) and the value (whether it's enabled or disabled presently) On our side, we don't necessarily even know what these are used for (the game designers know, but we don't), and we have no human readable data for them. In order to use them, you will have to do some experimentation.

can_join bool

If true, the user is allowed to join with another Fireteam in this activity.

can_lead bool

If true, the user is allowed to lead a Fireteam into this activity.

challenges list[DestinyChallengeStatus]

No description given by bungie.

difficulty_tier Union[DestinyActivityDifficultyTier, int]

A DestinyActivityDifficultyTier enum value indicating the difficulty of the activity.

display_level int

The difficulty level of the activity, if applicable.

fireteam_requirement_failure_indices list[int]

Indexes of failure if this activity is inaccessible as a fireteam member

is_completed bool

If true, we both have the ability to know that the user has completed this activity and they have completed it. Unfortunately, we can't necessarily know this for all activities. As such, this should probably only be used if you already know in advance which specific activities you wish to check.

is_focused_activity bool

Whether or not this activity is currently in the "featured" carousel of the Portal

is_new bool

If true, then the activity should have a "new" indicator in the Director UI.

is_visible bool

If true, the user should be able to see this activity.

leader_requirement_failure_indices list[int]

Indexes of failure if this activity is inaccessible as a fireteam leader

loadout_requirement_index int

If returned, this is the index into the DestinyActivityDefinition's "loadouts" property, indicating the currently active loadout requirements.

modifier_hashes list[int]

If the activity has modifiers, this will be the list of modifiers that all variants have in common. Perform lookups against DestinyActivityModifierDefinition which defines the modifier being applied to get at the modifier data. Note that, in the DestinyActivityDefinition, you will see many more modifiers than this being referred to: those are all possible modifiers for the activity, not the active ones. Use only the active ones to match what's really live.

recommended_light int

The recommended light level for the activity, if applicable.

visible_rewards list[DestinyActivityRewardMapping]

A filtered list of reward mappings with only the currently visible reward items.

manifest_activity_hash Optional[DestinyActivityDefinition]

Manifest information for activity_hash

Source code in src/bungio/models/bungie/destiny/__init__.py
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
@custom_define()
class DestinyActivity(BaseModel):
    """
    Represents the "Live" data that we can obtain about a Character's status with a specific Activity. This will tell you whether the character can participate in the activity, as well as some other basic mutable information.  Meant to be combined with static DestinyActivityDefinition data for a full picture of the Activity.

    Tip: Manifest Information
        This model has some attributes which can be filled with additional information found in the manifest (`manifest_...`).
        Without additional work, these attributes will be `None`, since they require additional requests and database lookups.

        To fill the manifest dependent attributes, either:

        - Run `await ThisClass.fetch_manifest_information()`, see [here](/API Reference/Models/base)
        - Set `Client.always_return_manifest_information` to `True`, see [here](/API Reference/client)

    Attributes:
        activity_hash: The hash identifier of the Activity. Use this to look up the DestinyActivityDefinition of the activity.
        boolean_activity_options: The set of activity options for this activity, keyed by an identifier that's unique for this activity (not guaranteed to be unique between or across all activities, though should be unique for every *variant* of a given *conceptual* activity: for instance, the original D2 Raid has many variant DestinyActivityDefinitions. While other activities could potentially have the same option hashes, for any given D2 base Raid variant the hash will be unique). As a concrete example of this data, the hashes you get for Raids will correspond to the currently active "Challenge Mode". We don't have any human readable information for these, but savvy 3rd party app users could manually associate the key (a hash identifier for the "option" that is enabled/disabled) and the value (whether it's enabled or disabled presently) On our side, we don't necessarily even know what these are used for (the game designers know, but we don't), and we have no human readable data for them. In order to use them, you will have to do some experimentation.
        can_join: If true, the user is allowed to join with another Fireteam in this activity.
        can_lead: If true, the user is allowed to lead a Fireteam into this activity.
        challenges: _No description given by bungie._
        difficulty_tier: A DestinyActivityDifficultyTier enum value indicating the difficulty of the activity.
        display_level: The difficulty level of the activity, if applicable.
        fireteam_requirement_failure_indices: Indexes of failure if this activity is inaccessible as a fireteam member
        is_completed: If true, we both have the ability to know that the user has completed this activity and they have completed it. Unfortunately, we can't necessarily know this for all activities. As such, this should probably only be used if you already know in advance which specific activities you wish to check.
        is_focused_activity: Whether or not this activity is currently in the "featured" carousel of the Portal
        is_new: If true, then the activity should have a "new" indicator in the Director UI.
        is_visible: If true, the user should be able to see this activity.
        leader_requirement_failure_indices: Indexes of failure if this activity is inaccessible as a fireteam leader
        loadout_requirement_index: If returned, this is the index into the DestinyActivityDefinition's "loadouts" property, indicating the currently active loadout requirements.
        modifier_hashes: If the activity has modifiers, this will be the list of modifiers that all variants have in common. Perform lookups against DestinyActivityModifierDefinition which defines the modifier being applied to get at the modifier data. Note that, in the DestinyActivityDefinition, you will see many more modifiers than this being referred to: those are all *possible* modifiers for the activity, not the active ones. Use only the active ones to match what's really live.
        recommended_light: The recommended light level for the activity, if applicable.
        visible_rewards: A filtered list of reward mappings with only the currently visible reward items.
        manifest_activity_hash: Manifest information for `activity_hash`
    """

    activity_hash: int = custom_field()
    boolean_activity_options: dict[int, bool] = custom_field(metadata={"type": """dict[int, bool]"""})
    can_join: bool = custom_field()
    can_lead: bool = custom_field()
    challenges: list["DestinyChallengeStatus"] = custom_field(metadata={"type": """list[DestinyChallengeStatus]"""})
    difficulty_tier: Union["DestinyActivityDifficultyTier", int] = custom_field(
        converter=enum_converter("DestinyActivityDifficultyTier")
    )
    display_level: int = custom_field()
    fireteam_requirement_failure_indices: list[int] = custom_field(metadata={"type": """list[int]"""})
    is_completed: bool = custom_field()
    is_focused_activity: bool = custom_field()
    is_new: bool = custom_field()
    is_visible: bool = custom_field()
    leader_requirement_failure_indices: list[int] = custom_field(metadata={"type": """list[int]"""})
    loadout_requirement_index: int = custom_field()
    modifier_hashes: list[int] = custom_field(metadata={"type": """list[int]"""})
    recommended_light: int = custom_field()
    visible_rewards: list["DestinyActivityRewardMapping"] = custom_field(
        metadata={"type": """list[DestinyActivityRewardMapping]"""}
    )
    manifest_activity_hash: Optional["DestinyActivityDefinition"] = custom_field(default=None)

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyActivityDifficultyTier

Bases: BaseEnum

An enumeration representing the potential difficulty levels of an activity. Their names are... more qualitative than quantitative.

Source code in src/bungio/models/bungie/destiny/__init__.py
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
class DestinyActivityDifficultyTier(BaseEnum):
    """
    An enumeration representing the potential difficulty levels of an activity. Their names are... more qualitative than quantitative.
    """

    TRIVIAL = 0
    """_No description given by bungie._ """
    EASY = 1
    """_No description given by bungie._ """
    NORMAL = 2
    """_No description given by bungie._ """
    CHALLENGING = 3
    """_No description given by bungie._ """
    HARD = 4
    """_No description given by bungie._ """
    BRAVE = 5
    """_No description given by bungie._ """
    ALMOST_IMPOSSIBLE = 6
    """_No description given by bungie._ """
    IMPOSSIBLE = 7
    """_No description given by bungie._ """

ALMOST_IMPOSSIBLE = 6 class-attribute instance-attribute

No description given by bungie.

BRAVE = 5 class-attribute instance-attribute

No description given by bungie.

CHALLENGING = 3 class-attribute instance-attribute

No description given by bungie.

EASY = 1 class-attribute instance-attribute

No description given by bungie.

HARD = 4 class-attribute instance-attribute

No description given by bungie.

IMPOSSIBLE = 7 class-attribute instance-attribute

No description given by bungie.

NORMAL = 2 class-attribute instance-attribute

No description given by bungie.

TRIVIAL = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyActivityRewardDisplayMode

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
class DestinyActivityRewardDisplayMode(BaseEnum):
    """
    _No description given by bungie._
    """

    AGGREGATE = 0
    """_No description given by bungie._ """
    PICK_FIRST = 1
    """_No description given by bungie._ """
    COUNT = 2
    """_No description given by bungie._ """

AGGREGATE = 0 class-attribute instance-attribute

No description given by bungie.

COUNT = 2 class-attribute instance-attribute

No description given by bungie.

PICK_FIRST = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyActivityDifficultyTierCollectionComponent

Bases: BaseModel

No description given by bungie.

Manifest Information

This model has some attributes which can be filled with additional information found in the manifest (manifest_...). Without additional work, these attributes will be None, since they require additional requests and database lookups.

To fill the manifest dependent attributes, either:

  • Run await ThisClass.fetch_manifest_information(), see here
  • Set Client.always_return_manifest_information to True, see here

Attributes:

Name Type Description
difficulty_tier_collection_hash int

No description given by bungie.

difficulty_tiers list[dict]

No description given by bungie.

manifest_difficulty_tier_collection_hash Optional[DestinyActivityDifficultyTierCollectionDefinition]

Manifest information for difficulty_tier_collection_hash

Source code in src/bungio/models/bungie/destiny/__init__.py
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
@custom_define()
class DestinyActivityDifficultyTierCollectionComponent(BaseModel):
    """
    _No description given by bungie._

    Tip: Manifest Information
        This model has some attributes which can be filled with additional information found in the manifest (`manifest_...`).
        Without additional work, these attributes will be `None`, since they require additional requests and database lookups.

        To fill the manifest dependent attributes, either:

        - Run `await ThisClass.fetch_manifest_information()`, see [here](/API Reference/Models/base)
        - Set `Client.always_return_manifest_information` to `True`, see [here](/API Reference/client)

    Attributes:
        difficulty_tier_collection_hash: _No description given by bungie._
        difficulty_tiers: _No description given by bungie._
        manifest_difficulty_tier_collection_hash: Manifest information for `difficulty_tier_collection_hash`
    """

    difficulty_tier_collection_hash: int = custom_field()
    difficulty_tiers: list[dict] = custom_field(metadata={"type": """list[dict]"""})
    manifest_difficulty_tier_collection_hash: Optional["DestinyActivityDifficultyTierCollectionDefinition"] = (
        custom_field(default=None)
    )

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyActivityDifficultyTierComponent

Bases: BaseModel

No description given by bungie.

None Attributes: difficulty_tier_index: No description given by bungie. fixed_activity_skulls: No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
@custom_define()
class DestinyActivityDifficultyTierComponent(BaseModel):
    """
    _No description given by bungie._

    None
    Attributes:
        difficulty_tier_index: _No description given by bungie._
        fixed_activity_skulls: _No description given by bungie._
    """

    difficulty_tier_index: int = custom_field()
    fixed_activity_skulls: list[dict] = custom_field(metadata={"type": """list[dict]"""})

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyActivitySkullComponent

Bases: BaseModel, HashObject

No description given by bungie.

None Attributes: hash: No description given by bungie. is_enabled: No description given by bungie. skull_identifier_hash: No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
@custom_define()
class DestinyActivitySkullComponent(BaseModel, HashObject):
    """
    _No description given by bungie._

    None
    Attributes:
        hash: _No description given by bungie._
        is_enabled: _No description given by bungie._
        skull_identifier_hash: _No description given by bungie._
    """

    is_enabled: bool = custom_field()
    skull_identifier_hash: int = custom_field()

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyActivitySelectableSkullCollectionComponent

Bases: BaseModel

No description given by bungie.

Manifest Information

This model has some attributes which can be filled with additional information found in the manifest (manifest_...). Without additional work, these attributes will be None, since they require additional requests and database lookups.

To fill the manifest dependent attributes, either:

  • Run await ThisClass.fetch_manifest_information(), see here
  • Set Client.always_return_manifest_information to True, see here

Attributes:

Name Type Description
selectable_skull_collection_hash int

No description given by bungie.

selectable_skulls list[dict]

No description given by bungie.

manifest_selectable_skull_collection_hash Optional[DestinyActivitySelectableSkullCollectionDefinition]

Manifest information for selectable_skull_collection_hash

Source code in src/bungio/models/bungie/destiny/__init__.py
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
@custom_define()
class DestinyActivitySelectableSkullCollectionComponent(BaseModel):
    """
    _No description given by bungie._

    Tip: Manifest Information
        This model has some attributes which can be filled with additional information found in the manifest (`manifest_...`).
        Without additional work, these attributes will be `None`, since they require additional requests and database lookups.

        To fill the manifest dependent attributes, either:

        - Run `await ThisClass.fetch_manifest_information()`, see [here](/API Reference/Models/base)
        - Set `Client.always_return_manifest_information` to `True`, see [here](/API Reference/client)

    Attributes:
        selectable_skull_collection_hash: _No description given by bungie._
        selectable_skulls: _No description given by bungie._
        manifest_selectable_skull_collection_hash: Manifest information for `selectable_skull_collection_hash`
    """

    selectable_skull_collection_hash: int = custom_field()
    selectable_skulls: list[dict] = custom_field(metadata={"type": """list[dict]"""})
    manifest_selectable_skull_collection_hash: Optional["DestinyActivitySelectableSkullCollectionDefinition"] = (
        custom_field(default=None)
    )

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

EquipFailureReason

Bases: BaseFlagEnum

The reasons why an item cannot be equipped, if any. Many flags can be set, or "None" if

Source code in src/bungio/models/bungie/destiny/__init__.py
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
class EquipFailureReason(BaseFlagEnum):
    """
    The reasons why an item cannot be equipped, if any. Many flags can be set, or "None" if
    """

    NONE = 0
    """The item is/was able to be equipped. """
    ITEM_UNEQUIPPABLE = 1
    """This is not the kind of item that can be equipped. Did you try equipping Glimmer or something? """
    ITEM_UNIQUE_EQUIP_RESTRICTED = 2
    """This item is part of a "unique set", and you can't have more than one item of that same set type equipped at once. For instance, if you already have an Exotic Weapon equipped, you can't equip a second one in another weapon slot. """
    ITEM_FAILED_UNLOCK_CHECK = 4
    """This item has state-based gating that prevents it from being equipped in certain circumstances. For instance, an item might be for Warlocks only and you're a Titan, or it might require you to have beaten some special quest that you haven't beaten yet. Use the additional failure data passed on the item itself to get more information about what the specific failure case was (See DestinyInventoryItemDefinition and DestinyItemInstanceComponent) """
    ITEM_FAILED_LEVEL_CHECK = 8
    """This item requires you to have reached a specific character level in order to equip it, and you haven't reached that level yet. """
    ITEM_WRAPPED = 16
    """This item is 'wrapped' and must be unwrapped before being equipped. NOTE: This value used to be called ItemNotOnCharacter but that is no longer accurate. """
    ITEM_NOT_LOADED = 32
    """This item is not yet loaded and cannot be equipped yet. """
    ITEM_EQUIP_BLOCKLISTED = 64
    """This item is block-listed and cannot be equipped. """
    ITEM_LOADOUT_REQUIREMENT_NOT_MET = 128
    """This item does not meet the loadout requirements for the current activity """

ITEM_EQUIP_BLOCKLISTED = 64 class-attribute instance-attribute

This item is block-listed and cannot be equipped.

ITEM_FAILED_LEVEL_CHECK = 8 class-attribute instance-attribute

This item requires you to have reached a specific character level in order to equip it, and you haven't reached that level yet.

ITEM_FAILED_UNLOCK_CHECK = 4 class-attribute instance-attribute

This item has state-based gating that prevents it from being equipped in certain circumstances. For instance, an item might be for Warlocks only and you're a Titan, or it might require you to have beaten some special quest that you haven't beaten yet. Use the additional failure data passed on the item itself to get more information about what the specific failure case was (See DestinyInventoryItemDefinition and DestinyItemInstanceComponent)

ITEM_LOADOUT_REQUIREMENT_NOT_MET = 128 class-attribute instance-attribute

This item does not meet the loadout requirements for the current activity

ITEM_NOT_LOADED = 32 class-attribute instance-attribute

This item is not yet loaded and cannot be equipped yet.

ITEM_UNEQUIPPABLE = 1 class-attribute instance-attribute

This is not the kind of item that can be equipped. Did you try equipping Glimmer or something?

ITEM_UNIQUE_EQUIP_RESTRICTED = 2 class-attribute instance-attribute

This item is part of a "unique set", and you can't have more than one item of that same set type equipped at once. For instance, if you already have an Exotic Weapon equipped, you can't equip a second one in another weapon slot.

ITEM_WRAPPED = 16 class-attribute instance-attribute

This item is 'wrapped' and must be unwrapped before being equipped. NOTE: This value used to be called ItemNotOnCharacter but that is no longer accurate.

NONE = 0 class-attribute instance-attribute

The item is/was able to be equipped.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyTalentNode

Bases: BaseModel

I see you've come to find out more about Talent Nodes. I'm so sorry. Talent Nodes are the conceptual, visual nodes that appear on Talent Grids. Talent Grids, in Destiny 1, were found on almost every instanced item: they had Nodes that could be activated to change the properties of the item. In Destiny 2, Talent Grids only exist for Builds/Subclasses, and while the basic concept is the same (Nodes can be activated once you've gained sufficient Experience on the Item, and provide effects), there are some new concepts from Destiny 1. Examine DestinyTalentGridDefinition and its subordinates for more information. This is the "Live" information for the current status of a Talent Node on a specific item. Talent Nodes have many Steps, but only one can be active at any one time: and it is the Step that determines both the visual and the game state-changing properties that the Node provides. Examine this and DestinyTalentNodeStepDefinition carefully. IMPORTANT NOTE Talent Nodes are, unfortunately, Content Version DEPENDENT. Though they refer to hashes for Nodes and Steps, those hashes are not guaranteed to be immutable across content versions. This is a source of great exasperation for me, but as a result anyone using Talent Grid data must ensure that the content version of their static content matches that of the server responses before showing or making decisions based on talent grid data.

None Attributes: activation_grid_level: The progression level required on the Talent Grid in order to be able to activate this talent node. Talent Grids have their own Progression - similar to Character Level, but in this case it is experience related to the item itself. hidden: Whether or not the talent node is actually visible in the game's UI. Whether you want to show it in your own UI is up to you! I'm not gonna tell you who to sock it to. is_activated: If true, the node is activated: it's current step then provides its benefits. materials_to_upgrade: If the node has material requirements to be activated, this is the list of those requirements. node_hash: The hash of the Talent Node being referred to (in DestinyTalentGridDefinition.nodes). Deceptively CONTENT VERSION DEPENDENT. We have no guarantee of the hash's immutability between content versions. node_index: The index of the Talent Node being referred to (an index into DestinyTalentGridDefinition.nodes[]). CONTENT VERSION DEPENDENT. node_stats_block: This property has some history. A talent grid can provide stats on both the item it's related to and the character equipping the item. This returns data about those stat bonuses. progress_percent: If you want to show a progress bar or circle for how close this talent node is to being activate-able, this is the percentage to show. It follows the node's underlying rules about when the progress bar should first show up, and when it should be filled. state: An DestinyTalentNodeState enum value indicating the node's state: whether it can be activated or swapped, and why not if neither can be performed. step_index: The currently relevant Step for the node. It is this step that has rendering data for the node and the benefits that are provided if the node is activated. (the actual rules for benefits provided are extremely complicated in theory, but with how Talent Grids are being used in Destiny 2 you don't have to worry about a lot of those old Destiny 1 rules.) This is an index into: DestinyTalentGridDefinition.nodes[nodeIndex].steps[stepIndex]

Source code in src/bungio/models/bungie/destiny/__init__.py
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
@custom_define()
class DestinyTalentNode(BaseModel):
    """
    I see you've come to find out more about Talent Nodes. I'm so sorry. Talent Nodes are the conceptual, visual nodes that appear on Talent Grids. Talent Grids, in Destiny 1, were found on almost every instanced item: they had Nodes that could be activated to change the properties of the item. In Destiny 2, Talent Grids only exist for Builds/Subclasses, and while the basic concept is the same (Nodes can be activated once you've gained sufficient Experience on the Item, and provide effects), there are some new concepts from Destiny 1. Examine DestinyTalentGridDefinition and its subordinates for more information. This is the "Live" information for the current status of a Talent Node on a specific item. Talent Nodes have many Steps, but only one can be active at any one time: and it is the Step that determines both the visual and the game state-changing properties that the Node provides. Examine this and DestinyTalentNodeStepDefinition carefully. *IMPORTANT NOTE* Talent Nodes are, unfortunately, Content Version DEPENDENT. Though they refer to hashes for Nodes and Steps, those hashes are not guaranteed to be immutable across content versions. This is a source of great exasperation for me, but as a result anyone using Talent Grid data must ensure that the content version of their static content matches that of the server responses before showing or making decisions based on talent grid data.

    None
    Attributes:
        activation_grid_level: The progression level required on the Talent Grid in order to be able to activate this talent node. Talent Grids have their own Progression - similar to Character Level, but in this case it is experience related to the item itself.
        hidden: Whether or not the talent node is actually visible in the game's UI. Whether you want to show it in your own UI is up to you! I'm not gonna tell you who to sock it to.
        is_activated: If true, the node is activated: it's current step then provides its benefits.
        materials_to_upgrade: If the node has material requirements to be activated, this is the list of those requirements.
        node_hash: The hash of the Talent Node being referred to (in DestinyTalentGridDefinition.nodes). Deceptively CONTENT VERSION DEPENDENT. We have no guarantee of the hash's immutability between content versions.
        node_index: The index of the Talent Node being referred to (an index into DestinyTalentGridDefinition.nodes[]). CONTENT VERSION DEPENDENT.
        node_stats_block: This property has some history. A talent grid can provide stats on both the item it's related to and the character equipping the item. This returns data about those stat bonuses.
        progress_percent: If you want to show a progress bar or circle for how close this talent node is to being activate-able, this is the percentage to show. It follows the node's underlying rules about when the progress bar should first show up, and when it should be filled.
        state: An DestinyTalentNodeState enum value indicating the node's state: whether it can be activated or swapped, and why not if neither can be performed.
        step_index: The currently relevant Step for the node. It is this step that has rendering data for the node and the benefits that are provided if the node is activated. (the actual rules for benefits provided are extremely complicated in theory, but with how Talent Grids are being used in Destiny 2 you don't have to worry about a lot of those old Destiny 1 rules.) This is an index into: DestinyTalentGridDefinition.nodes[nodeIndex].steps[stepIndex]
    """

    activation_grid_level: int = custom_field()
    hidden: bool = custom_field()
    is_activated: bool = custom_field()
    materials_to_upgrade: list["DestinyMaterialRequirement"] = custom_field(
        metadata={"type": """list[DestinyMaterialRequirement]"""}
    )
    node_hash: int = custom_field()
    node_index: int = custom_field()
    node_stats_block: "DestinyTalentNodeStatBlock" = custom_field()
    progress_percent: float = custom_field()
    state: Union["DestinyTalentNodeState", int] = custom_field(converter=enum_converter("DestinyTalentNodeState"))
    step_index: int = custom_field()

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyTalentNodeState

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
class DestinyTalentNodeState(BaseEnum):
    """
    _No description given by bungie._
    """

    INVALID = 0
    """_No description given by bungie._ """
    CAN_UPGRADE = 1
    """_No description given by bungie._ """
    NO_POINTS = 2
    """_No description given by bungie._ """
    NO_PREREQUISITES = 3
    """_No description given by bungie._ """
    NO_STEPS = 4
    """_No description given by bungie._ """
    NO_UNLOCK = 5
    """_No description given by bungie._ """
    NO_MATERIAL = 6
    """_No description given by bungie._ """
    NO_GRID_LEVEL = 7
    """_No description given by bungie._ """
    SWAPPING_LOCKED = 8
    """_No description given by bungie._ """
    MUST_SWAP = 9
    """_No description given by bungie._ """
    COMPLETE = 10
    """_No description given by bungie._ """
    UNKNOWN = 11
    """_No description given by bungie._ """
    CREATION_ONLY = 12
    """_No description given by bungie._ """
    HIDDEN = 13
    """_No description given by bungie._ """

CAN_UPGRADE = 1 class-attribute instance-attribute

No description given by bungie.

COMPLETE = 10 class-attribute instance-attribute

No description given by bungie.

CREATION_ONLY = 12 class-attribute instance-attribute

No description given by bungie.

HIDDEN = 13 class-attribute instance-attribute

No description given by bungie.

INVALID = 0 class-attribute instance-attribute

No description given by bungie.

MUST_SWAP = 9 class-attribute instance-attribute

No description given by bungie.

NO_GRID_LEVEL = 7 class-attribute instance-attribute

No description given by bungie.

NO_MATERIAL = 6 class-attribute instance-attribute

No description given by bungie.

NO_POINTS = 2 class-attribute instance-attribute

No description given by bungie.

NO_PREREQUISITES = 3 class-attribute instance-attribute

No description given by bungie.

NO_STEPS = 4 class-attribute instance-attribute

No description given by bungie.

NO_UNLOCK = 5 class-attribute instance-attribute

No description given by bungie.

SWAPPING_LOCKED = 8 class-attribute instance-attribute

No description given by bungie.

UNKNOWN = 11 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyTalentNodeStatBlock

Bases: BaseModel

This property has some history. A talent grid can provide stats on both the item it's related to and the character equipping the item. This returns data about those stat bonuses.

None Attributes: current_step_stats: The stat benefits conferred when this talent node is activated for the current Step that is active on the node. next_step_stats: This is a holdover from the old days of Destiny 1, when a node could be activated multiple times, conferring multiple steps worth of benefits: you would use this property to show what activating the "next" step on the node would provide vs. what the current step is providing. While Nodes are currently not being used this way, the underlying system for this functionality still exists. I hesitate to remove this property while the ability for designers to make such a talent grid still exists. Whether you want to show it is up to you.

Source code in src/bungio/models/bungie/destiny/__init__.py
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
@custom_define()
class DestinyTalentNodeStatBlock(BaseModel):
    """
    This property has some history. A talent grid can provide stats on both the item it's related to and the character equipping the item. This returns data about those stat bonuses.

    None
    Attributes:
        current_step_stats: The stat benefits conferred when this talent node is activated for the current Step that is active on the node.
        next_step_stats: This is a holdover from the old days of Destiny 1, when a node could be activated multiple times, conferring multiple steps worth of benefits: you would use this property to show what activating the "next" step on the node would provide vs. what the current step is providing. While Nodes are currently not being used this way, the underlying system for this functionality still exists. I hesitate to remove this property while the ability for designers to make such a talent grid still exists. Whether you want to show it is up to you.
    """

    current_step_stats: list["DestinyStat"] = custom_field(metadata={"type": """list[DestinyStat]"""})
    next_step_stats: list["DestinyStat"] = custom_field(metadata={"type": """list[DestinyStat]"""})

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyVendorFilter

Bases: BaseEnum

Indicates the type of filter to apply to Vendor results.

Source code in src/bungio/models/bungie/destiny/__init__.py
1856
1857
1858
1859
1860
1861
1862
1863
1864
class DestinyVendorFilter(BaseEnum):
    """
    Indicates the type of filter to apply to Vendor results.
    """

    NONE = 0
    """_No description given by bungie._ """
    API_PURCHASABLE = 1
    """_No description given by bungie._ """

API_PURCHASABLE = 1 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

VendorItemStatus

Bases: BaseFlagEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
class VendorItemStatus(BaseFlagEnum):
    """
    _No description given by bungie._
    """

    SUCCESS = 0
    """_No description given by bungie._ """
    NO_INVENTORY_SPACE = 1
    """_No description given by bungie._ """
    NO_FUNDS = 2
    """_No description given by bungie._ """
    NO_PROGRESSION = 4
    """_No description given by bungie._ """
    NO_UNLOCK = 8
    """_No description given by bungie._ """
    NO_QUANTITY = 16
    """_No description given by bungie._ """
    OUTSIDE_PURCHASE_WINDOW = 32
    """_No description given by bungie._ """
    NOT_AVAILABLE = 64
    """_No description given by bungie._ """
    UNIQUENESS_VIOLATION = 128
    """_No description given by bungie._ """
    UNKNOWN_ERROR = 256
    """_No description given by bungie._ """
    ALREADY_SELLING = 512
    """_No description given by bungie._ """
    UNSELLABLE = 1024
    """_No description given by bungie._ """
    SELLING_INHIBITED = 2048
    """_No description given by bungie._ """
    ALREADY_OWNED = 4096
    """DEPRECATED - Owned items use the NoUnlock state and a failure string indicating the proper display state. """
    DISPLAY_ONLY = 8192
    """_No description given by bungie._ """

ALREADY_OWNED = 4096 class-attribute instance-attribute

DEPRECATED - Owned items use the NoUnlock state and a failure string indicating the proper display state.

ALREADY_SELLING = 512 class-attribute instance-attribute

No description given by bungie.

DISPLAY_ONLY = 8192 class-attribute instance-attribute

No description given by bungie.

NOT_AVAILABLE = 64 class-attribute instance-attribute

No description given by bungie.

NO_FUNDS = 2 class-attribute instance-attribute

No description given by bungie.

NO_INVENTORY_SPACE = 1 class-attribute instance-attribute

No description given by bungie.

NO_PROGRESSION = 4 class-attribute instance-attribute

No description given by bungie.

NO_QUANTITY = 16 class-attribute instance-attribute

No description given by bungie.

NO_UNLOCK = 8 class-attribute instance-attribute

No description given by bungie.

OUTSIDE_PURCHASE_WINDOW = 32 class-attribute instance-attribute

No description given by bungie.

SELLING_INHIBITED = 2048 class-attribute instance-attribute

No description given by bungie.

SUCCESS = 0 class-attribute instance-attribute

No description given by bungie.

UNIQUENESS_VIOLATION = 128 class-attribute instance-attribute

No description given by bungie.

UNKNOWN_ERROR = 256 class-attribute instance-attribute

No description given by bungie.

UNSELLABLE = 1024 class-attribute instance-attribute

No description given by bungie.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyUnlockStatus

Bases: BaseModel

Indicates the status of an "Unlock Flag" on a Character or Profile. These are individual bits of state that can be either set or not set, and sometimes provide interesting human-readable information in their related DestinyUnlockDefinition.

Manifest Information

This model has some attributes which can be filled with additional information found in the manifest (manifest_...). Without additional work, these attributes will be None, since they require additional requests and database lookups.

To fill the manifest dependent attributes, either:

  • Run await ThisClass.fetch_manifest_information(), see here
  • Set Client.always_return_manifest_information to True, see here

Attributes:

Name Type Description
is_set bool

Whether the unlock flag is set.

unlock_hash int

The hash identifier for the Unlock Flag. Use to lookup DestinyUnlockDefinition for static data. Not all unlocks have human readable data - in fact, most don't. But when they do, it can be very useful to show. Even if they don't have human readable data, you might be able to infer the meaning of an unlock flag with a bit of experimentation...

manifest_unlock_hash Optional[DestinyUnlockDefinition]

Manifest information for unlock_hash

Source code in src/bungio/models/bungie/destiny/__init__.py
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
@custom_define()
class DestinyUnlockStatus(BaseModel):
    """
    Indicates the status of an "Unlock Flag" on a Character or Profile. These are individual bits of state that can be either set or not set, and sometimes provide interesting human-readable information in their related DestinyUnlockDefinition.

    Tip: Manifest Information
        This model has some attributes which can be filled with additional information found in the manifest (`manifest_...`).
        Without additional work, these attributes will be `None`, since they require additional requests and database lookups.

        To fill the manifest dependent attributes, either:

        - Run `await ThisClass.fetch_manifest_information()`, see [here](/API Reference/Models/base)
        - Set `Client.always_return_manifest_information` to `True`, see [here](/API Reference/client)

    Attributes:
        is_set: Whether the unlock flag is set.
        unlock_hash: The hash identifier for the Unlock Flag. Use to lookup DestinyUnlockDefinition for static data. Not all unlocks have human readable data - in fact, most don't. But when they do, it can be very useful to show. Even if they don't have human readable data, you might be able to infer the meaning of an unlock flag with a bit of experimentation...
        manifest_unlock_hash: Manifest information for `unlock_hash`
    """

    is_set: bool = custom_field()
    unlock_hash: int = custom_field()
    manifest_unlock_hash: Optional["DestinyUnlockDefinition"] = custom_field(default=None)

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyVendorItemState

Bases: BaseFlagEnum

The possible states of Destiny Profile Records. IMPORTANT: Any given item can theoretically have many of these states simultaneously: as a result, this was altered to be a flags enumeration/bitmask for v3.2.0.

Source code in src/bungio/models/bungie/destiny/__init__.py
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
class DestinyVendorItemState(BaseFlagEnum):
    """
    The possible states of Destiny Profile Records. IMPORTANT: Any given item can theoretically have many of these states simultaneously: as a result, this was altered to be a flags enumeration/bitmask for v3.2.0.
    """

    NONE = 0
    """There are no augments on the item. """
    INCOMPLETE = 1
    """Deprecated forever (probably). There was a time when Records were going to be implemented through Vendors, and this field was relevant. Now they're implemented through Presentation Nodes, and this field doesn't matter anymore. """
    REWARD_AVAILABLE = 2
    """Deprecated forever (probably). See the description of the "Incomplete" value for the juicy scoop. """
    COMPLETE = 4
    """Deprecated forever (probably). See the description of the "Incomplete" value for the juicy scoop. """
    NEW = 8
    """This item is considered to be "newly available", and should have some UI showing how shiny it is. """
    FEATURED = 16
    """This item is being "featured", and should be shiny in a different way from items that are merely new. """
    ENDING = 32
    """This item is only available for a limited time, and that time is approaching. """
    ON_SALE = 64
    """This item is "on sale". Get it while it's hot. """
    OWNED = 128
    """This item is already owned. """
    WIDE_VIEW = 256
    """This item should be shown with a "wide view" instead of normal icon view. """
    NEXUS_ATTENTION = 512
    """This indicates that you should show some kind of attention-requesting indicator on the item, in a similar manner to items in the nexus that have such notifications. """
    SET_DISCOUNT = 1024
    """This indicates that the item has some sort of a 'set' discount. """
    PRICE_DROP = 2048
    """This indicates that the item has a price drop. """
    DAILY_OFFER = 4096
    """This indicates that the item is a daily offer. """
    CHARITY = 8192
    """This indicates that the item is for charity. """
    SEASONAL_REWARD_EXPIRATION = 16384
    """This indicates that the item has a seasonal reward expiration. """
    BEST_DEAL = 32768
    """This indicates that the sale item is the best deal among different choices. """
    POPULAR = 65536
    """This indicates that the sale item is popular. """
    FREE = 131072
    """This indicates that the sale item is free. """
    LOCKED = 262144
    """This indicates that the sale item is locked. """
    PARACAUSAL = 524288
    """This indicates that the sale item is paracausal. """
    CRYPTARCH = 1048576
    """_No description given by bungie._ """
    ARTIFACT_PERK_OWNED = 2097152
    """_No description given by bungie._ """
    SAVINGS = 4194304
    """_No description given by bungie._ """
    INELIGIBLE = 8388608
    """_No description given by bungie._ """
    ARTIFACT_PERK_BOOSTED = 16777216
    """_No description given by bungie._ """
    SEASONAL_ARCHIVE_FREE = 33554432
    """_No description given by bungie._ """

ARTIFACT_PERK_BOOSTED = 16777216 class-attribute instance-attribute

No description given by bungie.

ARTIFACT_PERK_OWNED = 2097152 class-attribute instance-attribute

No description given by bungie.

BEST_DEAL = 32768 class-attribute instance-attribute

This indicates that the sale item is the best deal among different choices.

CHARITY = 8192 class-attribute instance-attribute

This indicates that the item is for charity.

COMPLETE = 4 class-attribute instance-attribute

Deprecated forever (probably). See the description of the "Incomplete" value for the juicy scoop.

CRYPTARCH = 1048576 class-attribute instance-attribute

No description given by bungie.

DAILY_OFFER = 4096 class-attribute instance-attribute

This indicates that the item is a daily offer.

ENDING = 32 class-attribute instance-attribute

This item is only available for a limited time, and that time is approaching.

FEATURED = 16 class-attribute instance-attribute

This item is being "featured", and should be shiny in a different way from items that are merely new.

FREE = 131072 class-attribute instance-attribute

This indicates that the sale item is free.

INCOMPLETE = 1 class-attribute instance-attribute

Deprecated forever (probably). There was a time when Records were going to be implemented through Vendors, and this field was relevant. Now they're implemented through Presentation Nodes, and this field doesn't matter anymore.

INELIGIBLE = 8388608 class-attribute instance-attribute

No description given by bungie.

LOCKED = 262144 class-attribute instance-attribute

This indicates that the sale item is locked.

NEW = 8 class-attribute instance-attribute

This item is considered to be "newly available", and should have some UI showing how shiny it is.

NEXUS_ATTENTION = 512 class-attribute instance-attribute

This indicates that you should show some kind of attention-requesting indicator on the item, in a similar manner to items in the nexus that have such notifications.

NONE = 0 class-attribute instance-attribute

There are no augments on the item.

ON_SALE = 64 class-attribute instance-attribute

This item is "on sale". Get it while it's hot.

OWNED = 128 class-attribute instance-attribute

This item is already owned.

PARACAUSAL = 524288 class-attribute instance-attribute

This indicates that the sale item is paracausal.

POPULAR = 65536 class-attribute instance-attribute

This indicates that the sale item is popular.

PRICE_DROP = 2048 class-attribute instance-attribute

This indicates that the item has a price drop.

REWARD_AVAILABLE = 2 class-attribute instance-attribute

Deprecated forever (probably). See the description of the "Incomplete" value for the juicy scoop.

SAVINGS = 4194304 class-attribute instance-attribute

No description given by bungie.

SEASONAL_ARCHIVE_FREE = 33554432 class-attribute instance-attribute

No description given by bungie.

SEASONAL_REWARD_EXPIRATION = 16384 class-attribute instance-attribute

This indicates that the item has a seasonal reward expiration.

SET_DISCOUNT = 1024 class-attribute instance-attribute

This indicates that the item has some sort of a 'set' discount.

WIDE_VIEW = 256 class-attribute instance-attribute

This item should be shown with a "wide view" instead of normal icon view.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyEquipItemResults

Bases: BaseModel

The results of a bulk Equipping operation performed through the Destiny API.

None Attributes: equip_results: No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
@custom_define()
class DestinyEquipItemResults(BaseModel):
    """
    The results of a bulk Equipping operation performed through the Destiny API.

    None
    Attributes:
        equip_results: _No description given by bungie._
    """

    equip_results: list["DestinyEquipItemResult"] = custom_field(metadata={"type": """list[DestinyEquipItemResult]"""})

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyEquipItemResult

Bases: BaseModel

The results of an Equipping operation performed through the Destiny API.

None Attributes: equip_status: A PlatformErrorCodes enum indicating whether it succeeded, and if it failed why. item_instance_id: The instance ID of the item in question (all items that can be equipped must, but definition, be Instanced and thus have an Instance ID that you can use to refer to them)

Source code in src/bungio/models/bungie/destiny/__init__.py
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
@custom_define()
class DestinyEquipItemResult(BaseModel):
    """
    The results of an Equipping operation performed through the Destiny API.

    None
    Attributes:
        equip_status: A PlatformErrorCodes enum indicating whether it succeeded, and if it failed why.
        item_instance_id: The instance ID of the item in question (all items that can be equipped must, but definition, be Instanced and thus have an Instance ID that you can use to refer to them)
    """

    equip_status: Union["PlatformErrorCodes", int] = custom_field(converter=enum_converter("PlatformErrorCodes"))
    item_instance_id: int = custom_field(metadata={"int64": True})

_convert_to_bungie_case(string) cached staticmethod

Convert a string to how it is represented by bungie: my_name_string -> myNameString

Parameters:

Name Type Description Default
string str

The og string

required

Returns:

Type Description
str

The bungie string

Source code in src/bungio/models/base.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
@staticmethod
@functools.cache
def _convert_to_bungie_case(string: str) -> str:
    """
    Convert a string to how it is represented by bungie: my_name_string -> myNameString

    Args:
        string: The og string

    Returns:
        The bungie string
    """

    if "_" not in string:
        return string
    else:
        split = string.split("_")
        return "".join((split[0], *(s.capitalize() for s in split[1:])))

fetch_manifest_information(include=None, exclude=None, _cache=None) async

Fill the model in-place with information from the manifest.

Example

Fill every attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information()
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is not None

Fill only some attribute

1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is not None
assert model.manifest_reference_id is None
1
2
3
4
model: DestinyHistoricalStatsActivity
await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
assert model.manifest_director_activity_hash is None
assert model.manifest_reference_id is not None

Parameters:

Name Type Description Default
include Optional[list[str]]

A list of attributes you want to include. Excludes everything not mentioned

None
exclude Optional[list[str]]

A list of attributes you want to exclude. Includes everything not mentioned

None
Source code in src/bungio/models/base.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
async def fetch_manifest_information(
    self, include: Optional[list[str]] = None, exclude: Optional[list[str]] = None, _cache: Optional[dict] = None
):
    """
    Fill the model in-place with information from the manifest.

    Example:
        Fill every attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information()
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is not None
        ```

        Fill only some attribute
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(include=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is not None
        assert model.manifest_reference_id is None
        ```
        ```py
        model: DestinyHistoricalStatsActivity
        await model.fetch_manifest_information(exclude=["manifest_director_activity_hash"])
        assert model.manifest_director_activity_hash is None
        assert model.manifest_reference_id is not None
        ```

    Args:
        include: A list of attributes you want to include. Excludes everything not mentioned
        exclude:  A list of attributes you want to exclude. Includes everything not mentioned
    """

    if not isinstance(self._client.manifest_storage, AsyncEngine):
        raise ValueError("Client.manifest_storage must be set up to use this")

    if not _cache:
        _cache = {}

    class_definition = attrs.fields_dict(type(self))  # noqa

    # loop through the class attributes
    for name in self.__dir__():
        if name.startswith("__"):
            continue

        if include and name not in include:
            continue
        if exclude and name in exclude:
            continue

        # manifest entries
        if name.startswith("manifest_"):
            striped_name = name.removeprefix("manifest_")
            value = getattr(self, striped_name)

            if value is MISSING:
                return

            # check the cache to avoid infinite recursion
            if cached := _cache.get(value, None):
                manifest_value = cached

            else:
                attr_definition = class_definition[name]
                manifest_class_name = attr_definition.type.__str__().removesuffix("')]").split("'")[-1]
                manifest_value = await self._client.manifest.fetch(
                    manifest_class=getattr(models, manifest_class_name), value=value
                )

                _cache[value] = manifest_value

                # check if the model has manifest models itself
                if manifest_value:
                    await manifest_value.fetch_manifest_information(_cache=_cache)

            setattr(self, name, manifest_value)

        # sub models which may have manifest entries too
        elif hasattr((value := getattr(self, name)), "fetch_manifest_information"):
            await value.fetch_manifest_information(_cache=_cache)

from_dict(data, client, recursive=False, *args, **kwargs) async classmethod

Convert json data to this model

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required
recursive bool

If this was called recursively

False

Returns:

Type Description
BaseModel

The model

Source code in src/bungio/models/base.py
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
@classmethod
async def from_dict(cls, data: dict, client: "Client", recursive: bool = False, *args, **kwargs) -> BaseModel:
    """
    Convert json data to this model

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj
        recursive: If this was called recursively

    Returns:
        The model
    """

    if isinstance(data, cls):
        return data

    if not isinstance(data, dict):
        raise ValueError

    if "Response" in data:
        data = data["Response"]

    # also use the kwargs as data
    data = kwargs | data
    data = cls.process_dict(data=data, client=client)

    prepared = {}
    for name, field in attrs.fields_dict(cls).items():
        if field.init and name != "_client":
            default = field.default

            # get the value we want. This also skips the manifest_... entries since they have no value and a default
            bungie_name = cls._convert_to_bungie_case(name)
            value = data.get(bungie_name, attrs.NOTHING)

            # bungie is veeery inconsistent and sometimes like to start their params with an upper case for some reason
            # only sometimes tho :)
            if value is attrs.NOTHING:
                value = data.get(f"{bungie_name[0].capitalize()}{bungie_name[1:]}", attrs.NOTHING)

            # sadly bungie sometimes does not return info without marking that fact in the api specs
            if value is attrs.NOTHING and default is attrs.NOTHING:
                default = MISSING

            if value is attrs.NOTHING:
                value = default

            else:
                value = await cls._convert_to_type(
                    field_type=field.type, field_metadata=field.metadata, value=value, client=client
                )

            # set the attr
            prepared[name] = value

    res = cls(**prepared)  # noqa

    # fill the manifest information
    if not recursive and res._client.always_return_manifest_information:
        await res.fetch_manifest_information()

    return res

process_dict(data, client, *args, **kwargs) staticmethod

Model specific cleanup

Parameters:

Name Type Description Default
data dict

The json representation of the model, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
dict

Clean json

Source code in src/bungio/models/base.py
260
261
262
263
264
265
266
267
268
269
270
271
272
@staticmethod
def process_dict(data: dict, client: "Client", *args, **kwargs) -> dict:
    """
    Model specific cleanup

    Args:
        data: The json representation of the model, usually received by bungie
        client: The client obj

    Returns:
        Clean json
    """
    return data

to_dict(_return_to_bungie_case=True)

Convert the model into a dict representation bungie accepts

Returns:

Type Description
dict

A dict which can be sent to bungie

Source code in src/bungio/models/base.py
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def to_dict(self, _return_to_bungie_case: bool = True) -> dict:
    """
    Convert the model into a dict representation bungie accepts

    Returns:
        A dict which can be sent to bungie
    """

    result = {}

    for name, field in attrs.fields_dict(type(self)).items():
        if name.startswith("_") or name.startswith("manifest_"):
            continue

        value = getattr(self, name)
        if _return_to_bungie_case:
            name = self._convert_to_bungie_case(name)

        if inspect.ismethod(value) or inspect.isfunction(value):
            continue

        elif isinstance(value, dict):
            raise NotImplementedError(
                "Nested dict conversion is not currently implemented, since bungie does never require that info"
            )

        elif isinstance(value, list):
            list_results = []
            for entry in value:
                if hasattr(entry, "to_dict"):
                    list_results.append(entry.to_dict())
                else:
                    list_results.append(entry)

            result[name] = list_results

        else:
            if hasattr(value, "to_dict"):
                result[name] = value.to_dict()
            else:
                # convert to string if they are int64
                if field.metadata.get("int64", None) is True:
                    value = str(value)

                result[name] = value

    return result

DestinyActivityTreeType

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
class DestinyActivityTreeType(BaseEnum):
    """
    _No description given by bungie._
    """

    FIRETEAM_FINDER = 0
    """_No description given by bungie._ """
    CURATOR = 1
    """_No description given by bungie._ """
    EVENT_HOME = 2
    """_No description given by bungie._ """
    SEASON_HOME = 3
    """_No description given by bungie._ """
    COUNT = 4
    """_No description given by bungie._ """

COUNT = 4 class-attribute instance-attribute

No description given by bungie.

CURATOR = 1 class-attribute instance-attribute

No description given by bungie.

EVENT_HOME = 2 class-attribute instance-attribute

No description given by bungie.

FIRETEAM_FINDER = 0 class-attribute instance-attribute

No description given by bungie.

SEASON_HOME = 3 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

DestinyActivityTreeChildSortMode

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
class DestinyActivityTreeChildSortMode(BaseEnum):
    """
    _No description given by bungie._
    """

    INVESTMENT = 0
    """_No description given by bungie._ """
    FOCUS_FIRST = 1
    """_No description given by bungie._ """
    BONUS_AND_FOCUS_FIRST = 2
    """_No description given by bungie._ """

BONUS_AND_FOCUS_FIRST = 2 class-attribute instance-attribute

No description given by bungie.

FOCUS_FIRST = 1 class-attribute instance-attribute

No description given by bungie.

INVESTMENT = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

FireteamFinderCodeOptionType

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
class FireteamFinderCodeOptionType(BaseEnum):
    """
    _No description given by bungie._
    """

    NONE = 0
    """_No description given by bungie._ """
    APPLICATION_ONLY = 1
    """_No description given by bungie._ """
    ONLINE_ONLY = 2
    """_No description given by bungie._ """
    PLAYER_COUNT = 3
    """_No description given by bungie._ """
    TITLE = 4
    """_No description given by bungie._ """
    TAGS = 5
    """_No description given by bungie._ """
    FINDER_ACTIVITY_GRAPH = 6
    """_No description given by bungie._ """
    MICROPHONE_REQUIRED = 7
    """_No description given by bungie._ """

APPLICATION_ONLY = 1 class-attribute instance-attribute

No description given by bungie.

FINDER_ACTIVITY_GRAPH = 6 class-attribute instance-attribute

No description given by bungie.

MICROPHONE_REQUIRED = 7 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

ONLINE_ONLY = 2 class-attribute instance-attribute

No description given by bungie.

PLAYER_COUNT = 3 class-attribute instance-attribute

No description given by bungie.

TAGS = 5 class-attribute instance-attribute

No description given by bungie.

TITLE = 4 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

FireteamFinderOptionAvailability

Bases: BaseFlagEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
class FireteamFinderOptionAvailability(BaseFlagEnum):
    """
    _No description given by bungie._
    """

    NONE = 0
    """_No description given by bungie._ """
    CREATE_LISTING_BUILDER = 1
    """_No description given by bungie._ """
    SEARCH_LISTING_BUILDER = 2
    """_No description given by bungie._ """
    LISTING_VIEWER = 4
    """_No description given by bungie._ """
    LOBBY_VIEWER = 8
    """_No description given by bungie._ """

CREATE_LISTING_BUILDER = 1 class-attribute instance-attribute

No description given by bungie.

LISTING_VIEWER = 4 class-attribute instance-attribute

No description given by bungie.

LOBBY_VIEWER = 8 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

SEARCH_LISTING_BUILDER = 2 class-attribute instance-attribute

No description given by bungie.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

FireteamFinderOptionVisibility

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
2088
2089
2090
2091
2092
2093
2094
2095
2096
class FireteamFinderOptionVisibility(BaseEnum):
    """
    _No description given by bungie._
    """

    ALWAYS = 0
    """_No description given by bungie._ """
    SHOW_WHEN_CHANGED_FROM_DEFAULT = 1
    """_No description given by bungie._ """

ALWAYS = 0 class-attribute instance-attribute

No description given by bungie.

SHOW_WHEN_CHANGED_FROM_DEFAULT = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

FireteamFinderOptionControlType

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
class FireteamFinderOptionControlType(BaseEnum):
    """
    _No description given by bungie._
    """

    NONE = 0
    """_No description given by bungie._ """
    VALUE_COLLECTION = 1
    """_No description given by bungie._ """
    RADIO_BUTTON = 2
    """_No description given by bungie._ """

NONE = 0 class-attribute instance-attribute

No description given by bungie.

RADIO_BUTTON = 2 class-attribute instance-attribute

No description given by bungie.

VALUE_COLLECTION = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

FireteamFinderOptionSearchFilterType

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
class FireteamFinderOptionSearchFilterType(BaseEnum):
    """
    _No description given by bungie._
    """

    NONE = 0
    """_No description given by bungie._ """
    ALL = 1
    """_No description given by bungie._ """
    ANY = 2
    """_No description given by bungie._ """
    IN_RANGE_INCLUSIVE = 3
    """_No description given by bungie._ """
    IN_RANGE_EXCLUSIVE = 4
    """_No description given by bungie._ """
    GREATER_THAN = 5
    """_No description given by bungie._ """
    GREATER_THAN_OR_EQUAL_TO = 6
    """_No description given by bungie._ """
    LESS_THAN = 7
    """_No description given by bungie._ """
    LESS_THAN_OR_EQUAL_TO = 8
    """_No description given by bungie._ """

ALL = 1 class-attribute instance-attribute

No description given by bungie.

ANY = 2 class-attribute instance-attribute

No description given by bungie.

GREATER_THAN = 5 class-attribute instance-attribute

No description given by bungie.

GREATER_THAN_OR_EQUAL_TO = 6 class-attribute instance-attribute

No description given by bungie.

IN_RANGE_EXCLUSIVE = 4 class-attribute instance-attribute

No description given by bungie.

IN_RANGE_INCLUSIVE = 3 class-attribute instance-attribute

No description given by bungie.

LESS_THAN = 7 class-attribute instance-attribute

No description given by bungie.

LESS_THAN_OR_EQUAL_TO = 8 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

FireteamFinderOptionDisplayFormat

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
class FireteamFinderOptionDisplayFormat(BaseEnum):
    """
    _No description given by bungie._
    """

    TEXT = 0
    """_No description given by bungie._ """
    INTEGER = 1
    """_No description given by bungie._ """
    BOOL = 2
    """_No description given by bungie._ """
    FORMAT_STRING = 3
    """_No description given by bungie._ """

BOOL = 2 class-attribute instance-attribute

No description given by bungie.

FORMAT_STRING = 3 class-attribute instance-attribute

No description given by bungie.

INTEGER = 1 class-attribute instance-attribute

No description given by bungie.

TEXT = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

FireteamFinderOptionValueProviderType

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
class FireteamFinderOptionValueProviderType(BaseEnum):
    """
    _No description given by bungie._
    """

    NONE = 0
    """_No description given by bungie._ """
    VALUES = 1
    """_No description given by bungie._ """
    PLAYER_COUNT = 2
    """_No description given by bungie._ """
    FIRETEAM_FINDER_LABELS = 3
    """_No description given by bungie._ """
    FIRETEAM_FINDER_ACTIVITY_GRAPH = 4
    """_No description given by bungie._ """
    FIRETEAM_FINDER_U_I_ACTIVITY_TREE = 5
    """_No description given by bungie._ """

FIRETEAM_FINDER_ACTIVITY_GRAPH = 4 class-attribute instance-attribute

No description given by bungie.

FIRETEAM_FINDER_LABELS = 3 class-attribute instance-attribute

No description given by bungie.

FIRETEAM_FINDER_U_I_ACTIVITY_TREE = 5 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

PLAYER_COUNT = 2 class-attribute instance-attribute

No description given by bungie.

VALUES = 1 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

FireteamFinderOptionValueFlags

Bases: BaseFlagEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
class FireteamFinderOptionValueFlags(BaseFlagEnum):
    """
    _No description given by bungie._
    """

    NONE = 0
    """_No description given by bungie._ """
    CREATE_LISTING_DEFAULT_VALUE = 1
    """_No description given by bungie._ """
    SEARCH_FILTER_DEFAULT_VALUE = 2
    """_No description given by bungie._ """

CREATE_LISTING_DEFAULT_VALUE = 1 class-attribute instance-attribute

No description given by bungie.

NONE = 0 class-attribute instance-attribute

No description given by bungie.

SEARCH_FILTER_DEFAULT_VALUE = 2 class-attribute instance-attribute

No description given by bungie.

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value

FireteamFinderLabelFieldType

Bases: BaseEnum

No description given by bungie.

Source code in src/bungio/models/bungie/destiny/__init__.py
2184
2185
2186
2187
2188
2189
2190
2191
2192
class FireteamFinderLabelFieldType(BaseEnum):
    """
    _No description given by bungie._
    """

    TITLE = 0
    """_No description given by bungie._ """
    LABEL = 1
    """_No description given by bungie._ """

LABEL = 1 class-attribute instance-attribute

No description given by bungie.

TITLE = 0 class-attribute instance-attribute

No description given by bungie.

display_name property

Format the instance name so that it looks like in-game.

Example

name="HAND_CANNON" -> "Hand Cannon"

Returns:

Type Description
str

The formatted name

from_dict(data, client, *args, **kwargs) async classmethod

Convert data to this enum

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
EnumMixin | UnknownEnumValue

The enum

Source code in src/bungio/models/base.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@classmethod
async def from_dict(cls, data: int | str, client: "Client", *args, **kwargs) -> EnumMixin | UnknownEnumValue:
    """
    Convert data to this enum

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        The enum
    """

    if isinstance(data, cls):
        return data

    data = cls.process_dict(data=data, client=client)

    # catch unknown values
    try:
        return cls(data)
    except ValueError:
        return UnknownEnumValue(value=data, enum=cls)

process_dict(data, client, *args, **kwargs) staticmethod

Enum specific cleanup

Parameters:

Name Type Description Default
data int | str

The int / str representation of the enum, usually received by bungie

required
client 'Client'

The client obj

required

Returns:

Type Description
int | str

Clean int / str representation

Source code in src/bungio/models/base.py
134
135
136
137
138
139
140
141
142
143
144
145
146
@staticmethod
def process_dict(data: int | str, client: "Client", *args, **kwargs) -> int | str:
    """
    Enum specific cleanup

    Args:
        data: The int / str representation of the enum, usually received by bungie
        client: The client obj

    Returns:
        Clean int / str representation
    """
    return data

to_dict()

Convert the enum into a representation bungie accepts

Returns:

Type Description
Any

The value which can be sent to bungie

Source code in src/bungio/models/base.py
172
173
174
175
176
177
178
179
180
def to_dict(self) -> Any:
    """
    Convert the enum into a representation bungie accepts

    Returns:
        The value which can be sent to bungie
    """

    return self.value