The current file/module organization lacks coherence at this time.
It's not clear why session_token.py belongs in "utils" for example.
I think we have a natural organization for the files that would match the documentation menu to highlight the Shopify features handled by SPyLib:
spylib
├── admin_api.py # Instead of tokens.py
├── hmac.py # Exposing to the user more directly. Maybe should be added to docs menu.
├── oauth
├── session_token.py
├── webhook.py
This way we have a natural organization for future Shopify features that SPyLib handles and it makes the imports a lot more logical:
from spylib.session_token import SessionToken
Also we should reorganize the webhooks into functions to avoid making the Token class bloated. We can simply have:
The current file/module organization lacks coherence at this time. It's not clear why
session_token.py
belongs in "utils" for example.I think we have a natural organization for the files that would match the documentation menu to highlight the Shopify features handled by SPyLib:
This way we have a natural organization for future Shopify features that SPyLib handles and it makes the imports a lot more logical:
Also we should reorganize the webhooks into functions to avoid making the
Token
class bloated. We can simply have:Originally posted by @hillairet in https://github.com/SatelCreative/spylib/discussions/127
Additionally let's not expose the functions and classes at the top level of the package. In other words this should not be possible:
Instead we can only do: