Skip to content

Make callable from Python #2

@alexander-bauer

Description

@alexander-bauer

Hello!

I am looking into calling EasyUCS from a Python module. Ideally, this would look like the existing easyucs.py script decomposed into a handful of functions that validate their arguments like the current argparse ones are validated.

This is a reasonably tall order, of course, and demands some pretty major restructuring. I think the pieces are these:

  1. Make EasyUCS into a package that can be installed with distutils/pip, so that it can be imported sanely.
  2. Adjust the easyucs.py and easyucs_gui.py tooling and documentation to be invoked as Python modules, so that both the new distutils/pip install and the existing "invoke from the current working directory" methods work as expected
    • (This would look like python -m easyucs.easyucs <cmdline_arguments> or python -m easyucs.easyucs_gui <cmdline_arguments>. Perhaps easyucs and easyucs_gui scripts could be installed to make those invocations easier.)
  3. Move the program logic and input validation in easyucs.py into one or a few high-level functions elsewhere in the package that easyucs.py can then import, and call after parsing its arguments like today.

I will submit a pull request soon that addresses most of points 1 and 2, but would appreciate your (@vesposito) input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions