Skyscanner / skyscanner-python-sdk

Skyscanner Python SDK
Other
122 stars 33 forks source link

Parsing API response into objects #5

Open ddudnik opened 9 years ago

ddudnik commented 9 years ago

This is more of a conceptual discussion that an issue.

What are your thoughts about parsing API response into populated Python objects? So the user of the SDK will interact with more strictly specified objects instead of free-form JSON. Or, maybe, parse only a fraction of data, the one which is used more often or referred to by ID from other parts of response (like Places, Carriers, Agents etc.).

Of course it adds additional overhead for supporters since all the JSON 'schema' changes should be reflected in the code.

I can see the advantages and drawbacks in both approaches, so would be great to know what you guys have in mind.

Cheers, Denis