ramonsaraiva / pubg-python

A python wrapper for the PUBG developer API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support multiple concurrent filters

kontravariant opened this issue · comments

Where the existing implementation is:

squad_matches = api.matches().filter('gameMode', 'squad')
solo_matches = api.matches().filter('gameMode', 'solo')
after_2018 = api.matches().filter('createdAt-start', '2018-01-01T00:00:00Z')

I would suggest supporting an array of filters. For instance, if I want solo matches after 2018 I think this would be an efficient method:

solo_after_2018 = api.matches().filter(gameMode='solo', createdAt-start='2018-01-01T00:00:00Z')

Which would take advantage of **kwargs. Another option is

filter('gameMode=solo', 'createdAt-start=2018-01-01T00:00:00Z')

Either can be parsed as a series of calls to the existing filter method.

Yeah.

Even though we can right now apply chained filter calls, we should allow a multi filter in a single call, i'm with you on that.

Unfortunately, the filters the API uses have some special characters so we can't use the "real" name as a kwarg, but i'll think about something similar.

Thanks for the suggestion.