0.2.6 update.
Highlights
-
Seson 17 new activities.
-
helpers.awaits
now returnsSequence
instead ofCollection
. -
RESTPool
impl. -
REST_DEBUG
level name toTRACE
-
aiobungie.crate
is renamed tocrates
+ Added an alias forcrate
for backward versions. -
RESTnterface
andRESTClient
is now completlyasync def
+ typesafe. -
PlugSocketBuilder
andOAuth2Response
has been moved tobuilders.py
and both objects are not exposed to the project namespace anymore. Howeveraiobungie.builders.*
is exposed. -
Objects no longer type hinted with
MaybeImage
and now returnImage
instead. -
All methods that used to take
*components
now take a list of component types instead. -
All components should be passed as is without unpacking nor using the
.value
attribute. -
The
auth
parameter is now exposed as an actual parameter and not a kwarg.
Example
await client.fetch_profile(
...,
components=[aiobungie.ComponentType.ALL_PROFILES, aiobungie.ComponentType.CHARACTERS, ...],
auth="..."
)
- Standard
FlatIterator
andinto_iter
ininternal.iterators
and exported to the project's namespace.
Example usage
import aiobungie
client = aiobungie.Client()
friends = await client.fetch_friends(...)
# This can either be used with `async for` or `for`
async for friend in (
aiobungie.into_iter(friends) # Transform the sequence into a flat iterator.
.filter(lambda friend: friend.type is MembershipType.STEAM) # Filter to only steam friends.
.take(5) # Limit the results to 5 friends
.discard(lambda friend: friend.online_status is Presence.ONLINE) # Drop friends that are not online.
.reversed() # Reverse them.
):
print(friend.unique_name)