Replies: 3 comments 2 replies
-
|
Hi. Not sure what the issue is with importing osxphotos. As long as osxphotos is installed in your environment you should be able to directly import it. However, for just playing around or for prototyping, osxphotos includes a built in Python REPL based on ptpython (similar to bpython) that has great auto-complete. Just type You can use this REPL even if python isn't installed system-wide as it uses the python environment installed with osxphotos. When you launch If you find you need an external package from PyPI in your script, you can also use In short, osxphotos is not just a python app but also a full python environment that gives you full access to python while using osxphotos. |
Beta Was this translation helpful? Give feedback.
-
|
It occurred to me you may have installed osxphotos using |
Beta Was this translation helpful? Give feedback.
-
|
The built-in REPL looks completely suitable for purpose - great.
Thanks for the example, worked for me as advertised (a little slow to
initialize against a 60,000 image library, so will look to see if it can
lazy load anything)
I did use pipx to install it, so yes, your theory sounds right to me. I
was/am tripping over the issue too where homebrew installs python3.11 when
it installs bpython or pipx, but osxphotos uses 3.10, but again, while I
like bpython, the built-in REPL is just fine - it's only to have a look at
object's methods and have a play.
I plan to use your library to allow me to say, look at a photo's "native"
name in Photos, then have your software tell me to which GUID-based name it
relates when I'm browsing the images in Luminar Neo... Ukrainian Lightroom
:-) I have Luminar pointed at the Photos Library.photoslibrary/originals
(Skylum devs don't advise it, but copying massive sets of images to another
directory defeats the advantage of a lightweight, non-destructive editor,
no?). Because Luminar is looking at ./originals, it sees only the GUID
filenames because it doesn't have your library to correlate them to the the
Photos metadata.
Thanks again for some very clever software and prompt, useful replies, Rhet.
Cheers -
Geo
…On Sat, Nov 12, 2022 at 6:16 PM Rhet Turnbull ***@***.***> wrote:
It occurred to me you may have installed osxphotos using pipx then tried
to do import osxphotos from your system python prompt. If so, that won't
work as pipx creates a separate python environment for each app. You'd
need to do python3 -m pip install osxphotos to install osxphotos into
your python environment then you could do import osxphotos. But, as
stated above, it may be sufficient to use the built in REPL for osxphotos
using osxphotos repl. I use this all the time for experimenting and
prototyping.
—
Reply to this email directly, view it on GitHub
<#822 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYDTYMWDSQ6P2EYZX5KXFDWH4R3ZANCNFSM6AAAAAAR6DBCSU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Killer library - the
osxphotos inspectis nifty - by enabling correlating the photo's GUID to original filename, it's the first true workaround to the ghosted menu "Show in Finder"Question
Do you have a way you would
import osxphotosin a python shell and interact with the API?Reason: before scripting, I usually have a play with the API in bpython because it has a killer API autocompleter. I've had some version compatibility issues with bpython/homebrew/python/pipx, but that aside, I've had trouble even doing
import osxphotosfrom a plain python shell. I'm not sure what to put in PYTHONPATH or sys.path to get the interpreter to find the module. Only when the import is in a script called from the CLIosxphotos run <script.py>does it work.I'm sure I'm being daft and missing something obvious, let me know how you might do it.
Beta Was this translation helpful? Give feedback.
All reactions