limx0 / betfair_parser

BSD 2-Clause "Simplified" License
6 stars 1 forks source link

Renaming streaming message attributes #38

Closed ml31415 closed 1 year ago

ml31415 commented 1 year ago

The streaming messages contain a lot of cryptic fields like "pt", "ct", "batb" and so on. While this makes sense in order to save bandwith, it doesn't make sense for us to have the object attributes named like that, as msgspec is perfectly capable of translating the names under the hood as we already do with the camel case to snake case translation.

On one hand, it would make working with the API a bit nicer and self explanatory, on the other hand, it would make the string representations of the messages more lengthy and verbose. Also, it's a breaking change.

@limx0 What do you think, is it worth to rename the fields?

limx0 commented 1 year ago

Agreed on your thoughts above. I prefer mapping the API as closely as possibly, it tends to lead to less confusion overall, so slight preference for leaving as it but definitely not opposed.

limx0 commented 1 year ago

I think users will invariably write nicer wrappers over Betfair parsers for their own patterns or uses, so fine for us to stay closely matching the API and docs.

ml31415 commented 1 year ago

Alright. I guess I might just add some @propertys for aliasing then.