GithubHelp home page GithubHelp logo

devilxd / arez Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 1.0 775 KB

An async Python Hi-Rez API wrapper

License: GNU General Public License v3.0

Python 99.98% Batchfile 0.02%
paladins hirez wrapper api async

arez's People

Contributors

devilxd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

furiapaladins

arez's Issues

`search_players` in aRez 0.2.5.dev0 results in an AttributeError

Using the function search_players for any name where the default parameter of exact=true, will result in an AttributeError.

For example:

players = await self.bot.api.search_players(player_name=player_name, platform=platform)

where playername = yaniv and platform = none.

results in:

File "/usr/local/lib/python3.8/dist-packages/arez/api.py", line 703, in search_players
    if exact and name.lower() != player_name:
AttributeError: 'NoneType' object has no attribute 'lower'

Add in ranked position to ranked stats.

Currently under the arez.RankedStats class there doesn't seem to be any way to access a person's position in their rank stats.

It would nice to see something like .position added to access this information.

Merging of `arez.StatusPage.CurrentStatus` into `arez.ServerStatus`

I'm looking for a way to merge these two responses:

https://arez.readthedocs.io/en/latest/status.html#arez.ServerStatus
https://arez.readthedocs.io/en/latest/statuspage.html#arez.statuspage.CurrentStatus

..., obtained from these two methods / endpoints:

https://arez.readthedocs.io/en/latest/paladinsapi.html#arez.PaladinsAPI.get_server_status
https://arez.readthedocs.io/en/latest/statuspage.html#arez.StatusPage.get_status

The issue is, while the StatusPage provides a lot more information regarding the server downtime (impact scale, description, expected / predicted start and end timestams, etc.), it also usually incurs a significant delay (up to an hour or two in worst cases). On the other hand, the official API is much quicker at providing server status information (up to 1 minute delay at worst), but the only information we get is just that (server is up or down), along with optional information about limited access and server version.

Ideally, one could somehow merge the information from both endpoints, that'd combine the advantages of both - retain the quickness of official API, allowing for almost instant notification regarding server status, while also providing extended information available on StatusPage, all in a single response.

Here is some examples combining both responses:

Official API StatusPage Combined Response
Server's up All Systems Operational Server's up and everything's fine
Server's down All Systems Operational Server's down, cause unknown
Server's down Maintenance Server's down due to maintenance
Server's up, limited access Maintenance Server's down due to maintenance (this happens after the above example and indicates the maintenance is about to end)
Server's up, limited access All Systems Operational Limited logins (usually preparation for maintenance)
Server's down Partial / Minor / Major Outage Server's down due to outage
Server's up Maintenance Planned maintenance (servers going down in the next 48 hours)

Note: For any example not covered by the table above - please be sure to discuss the resulting combined response here.

The resulting combined response should be an object of a new class, encompassing information from both responses. Preferably operating on raw data, but I'm okay with just combining the two current responses too.

aRez 0.2.0 changes

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.

Add in player ranks to class arez.MatchPlayer.

Although it would have to be manually processed for non-ranked matches (since this field would be empty/meaningless) it would be nice if it was possible to access rank data that's outside of a player object in a match so that the rank of a Private player can be accessed.

For example:
ranked_keyboard
and
ranked_controller

to be accessible at the arez.MatchPlayer level instead of having to look in the arez.Player level.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.