leonhard-s / auraxium

A high-level Python wrapper for the PlanetSide 2 API.
https://auraxium.readthedocs.io/
MIT License
28 stars 8 forks source link

[FEATURE] Implementing show as a named parameter for query and join #7

Closed LordFlashmeow closed 4 years ago

LordFlashmeow commented 4 years ago

Is your feature request related to a problem? Please describe. I would like to pass a list of fields to show into my query without having to call the show() function.

Describe the solution you'd like Adding show to the initializer of Query and Join of the type List[str]

Describe alternatives you've considered Passing in show as a Term does not add the command. Additionally, hide_fields() (or set_hide_fields() depending on if the PR goes through) takes fields after the first as *args instead of a list, so it is more challenging to set the fields if you already have a list.

Additional context Add any other context or screenshots about the feature request here. I'll add to the PR soon.

leonhard-s commented 4 years ago

This functionality was considered originally, but it ended up making the functions themselves very verbose. I therefore opted to implement any query commands as methods to reduce the number of arguments in the constructors.

I agree that this is suboptimal, but I am a bit short on alternatives that don't cause more confusion (i.e. "why is X a parameter but Y isn't?"). We could look into parameter objects or piles of anonymous kwargs, but neither struck me as overly intuitive.

Maybe my initial idea of sticking close to the source was flawed - after all, what's the point of an API wrapper if it's just the same convoluted system using a different syntax?

// Edit: See #8 regarding the last rhetorical question.

leonhard-s commented 4 years ago

Implemented in f6c085af.