cjcodeproj / medialibrary

Python code to read XML media files
MIT License
2 stars 0 forks source link

Command line tools should be a separate module. #61

Open cjcodeproj opened 2 years ago

cjcodeproj commented 2 years ago

The core function of the medialibrary module is reading the XML files in a repository and providing Python code representations of the data. The Proof Of Concept tools included with the module are written to show what can be made with the code base. They all provide barebones examples of things work, and can be used as instructional guides for anyone using the code base.

If further improvements are made to the proof of concept tools, they should be directed to the effort of building a separate Python module designed to act as a command line interface client.

The code should act as a command line level tool, similar to other Python tools, where a front end program is installed in a bin/ path, accessible from a user shell, capable of handling command line requests.

$ media movies list --sort runtime
$ media movies cast list 
$ media devices list --type bluray 

It will require a code base capable of handling a complex argparse command tree, and delegate the functionality to the correct module. It would also require thoughtful delegation between where the code goes in the medialibrary module, and the command line module, as well as a coordinated release effort in order to keep dependencies in check.

cjcodeproj commented 1 month ago

Coding Notes

Not sure if the command line syntax should be command-noun-verb or command-verb-noun

$ media movies list
$ media list movies

The command would be directed to a module in the package specified in the pyproject.toml file under the project.scripts block, which would be a dedicated module with a huge decision tree handling everything from the argparse object.

The command-noun-verb method makes a little more sense because there could be scenarios where not every verb is applicable to every conceivable type of content. Obviously a music album would not have a cast list. It would also work better with commands dealing with stuff like the authorship records.