Create simple command line tools with osxphotos #985
RhetTbull
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A common task I have with osxphotos is to find certain photos in the database then do something with those photos (print out information, update metadata, etc.) I found I was writing a lot of the same code over and over. osxphotos v0.57.0 adds a new
@query_command
decorator to turn your python function into a full fledged osxphotos command line tool with a few lines of code. It gives you the full power of theosxphotos query
command in your custom code with no boilerplate. I've added a few examples to the examples folder showing how to do this. Here's a simple example with comments:You can run this using osxphotos itself so you don't even need to install any python modules:
osxphotos run example.py
or via python if you want to:python example.py
. Tryosxphotos run example.py --help
to see the help for your new CLI.Beta Was this translation helpful? Give feedback.
All reactions