I think the interface should be more object oriented. This would be more intuitive particularly for things like regions and the economy coder, be more consistent with pandas, and make it easier to integrate with iPython (e.g., formatted output). But I want to take some time to think through a comprehensive approach.
In most cases this would mean returning objects that subclasses an iterable, like a dict or set, or maybe a Pandas dataframe or series, which adds custom __repr__ and _repr_html_ classes.
So for instance:
the info() functions would return iterables able to print themselves
same with coder.lookup, adding a custom function to help with diagnostics
Deciding not to do the region(x).members interface as it's not intuitive for passing lists of regions, e.g., income.members(['HIC', 'LIC']) (would one call get or list in this instance?)
I think the interface should be more object oriented. This would be more intuitive particularly for things like regions and the economy coder, be more consistent with pandas, and make it easier to integrate with iPython (e.g., formatted output). But I want to take some time to think through a comprehensive approach.
In most cases this would mean returning objects that subclasses an iterable, like a dict or set, or maybe a Pandas dataframe or series, which adds custom
__repr__
and_repr_html_
classes.So for instance: