cthoyt / ontoportal-client

🎡 Unified access to OntoPortal instances like BioPortal, AgroPortal, and EcoPortal
https://ontoportal-client.readthedocs.io
MIT License
4 stars 1 forks source link

Consider returning dataclasses #3

Open cmungall opened 2 years ago

cmungall commented 2 years ago

Currently the only method get_ontologies() doesn't have any return type annotated - it just passes directly to get_json which returns a dict

https://ontoportal-client.readthedocs.io/en/latest/_modules/ontoportal_client/api.html#OntoPortalClient.get_json

Consider returning either a typed dict or dataclasses/pydantic

This would obviously require a tighter coupling but I think this is a good thing - at the moment there is a not a massive advantage to using this client vs raw requests

cthoyt commented 2 years ago

Yes, I think there should be a dichotomy of low-level operations that just get the results back then on top of that we can implement operations that do some processing and wrapping.