You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm making this issue to better communicate what's coming with upcoming / new version 0.2.0, specifically because there is quite a bit of changes that one could consider breaking. Nonetheless, I made sure that the update would require minimal changes to the code, so hopefully it shouldn't be too problematic.
Non-breaking changes / additions:
• Various bug-fixes, tweaks and optimizations.
• Server status now includes merged information from both, the StatusPage, and the official API.
• Added a new register_status_callback method, that lets you setup a loop that will periodically check the server status, and call the provided callback function in case the status changes. Perfect for constant server status monitoring and almost instant notifications.
• Support for the bounty store endpoint.
• Support for aware datetime objects in get_matches_for_queue.
• New group_by utility, that allows you to group together items from a list, into a dictionary, where each item shares a common key value specified.
• MatchPlayer and LivePlayer objects now have a rank attribute, populated for ranked matches only.
• LivePlayer player objects now have their platform included / set correctly.
• MatchItem, LoadoutCard and Device now include a new description method, that allows you to obtain the card / item description, with the correct leveled information already formatted in.
• The cache now includes champion skins list (at least those that the API returns, the list appears to be incomplete).
• The skin attribute now includes a new Skin object from the cache, if available.
• Most methods will now raise a TypeError or ValueError (instead of AssertionError), in case of incorrect arguments being provided to them - this allows for more verbose error messages.
Breaking changes:
• Following the new description method addition to MatchItem, LoadoutCard and Device objects, the old description attribute has been renamed to raw_description.
• Removed all get_(champion|item|talent|card|device) methods from the cache (so api as well), as well as the cache entry. All of those have now been unified into a single get method, available on the Lookup class itself. To convert, simply change every instance of api.get_champion into a cache entry fetch, followed by entry.champions.get - repeat for all other get methods and champions, items, talents, cards or devices attributes respectively. To lookup the new cached skins by their name, use entry.skins.get.
• Following the get_* methods removal, the new get method will not accept the fuzzy kwarg anymore. Instead, the get method will perform a semi-fuzzy search by default, by not being case-sensitive anymore. To provide even more freedom with fuzzy item lookups, there have been two new methods added to the Lookup class, called get_fuzzy_matches and get_fuzzy, with this latter one most likely finding the most usage - please see the documentation for more information.
Breaking changes code overview:
• Replace device.description into device.raw_description, unless you were doing the description formatting yourself, then feel free to utilize the new description method for the same purpose.
• Replace api.get_champion(name) with entry = api.get_entry() (or entry = await api.get_champion_info() for a more up-to-date result), followed by entry.champions.get(name).
• Replace api.get_champion(name, fuzzy=True) according to the above, but use entry.champions.get_fuzzy(name) at the end.
The text was updated successfully, but these errors were encountered:
I'm making this issue to better communicate what's coming with upcoming / new version 0.2.0, specifically because there is quite a bit of changes that one could consider breaking. Nonetheless, I made sure that the update would require minimal changes to the code, so hopefully it shouldn't be too problematic.
Non-breaking changes / additions:
• Various bug-fixes, tweaks and optimizations.
• Server status now includes merged information from both, the StatusPage, and the official API.
• Added a new
register_status_callback
method, that lets you setup a loop that will periodically check the server status, and call the provided callback function in case the status changes. Perfect for constant server status monitoring and almost instant notifications.• Support for the bounty store endpoint.
• Support for aware datetime objects in
get_matches_for_queue
.• New
group_by
utility, that allows you to group together items from a list, into a dictionary, where each item shares a common key value specified.•
MatchPlayer
andLivePlayer
objects now have arank
attribute, populated for ranked matches only.•
LivePlayer
player objects now have their platform included / set correctly.•
MatchItem
,LoadoutCard
andDevice
now include a newdescription
method, that allows you to obtain the card / item description, with the correct leveled information already formatted in.• The cache now includes champion skins list (at least those that the API returns, the list appears to be incomplete).
• The
skin
attribute now includes a newSkin
object from the cache, if available.• Most methods will now raise a
TypeError
orValueError
(instead ofAssertionError
), in case of incorrect arguments being provided to them - this allows for more verbose error messages.Breaking changes:
• Following the new
description
method addition toMatchItem
,LoadoutCard
andDevice
objects, the olddescription
attribute has been renamed toraw_description
.• Removed all
get_(champion|item|talent|card|device)
methods from the cache (so api as well), as well as the cache entry. All of those have now been unified into a singleget
method, available on theLookup
class itself. To convert, simply change every instance ofapi.get_champion
into a cache entry fetch, followed byentry.champions.get
- repeat for all other get methods andchampions
,items
,talents
,cards
ordevices
attributes respectively. To lookup the new cached skins by their name, useentry.skins.get
.• Following the
get_*
methods removal, the newget
method will not accept thefuzzy
kwarg anymore. Instead, theget
method will perform a semi-fuzzy search by default, by not being case-sensitive anymore. To provide even more freedom with fuzzy item lookups, there have been two new methods added to theLookup
class, calledget_fuzzy_matches
andget_fuzzy
, with this latter one most likely finding the most usage - please see the documentation for more information.Breaking changes code overview:
• Replace
device.description
intodevice.raw_description
, unless you were doing the description formatting yourself, then feel free to utilize the newdescription
method for the same purpose.• Replace
api.get_champion(name)
withentry = api.get_entry()
(orentry = await api.get_champion_info()
for a more up-to-date result), followed byentry.champions.get(name)
.• Replace
api.get_champion(name, fuzzy=True)
according to the above, but useentry.champions.get_fuzzy(name)
at the end.The text was updated successfully, but these errors were encountered: