Skip to content

Python refactoring?  #99

Open
Open
@techdragon

Description

@techdragon

Currently the python component is... a bit quirky.

The a few things I've found which seem sort of easy to fix if your interested in getting PRs for each of them:

  • app.py getting transformed into __main__.py and the __init__.py being echoed into the python package from a shell script, definitely resulted in several minutes of confusion looking for the python library code (which I'd like to be able to save other devs in future)
  • The level of code duplication between Python app.py and JavaScript app.js seems like it could be improved but that would require one to depend on the other.
  • The need to use the import module to import it as the package doesn't use a "normal import mechanism" compatible name. Some find and replace work will get this taken care of.
  • Performing re.compile()(import aliased from re import compile as recompile) during class init instead of as part of a module load
  • Having everything in __main__.py makes it more challenging to read and understand things than it needs to be.
  • The deeply nested sections of data processing use a lot of helper functions that could be moved to the module level and tidied a bit by inverting some if conditions to remove unnecessary use of pass and putting the actually desired output inside the else

I suppose the TLDR is... There's quite a lot of refactoring opportunities in the python code (and the python packaging) but the code also looks like it has a very personal style, so if you would prefer to not have significant refactoring PRs submitted, then it would be good to know before I went ahead and wrote one, or multiple 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions