Closed leonhard-s closed 3 years ago
I ended up implementing a fallback __getattr__
hook to Ps2Object
to fall through to the data class for attributes and added type hints to include these attributes in the regular object's IntelliSense (21e7e6e).
This is slightly redundant, but also allows us to rename and reorganise attributes in the main classes as we desire (e.g. prestive_level
being renamed or aliased to asp_rank
).
Currently most data received through the object model is only available through
Ps2Object.data
, which is a named tuple containing the original data received.However, all commonly used data should also be available through class
@property
-s. The named tuple is only for reference when making requests.Some thoughts/tentative guidelines:
datetime.datetime
for timestamps, seconds asfloat
for any durations, etc.)Example: