typeform-python-sdk icon indicating copy to clipboard operation
typeform-python-sdk copied to clipboard

Code refactoring of the whole project

Open Incred opened this issue 2 years ago • 0 comments

Came across with the project accidentally (actually use TypeForm API in production (but my own implementation)). After reading the code, I decided that it should be refactored a little, as I noticed many cases that, in my opinion, need to be rewritten:

  • functions in utils seem to me pretty strange and even a little redundant (e.g. mergeDict: since starting with python 3.9 it's enought to use "|" for dicts union), naming of the functions etc.
  • PEP-8 violations: naming of variables (it is preferable to use lower case with underscores), max line length, docstrings, etc
  • There are unused constants in constants.py. And actually it seems like it's better to name it settings.py instead.
  • string formatting. Much more readable (IMHO) use f-strings there (since python 3.6)

actually already have a commit with all these changes: https://github.com/Typeform/typeform-python-sdk/commit/7910ba43d3ad2496a6cfb26afacc256064f5d1df So I can make a PR

Incred avatar Feb 13 '23 17:02 Incred