Profiles API Models
DestinyProfileComponent
Bases: BaseModel
The most essential summary information about a Profile (in Destiny 1, we called these "Accounts").
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:
Attributes:
| Name | Type | Description |
|---|---|---|
active_event_card_hash |
int
|
If populated, this is a reference to the event card that is currently active. |
character_ids |
list[int]
|
A list of the character IDs, for further querying on your part. |
current_guardian_rank |
int
|
The 'current' Guardian Rank value, which starts at rank 1. This rank value will drop at the start of a new season to your 'renewed' rank from the previous season. |
current_season_hash |
int
|
If populated, this is a reference to the season that is currently active. |
current_season_pass_hash |
int
|
If populated, this is a reference to the season pass that is currently active. |
current_season_reward_power_cap |
int
|
If populated, this is the reward power cap for the current season. |
date_last_played |
datetime
|
The last time the user played with any character on this Profile. |
event_card_hashes_owned |
list[int]
|
A list of hashes for event cards that a profile owns. Unlike most values in versionsOwned, these stay with the profile across all platforms. |
lifetime_highest_guardian_rank |
int
|
The 'lifetime highest' Guardian Rank value, which starts at rank 1. This rank value should never go down. |
renewed_guardian_rank |
int
|
The seasonal 'renewed' Guardian Rank value. This rank value resets at the start of each new season to the highest-earned non-advanced rank. |
season_hashes |
list[int]
|
A list of seasons that this profile owns. Unlike versionsOwned, these stay with the profile across Platforms, and thus will be valid. It turns out that Stadia Pro subscriptions will give access to seasons but only while playing on Stadia and with an active subscription. So some users (users who have Stadia Pro but choose to play on some other platform) won't see these as available: it will be whatever seasons are available for the platform on which they last played. |
season_pass_hashes |
list[int]
|
A list of season passes aka reward passes that this profile owns. Unlike versionsOwned, these stay with the profile across Platforms, and thus will be valid. |
user_info |
UserInfoCard
|
If you need to render the Profile (their platform name, icon, etc...) somewhere, this property contains that information. |
versions_owned |
Union[DestinyGameVersions, int]
|
If you want to know what expansions they own, this will contain that data. IMPORTANT: This field may not return the data you're interested in for Cross-Saved users. It returns the last ownership data we saw for this account - which is to say, what they've purchased on the platform on which they last played, which now could be a different platform. If you don't care about per-platform ownership and only care about whatever platform it seems they are playing on most recently, then this should be "good enough." Otherwise, this should be considered deprecated. We do not have a good alternative to provide at this time with platform specific ownership data for DLC. |
manifest_active_event_card_hash |
Optional[DestinyEventCardDefinition]
|
Manifest information for |
manifest_current_guardian_rank |
Optional[DestinyGuardianRankDefinition]
|
Manifest information for |
manifest_current_season_hash |
Optional[DestinySeasonDefinition]
|
Manifest information for |
manifest_current_season_pass_hash |
Optional[DestinySeasonPassDefinition]
|
Manifest information for |
manifest_lifetime_highest_guardian_rank |
Optional[DestinyGuardianRankDefinition]
|
Manifest information for |
manifest_renewed_guardian_rank |
Optional[DestinyGuardianRankDefinition]
|
Manifest information for |
Source code in src/bungio/models/bungie/destiny/entities/profiles.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
_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 | |
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 | |
Fill only some attribute
1 2 3 4 | |
1 2 3 4 | |
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 | |
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 | |
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 | |
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 | |
DestinyVendorReceiptsComponent
Bases: BaseModel
For now, this isn't used for much: it's a record of the recent refundable purchases that the user has made. In the future, it could be used for providing refunds/buyback via the API. Wouldn't that be fun?
None Attributes: receipts: The receipts for refundable purchases made at a vendor.
Source code in src/bungio/models/bungie/destiny/entities/profiles.py
23 24 25 26 27 28 29 30 31 32 33 | |
_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 | |
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 | |
Fill only some attribute
1 2 3 4 | |
1 2 3 4 | |
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 | |
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 | |
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 | |
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 | |