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

Replace dict-helpers and proxy system with `.query()` factories #71

Open leonhard-s opened 1 year ago

leonhard-s commented 1 year ago

The mid-term strategy for Auraxium is to decouple the wrapper features from the object model. Feature-rich proxies and class-specific functionality are incompatible with this goal.

Proxies

While functional, the proxy system never reached a satisfactory state (see #22) and attempting to reach feature-parity with actual joins would lead to a slow and fragile mechanism that will break with every major API change.

Object Model Helpers

Similarly, the class-specific helper methods such as Character.get_online() are useful but must be implemented in an easier-to-maintain way. This could be achieved by promoting the census module to a first-class API that is easier to integrate into the object model (see #45).

The helper methods could either be injected into pydantic-generated classes at runtime (required to support #70), or would live in a separate namespace, taking the object model they operate on as an argument. This would also close the gap between built-in helpers (which are methods as of v0.3) and user-defined ones (see the get_online_friends(<character>) helper in the v0.3 Docs).