Giter Site home page Giter Site logo

pysmash's People

Contributors

ishroudd avatar petercat12 avatar wernight avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pysmash's Issues

Inconsistent requirements

In setup.py as well as requirements.py it says that pysmash needs requests 2.12.1, while in the readme.md it says requests 2.10.0.

Error when retrieving players of incomplete multistage event

I only have a test size of 1, but it seems like for a multistage event, if one of the events hasn't started yet. I'm not sure why this would happen. The following is the traceback:

Traceback (most recent call last):
File "C:\Users\invat\OneDrive\Documents\Python\SmashStream\SmashGGSupport.py", line 40, in
sso = SmashGGSupportObject( tournamentName, event)
File "C:\Users\invat\OneDrive\Documents\Python\SmashStream\SmashGGSupport.py", line 10, in init
self.players = self.smash.tournament_show_players(self.tournamentID,self.event)
File "C:\Python36\lib\site-packages\pysmash\smashgg.py", line 51, in tournament_show_players
return tournaments.show_players(tournament_name, tournament_params, event)
File "C:\Python36\lib\site-packages\pysmash\tournaments.py", line 61, in show_players
bracket_players = brackets.players(bracket_id)
File "C:\Python36\lib\site-packages\pysmash\brackets.py", line 13, in players
response = _filter_player_response(response)
File "C:\Python36\lib\site-packages\pysmash\brackets.py", line 83, in _filter_player_response
entrants = response['entities']['entrants']
KeyError: 'entrants'

As a work around for myself atm, I've changed response['entities']['entrants'] to response['entities'].get('entrants') and return an empty list if that returns None. This seems to get me by for now. Haven't had time to trace it all the way down yet, but does the library try to obtain players for each phase/pool/bracket of the event separately? If so I wonder if Smash.gg doesn't even give that field until after that stage is "Primed with players" from the previous stage, as once all the previous stages are complete the problem goes away and the entrants key magically appears in the response.

Sorry if this was long winded.

Readme.md typos

There's a typo in the first paragraph of Basic Usage: it says "isntance" istead of "instance".
Also there are some problems with the tournaments_show_events block:

  • it is not properly formatted (I think it's missing closing code tags)
  • response type looks like a list but is actually a dictionary containing a list

Access objects via id

I currently do not see a way to get the data of any api object based on their id other than tournaments.
It would be good to have something like this:

api-object = smash.show_api-object-type(api-object-id)

that returns a dict with the matching data.
Alternatively something like this would work as well:

anything = smash.show(anything-id, anything-object-type)

KeyError when retrieving sets from bracket without sets

When accessing a bracket's sets that doesn't have any (because it i.e. doesn't have any participants yet) like this:

sets = smash.bracket_show_sets(bracket_id_of_bracket_that_doesnt_have_sets)

you get this:

In get Sets:
  File "C:\Program Files\Python35\lib\site-packages\discord\ext\commands\core.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "C:\Users\Timo\PycharmProjects\Smashy-Bot\cogs\smashy.py", line 85, in get_sets
    sets = smash.bracket_show_sets(bracket)
  File "C:\Program Files\Python35\lib\site-packages\pysmash\smashgg.py", line 53, in bracket_show_sets
    return brackets.sets(bracket_id, filter_response)
  File "C:\Program Files\Python35\lib\site-packages\pysmash\brackets.py", line 24, in sets
    response = _filter_set_response(response)
  File "C:\Program Files\Python35\lib\site-packages\pysmash\brackets.py", line 111, in _filter_set_response
    bracket_sets = response['entities']['sets']
KeyError: 'sets'

Valid event names

Since you only include WiiU events as valid events, every other type of event throws a ValidationError, including melee, which is way more popular than Sm4sh.
This also makes it impossible to look for custom events that aren't related to smash (like Rivals of Aether, Clash Royale, Guilty Crown, Street Fighter,...)

No show_events function

Something like:

events = smash.tournament_show_events(tourney_name)

is missing currently.

Not returning all sets

Some querys for sets don't return all sets. For example the query for the bracket with id 273020 using bracket_show_set only returns 1 set with id 6460971. It instead should be returning 3 as seen here.

It does the same with the bracket with id 269808.

I have no idea what could be causing this and it was fine about two weeks ago and now it just doesn't work anymore. My suspicion is that the smash.gg adding the search feature messed with some parts of the api.

How to get valid querying parameters?

In the util.py file you have the following code:

        if param not in valid_params:
            error_msg = """
                '{0}' is not a valid query param for route of type: {1}.
                Valid types are [{2}].
             """.format(param, route_type, ', '.join(valid_params))
            raise exceptions.ValidationError(error_msg)

Is there a way to store the list of valid query types via a call to your API? If I'm trying to extract the bracket for Ultimate-Singles, it is helpful to know which of many different slug variants is actually used in the a given tournament, without iteratively trying each one.

Problems with players without contact info

Hey, some of the tournaments in our region use Smash.gg with on site tournament registration, and some of the players don't have any contact info. This causes issues when I try any of the show player calls. An example of such a tournament is ID 2927.

Api updates

Just wanted to know if you're gonna bring the wrapper up to date with the Smash.gg API changes or if this repo is gonna be dead.

tournaments_show_events only returns names

tournament_show_events function only returns the names. I'm not sure if this is intended but this approach is different from all other show_ methods where you get all data (including id which is kinda important)

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.