0.3.0
This release contains a lot of changes, please read this if you're a user of this library.
Added
methods
fetch_sanitized_membership
, available on both client APIssearch_groups
, available on both client APIsRESTClient.report_player
RESTClient.force_drops_repair
RESTClient.claim_partner_offer
RESTClient.fetch_bungie_rewards_for_user
RESTClient.fetch_bungie_rewards_for_platform
RESTClient.fetch_bungie_rewards
Image.stream
Image.chunks
FireteamFinder
methods, available through theRESTClient.build_fireteam_finder
method.
components
- implemented the
CHARACTER LOADOUTS
component along with its framework methods, You can access it viaComponents.character_loadouts
after fetching a profile. orloadouts
after fetching a character. - implemented the
SOCIAL COMMENDATIONS
components, you can access it viaComponents.commendations
after fetching a profile.
object fields
type
,profile_ban_expire
andegs_name
fields toBungieUser
code
field toPartialBungieUser
origin
field toApplication
emblem_color
field toCharacter
minutes_played_this_session
field toCharacter
percent_to_next_level
field toCharacter
- Added the following to
Profile
season_hashes
versions_owned
season_hash
guardian_rank
highest_guardian_rank
renewed_guardian_rank
event_card_hashes
user
, removedname
,id
andtype
in favor of this.
- Added
available_activity_interactables
toCharacterActivity
other
sain
as a required dependency. this is used mainly to replaceiterators
custom_client
exampleGameVersions
enum.- An option to use a specific executor for downloading the manifest and
Image.save
method.
import concurrent.futures
# Use process pool executor to write the manifest data.
await rest.download_json_manifest(
...,
executor=concurrent.futures.ProcessPoolExecutor()
)
FireteamBuilder
inaiobungie.builders
Changed
name changes
interfaces
dir is renamed toapi
.factory
renamed toframework
and exported to top level, no longer aninternal
packagefactory.Factory
is nowframework.Framework
.interfaces.RESTInterface
renamed toapi.RESTClient
which matchesrest.RESTClient
.interfaces.FactoryInterface
renamed toapi.Framework
which matchesframework.Framework
.- trait
Netrunner
renamed toSend
and is no longer used, currently kept for future plans. - trait
Serializable
renamed toDeserialize
and its methodfactory
renamed toframework
. - trait
ClientApp
renamed toCompact
. Client.factory
is nowClient.framework
.factory.EmptyFactory
is nowframework.Empty
and is now deprecated, useFramework()
instead.UserLike
abstract class renamed toUnique
.deserialize_app
renamed todeserialize_application
.deserialize_app_owner
renamed todeserialize_application_member
ApplicationOwner
is nowApplicationMember
and the user fields are accessible through.user
Application.owner
field is nowApplication.team
which returns the entire application roaster instead of just the owner.Framework.deserialize_fireteam_destiny_users
renamed todeserialize_fireteam_destiny_membership
FireteamMember.destiny_user
renamed toFireteamMember.membership
Image.default_or_else
is now justImage.default
other changes
Framework
doesn't require anet
parameter anymore.Client.run
is deprecated and will be removed in the next major release.RESTClient.with_debug
has been moved totraits.RESTful
with a default final impl.internal.assets
which containedImage
has been moved toaiobungie.builders
Image
now acceptsNone
as a default path.sain
package is now used as the default iterator builder.
it is a dependency free that's developed by me so it won't really have any side-effects.- If you're a
RESTPool
user, it is possible to callbuild_oauth2_url
without acquiring a client instance
this is a good change for performance improvements since acquiring a client instance also means opening a TCP connection,
which is useless when you're still not making any requests.
pool = aiobungie.RESTPool("token", client_id=0000, client_secret="secret")
url = pool.build_oauth2_url()
# same as
async with pool.acquire() as client:
url = client.build_oauth2_url()
# also the same
url = pool.acquire().build_oauth2_url()
Removed
The following methods were scheduled to be removed in this version.
PartialBungieUser.fetch_self()
ProfileItemImpl.is_transferable
ProfileItemImpl.collect_characters
ProfileItemImpl.fetch_self
DestinyMembership.fetch_self_profile
QuesStatus.fetch_quest
QuestStatus.fetch_step
Objective.fetch_self
ItemsComponent.any
ItemsComponent.all
Challenges.fetch_objective
Rewards.fetch_self
Activity.is_solo
Activity.is_flawless
Activity.is_solo_flawless
Activity.fetch_post
Character.transfer_item
Character.equip_item
Character.equip_items
Character.pull_item
Character.fetch_activities
RenderedData.fetch_my_items
MinimalEquipments.fetch_my_item
AvailableActivity.fetch_self
ClanMember.ban
ClanMember.unban
ClanMember.kick
ClanMember.fetch_clan
GroupMember.fetch_self_clan
Clan.deny_pending_members
Clan.approve_pending_members
Clan.add_optional_conversations
Clan.fetch_banned_members
Clan.fetch_pending_members
Clan.fetch_invited_members
Clan.fetch_conversations
Clan.fetch_available_fireteams
Clan.fetch_fireteams
Clan.fetch_members
Clan.edit
Clan.edit_options
ClanConversation.edit
CraftablesComponent.fetch_craftables
SearchableEntity.fetch_self_item
these methods above are still accessible via the both clients, either the RESTClient
or Client
,
their abstraction on the object just got removed not that actual implementation of the method.
ok but how do i reproduce those?
client = aiobungie.Client("...")
async def character_transfer_item() -> None:
# Instead of: await character.transfer_item(...)
# call it from the client directly.
await client.rest.transfer_item(token, char_id, item_id)
async def character_fetch_activities() -> None:
# Instead of: await character.fetch_activities(...)
# call it from the client directly.
await client.fetch_activities(cid, mid, mode, ...)
ok but why? there're multiple reasons why those got removed.
good practices; at the beginning, those methods were meant to provide a higher-level abstraction over the object itself,
so you can call them directly from the object, while it is a nice QoL thing, it can, if misused, end up with worse overall code.
this change should forward users with developing good code and practices and make them more aware of both client APIs.
conflict and unsafety; since those methods can also be accessed via an empty deserializer results, this introduces bugs for the user of this lib,
Example:
framework = aiobungie.framework.Empty()
response = requests.get(...)
user_object = framework.deserialize_user(response.json())
# this is undefined behavior, since an empty deserializer doesn't have a client associated with it.
await user_object.fetch_self()
aiobungie crates are meant to be a stand-alone representation of the fetched API results. which payloads deserializes into. so those methods won't really fit in.
.net
field removed from all objects.UserLike.icon
UserLike.last_seen_name
UserLike.is_public
ComponentFields
enumImage.url
, useImage.create_url
instead.iterators
package in favor ofsain
Fixed
- deserializing
Friend
object was raisingKeyError
due toname
field. vault
option in methodpull_item
now works as intended, thanks to #418 for opening the issue.ComponentType.CHARACTER_PROGRESSIONS
enum field name typo fixed.