EnterpriseyIntranet / nextcloud-API

NextCloud OCS API for Python
GNU General Public License v3.0
27 stars 27 forks source link

Redesign the module's API #4

Closed matejak closed 5 years ago

matejak commented 5 years ago

In time of creating this issue, the API usage patterns are mediocre, and the implementation is somehow complex. The API of the REST API module can certainly be redesigned to make implementation easier.

matejak commented 5 years ago

As the implementation grows, following features gain shape:

danil-topchiy commented 5 years ago
  • The NextCloud.py file is too big. It is worth considering one file per API, and using imports to make them available using a single import.

Merged in #19

  • Constructs s.a. add_to_group_res['ocs']['meta']['statuscode'] == 100 are used very often. All API results objects should allow something easier s.a. add_to_group_res.was_successful to have bool value, and potentially add_to_group_res.error to be either None/empty string, or an error string. There are also exceptions, it may be better to watch for an exception for being raised than checking every query about it's result. Let's brainstorm on this!

Opened PR #26

As discussed in #19, renamed package from NextCloud to nextcloud in #27

matejak commented 5 years ago

Done for now. Until 1.0 is released, we can toy with the API as we please, but other modifications should be based on feedback from production.