osxphotos command line interface (CLI)

osxphotos

osxphotos [OPTIONS] COMMAND [ARGS]...

Options

--db <Photos database path>

Specify Photos database path. Path to Photos library/database can be specified using either –db or directly as PHOTOS_LIBRARY positional argument. If neither –db or PHOTOS_LIBRARY provided, will attempt to find the library to use in the following order: 1. last opened library, 2. system library, 3. ~/Pictures/Photos Library.photoslibrary

--json

Print output in JSON format.

-v, --version

Show the version and exit.

about

Print information about osxphotos including license.

osxphotos about [OPTIONS]

albums

Print out albums found in the Photos library.

osxphotos albums [OPTIONS] [PHOTOS_LIBRARY]...

Options

--db <Photos database path>

Specify Photos database path. Path to Photos library/database can be specified using either –db or directly as PHOTOS_LIBRARY positional argument. If neither –db or PHOTOS_LIBRARY provided, will attempt to find the library to use in the following order: 1. last opened library, 2. system library, 3. ~/Pictures/Photos Library.photoslibrary

--json

Print output in JSON format.

Arguments

PHOTOS_LIBRARY

Optional argument(s)

dump

Print list of all photos & associated info from the Photos library.

osxphotos dump [OPTIONS] [PHOTOS_LIBRARY]...

Options

--db <Photos database path>

Specify Photos database path. Path to Photos library/database can be specified using either –db or directly as PHOTOS_LIBRARY positional argument. If neither –db or PHOTOS_LIBRARY provided, will attempt to find the library to use in the following order: 1. last opened library, 2. system library, 3. ~/Pictures/Photos Library.photoslibrary

--json

Print output in JSON format.

--deleted

Include photos from the ‘Recently Deleted’ folder.

--deleted-only

Include only photos from the ‘Recently Deleted’ folder.

Arguments

PHOTOS_LIBRARY

Optional argument(s)

export

Export photos from the Photos database. Export path DEST is required. Optionally, query the Photos database using 1 or more search options; if more than one option is provided, they are treated as “AND” (e.g. search for photos matching all options). If no query options are provided, all photos will be exported. By default, all versions of all photos will be exported including edited versions, live photo movies, burst photos, and associated raw images. See –skip-edited, –skip-live, –skip-bursts, and –skip-raw options to modify this behavior.

osxphotos export [OPTIONS] [PHOTOS_LIBRARY]... DEST

Options

--db <Photos database path>

Specify Photos database path. Path to Photos library/database can be specified using either –db or directly as PHOTOS_LIBRARY positional argument. If neither –db or PHOTOS_LIBRARY provided, will attempt to find the library to use in the following order: 1. last opened library, 2. system library, 3. ~/Pictures/Photos Library.photoslibrary

-V, --verbose

Print verbose output.

--keyword <KEYWORD>

Search for photos with keyword KEYWORD. If more than one keyword, treated as “OR”, e.g. find photos matching any keyword

--person <PERSON>

Search for photos with person PERSON. If more than one person, treated as “OR”, e.g. find photos matching any person

--album <ALBUM>

Search for photos in album ALBUM. If more than one album, treated as “OR”, e.g. find photos matching any album

--folder <FOLDER>

Search for photos in an album in folder FOLDER. If more than one folder, treated as “OR”, e.g. find photos in any FOLDER. Only searches top level folders (e.g. does not look at subfolders)

--name <FILENAME>

Search for photos with filename matching FILENAME. If more than one –name options is specified, they are treated as “OR”, e.g. find photos matching any FILENAME.

--uuid <UUID>

Search for photos with UUID(s).

--uuid-from-file <FILE>

Search for photos with UUID(s) loaded from FILE. Format is a single UUID per line. Lines preceded with # are ignored.

--title <TITLE>

Search for TITLE in title of photo.

--no-title

Search for photos with no title.

--description <DESC>

Search for DESC in description of photo.

--no-description

Search for photos with no description.

--place <PLACE>

Search for PLACE in photo’s reverse geolocation info

--no-place

Search for photos with no associated place name info (no reverse geolocation info)

--label <LABEL>

Search for photos with image classification label LABEL (Photos 5 only). If more than one label, treated as “OR”, e.g. find photos matching any label

--uti <UTI>

Search for photos whose uniform type identifier (UTI) matches UTI

-i, --ignore-case

Case insensitive search for title, description, place, keyword, person, or album.

--edited

Search for photos that have been edited.

--external-edit

Search for photos edited in external editor.

--favorite

Search for photos marked favorite.

--not-favorite

Search for photos not marked favorite.

--hidden

Search for photos marked hidden.

--not-hidden

Search for photos not marked hidden.

--shared

Search for photos in shared iCloud album (Photos 5 only).

--not-shared

Search for photos not in shared iCloud album (Photos 5 only).

--burst

Search for photos that were taken in a burst.

--not-burst

Search for photos that are not part of a burst.

--live

Search for Apple live photos

--not-live

Search for photos that are not Apple live photos.

--portrait

Search for Apple portrait mode photos.

--not-portrait

Search for photos that are not Apple portrait mode photos.

--screenshot

Search for screenshot photos.

--not-screenshot

Search for photos that are not screenshot photos.

--slow-mo

Search for slow motion videos.

--not-slow-mo

Search for photos that are not slow motion videos.

--time-lapse

Search for time lapse videos.

--not-time-lapse

Search for photos that are not time lapse videos.

--hdr

Search for high dynamic range (HDR) photos.

--not-hdr

Search for photos that are not HDR photos.

--selfie

Search for selfies (photos taken with front-facing cameras).

--not-selfie

Search for photos that are not selfies.

--panorama

Search for panorama photos.

--not-panorama

Search for photos that are not panoramas.

--has-raw

Search for photos with both a jpeg and raw version

--only-movies

Search only for movies (default searches both images and movies).

--only-photos

Search only for photos/images (default searches both images and movies).

--from-date <from_date>

Search by item start date, e.g. 2000-01-12T12:00:00, 2001-01-12T12:00:00-07:00, or 2000-12-31 (ISO 8601 with/without timezone).

--to-date <to_date>

Search by item end date, e.g. 2000-01-12T12:00:00, 2001-01-12T12:00:00-07:00, or 2000-12-31 (ISO 8601 with/without timezone).

--from-time <from_time>

Search by item start time of day, e.g. 12:00, or 12:00:00.

--to-time <to_time>

Search by item end time of day, e.g. 12:00 or 12:00:00.

--has-comment

Search for photos that have comments.

--no-comment

Search for photos with no comments.

--has-likes

Search for photos that have likes.

--no-likes

Search for photos with no likes.

--is-reference

Search for photos that were imported as referenced files (not copied into Photos library).

--in-album

Search for photos that are in one or more albums.

--not-in-album

Search for photos that are not in any albums.

--min-size <SIZE>

Search for photos with size >= SIZE bytes. The size evaluated is the photo’s original size (when imported to Photos). Size may be specified as integer bytes or using SI or NIST units. For example, the following are all valid and equivalent sizes: ‘1048576’ ‘1.048576MB’, ‘1 MiB’.

--max-size <SIZE>

Search for photos with size <= SIZE bytes. The size evaluated is the photo’s original size (when imported to Photos). Size may be specified as integer bytes or using SI or NIST units. For example, the following are all valid and equivalent sizes: ‘1048576’ ‘1.048576MB’, ‘1 MiB’.

--regex <REGEX TEMPLATE>

Search for photos where TEMPLATE matches regular expression REGEX. For example, to find photos in an album that begins with ‘Beach’: ‘–regex “^Beach” “{album}”’. You may specify more than one regular expression match by repeating ‘–regex’ with different arguments.

--query-eval <CRITERIA>

Evaluate CRITERIA to filter photos. CRITERIA will be evaluated in context of the following python list comprehension: photos = [photo for photo in photos if CRITERIA] where photo represents a PhotoInfo object. For example: –query-eval photo.favorite returns all photos that have been favorited and is equivalent to –favorite. You may specify more than one CRITERIA by using –query-eval multiple times. CRITERIA must be a valid python expression. See https://rhettbull.github.io/osxphotos/ for additional documentation on the PhotoInfo class.

--missing

Export only photos missing from the Photos library; must be used with –download-missing.

--deleted

Include photos from the ‘Recently Deleted’ folder.

--deleted-only

Include only photos from the ‘Recently Deleted’ folder.

--update

Only export new or updated files. See notes below on export and –update.

--ignore-signature

When used with ‘–update’, ignores file signature when updating files. This is useful if you have processed or edited exported photos changing the file signature (size & modification date). In this case, ‘–update’ would normally re-export the processed files but with ‘–ignore-signature’, files which exist in the export directory will not be re-exported. If used with ‘–sidecar’, ‘–ignore-signature’ has the following behavior: 1) if the metadata (in Photos) that went into the sidecar did not change, the sidecar will not be updated; 2) if the metadata (in Photos) that went into the sidecar did change, a new sidecar is written but a new image file is not; 3) if a sidecar does not exist for the photo, a sidecar will be written whether or not the photo file was written or updated.

--only-new

If used with –update, ignores any previously exported files, even if missing from the export folder and only exports new files that haven’t previously been exported.

--dry-run

Dry run (test) the export but don’t actually export any files; most useful with –verbose.

Hardlink files instead of copying them. Cannot be used with –exiftool which creates copies of the files with embedded EXIF data. Note: on APFS volumes, files are cloned when exporting giving many of the same advantages as hardlinks without having to use –export-as-hardlink.

--touch-file

Sets the file’s modification time to match photo date.

--overwrite

Overwrite existing files. Default behavior is to add (1), (2), etc to filename if file already exists. Use this with caution as it may create name collisions on export. (e.g. if two files happen to have the same name)

--retry <RETRY>

Automatically retry export up to RETRY times if an error occurs during export. This may be useful with network drives that experience intermittent errors.

--export-by-date

Automatically create output folders to organize photos by date created (e.g. DEST/2019/12/20/photoname.jpg).

--skip-edited

Do not export edited version of photo if an edited version exists.

--skip-original-if-edited

Do not export original if there is an edited version (exports only the edited version).

--skip-bursts

Do not export all associated burst images in the library if a photo is a burst photo.

--skip-live

Do not export the associated live video component of a live photo.

--skip-raw

Do not export associated raw images of a RAW+JPEG pair. Note: this does not skip raw photos if the raw photo does not have an associated jpeg image (e.g. the raw file was imported to Photos without a jpeg preview).

--current-name

Use photo’s current filename instead of original filename for export. Note: Starting with Photos 5, all photos are renamed upon import. By default, photos are exported with the the original name they had before import.

--convert-to-jpeg

Convert all non-jpeg images (e.g. raw, HEIC, PNG, etc) to JPEG upon export. Only works if your Mac has a GPU.

--jpeg-quality <jpeg_quality>

Value in range 0.0 to 1.0 to use with –convert-to-jpeg. A value of 1.0 specifies best quality, a value of 0.0 specifies maximum compression. Defaults to 1.0

--download-missing

Attempt to download missing photos from iCloud. The current implementation uses Applescript to interact with Photos to export the photo which will force Photos to download from iCloud if the photo does not exist on disk. This will be slow and will require internet connection. This obviously only works if the Photos library is synched to iCloud. Note: –download-missing does not currently export all burst images; only the primary photo will be exported–associated burst images will be skipped.

--sidecar <FORMAT>

Create sidecar for each photo exported; valid FORMAT values: xmp, json, exiftool; –sidecar xmp: create XMP sidecar used by Digikam, Adobe Lightroom, etc. The sidecar file is named in format photoname.ext.xmp The XMP sidecar exports the following tags: Description, Title, Keywords/Tags, Subject (set to Keywords + PersonInImage), PersonInImage, CreateDate, ModifyDate, GPSLongitude, Face Regions (Metadata Working Group and Microsoft Photo). –sidecar json: create JSON sidecar useable by exiftool (https://exiftool.org/) The sidecar file can be used to apply metadata to the file with exiftool, for example: “exiftool -j=photoname.jpg.json photoname.jpg” The sidecar file is named in format photoname.ext.json; format includes tag groups (equivalent to running ‘exiftool -G -j’). –sidecar exiftool: create JSON sidecar compatible with output of ‘exiftool -j’. Unlike ‘–sidecar json’, ‘–sidecar exiftool’ does not export tag groups. Sidecar filename is in format photoname.ext.json; For a list of tags exported in the JSON and exiftool sidecar, see ‘–exiftool’. See also ‘–ignore-signature’.

Options

xmp | json | exiftool

--sidecar-drop-ext

Drop the photo’s extension when naming sidecar files. By default, sidecar files are named in format ‘photo_filename.photo_ext.sidecar_ext’, e.g. ‘IMG_1234.JPG.xmp’. Use ‘–sidecar-drop-ext’ to ignore the photo extension. Resulting sidecar files will have name in format ‘IMG_1234.xmp’. Warning: this may result in sidecar filename collisions if there are files of different types but the same name in the output directory, e.g. ‘IMG_1234.JPG’ and ‘IMG_1234.MOV’.

--exiftool

Use exiftool to write metadata directly to exported photos. To use this option, exiftool must be installed and in the path. exiftool may be installed from https://exiftool.org/. Cannot be used with –export-as-hardlink. Writes the following metadata: EXIF:ImageDescription, XMP:Description (see also –description-template); XMP:Title; XMP:TagsList, IPTC:Keywords, XMP:Subject (see also –keyword-template, –person-keyword, –album-keyword); XMP:PersonInImage; EXIF:GPSLatitudeRef; EXIF:GPSLongitudeRef; EXIF:GPSLatitude; EXIF:GPSLongitude; EXIF:GPSPosition; EXIF:DateTimeOriginal; EXIF:OffsetTimeOriginal; EXIF:ModifyDate (see –ignore-date-modified); IPTC:DateCreated; IPTC:TimeCreated; (video files only): QuickTime:CreationDate; QuickTime:CreateDate; QuickTime:ModifyDate (see also –ignore-date-modified); QuickTime:GPSCoordinates; UserData:GPSCoordinates.

--exiftool-path <EXIFTOOL_PATH>

Optionally specify path to exiftool; if not provided, will look for exiftool in $PATH.

--exiftool-option <OPTION>

Optional flag/option to pass to exiftool when using –exiftool. For example, –exiftool-option ‘-m’ to ignore minor warnings. Specify these as you would on the exiftool command line. See exiftool docs at https://exiftool.org/exiftool_pod.html for full list of options. More than one option may be specified by repeating the option, e.g. –exiftool-option ‘-m’ –exiftool-option ‘-F’.

--exiftool-merge-keywords

Merge any keywords found in the original file with keywords used for ‘–exiftool’ and ‘–sidecar’.

--exiftool-merge-persons

Merge any persons found in the original file with persons used for ‘–exiftool’ and ‘–sidecar’.

--ignore-date-modified

If used with –exiftool or –sidecar, will ignore the photo modification date and set EXIF:ModifyDate to EXIF:DateTimeOriginal; this is consistent with how Photos handles the EXIF:ModifyDate tag.

--person-keyword

Use person in image as keyword/tag when exporting metadata.

--album-keyword

Use album name as keyword/tag when exporting metadata.

--keyword-template <TEMPLATE>

For use with –exiftool, –sidecar; specify a template string to use as keyword in the form ‘{name,DEFAULT}’ This is the same format as –directory. For example, if you wanted to add the full path to the folder and album photo is contained in as a keyword when exporting you could specify –keyword-template “{folder_album}” You may specify more than one template, for example –keyword-template “{folder_album}” –keyword-template “{created.year}”. See ‘–replace-keywords’ and Templating System below.

--replace-keywords

Replace keywords with any values specified with –keyword-template. By default, –keyword-template will add keywords to any keywords already associated with the photo. If –replace-keywords is specified, values from –keyword-template will replace any existing keywords instead of adding additional keywords.

--description-template <TEMPLATE>

For use with –exiftool, –sidecar; specify a template string to use as description in the form ‘{name,DEFAULT}’ This is the same format as –directory. For example, if you wanted to append ‘exported with osxphotos on [today’s date]’ to the description, you could specify –description-template “{descr} exported with osxphotos on {today.date}” See Templating System below.

--finder-tag-template <TEMPLATE>

Set MacOS Finder tags to TEMPLATE. These tags can be searched in the Finder or Spotlight with ‘tag:tagname’ format. For example, ‘–finder-tag-template “{label}”’ to set Finder tags to photo labels. You may specify multiple TEMPLATE values by using ‘–finder-tag-template’ multiple times. See also ‘–finder-tag-keywords and Extended Attributes below.’.

--finder-tag-keywords

Set MacOS Finder tags to keywords; any keywords specified via ‘–keyword-template’, ‘–person-keyword’, etc. will also be used as Finder tags. See also ‘–finder-tag-template and Extended Attributes below.’.

--xattr-template <ATTRIBUTE TEMPLATE>

Set extended attribute ATTRIBUTE to TEMPLATE value. Valid attributes are: ‘authors’, ‘comment’, ‘copyright’, ‘description’, ‘findercomment’, ‘headline’, ‘keywords’. For example, to set Finder comment to the photo’s title and description: ‘–xattr-template findercomment “{title}; {descr}” See Extended Attributes below for additional details on this option.

--directory <DIRECTORY>

Optional template for specifying name of output directory in the form ‘{name,DEFAULT}’. See below for additional details on templating system.

--filename <FILENAME>

Optional template for specifying name of output file in the form ‘{name,DEFAULT}’. File extension will be added automatically–do not include an extension in the FILENAME template. See below for additional details on templating system.

--jpeg-ext <EXTENSION>

Specify file extension for JPEG files. Photos uses .jpeg for edited images but many images are imported with .jpg or .JPG which can result in multiple different extensions used for JPEG files upon export. Use –jpeg-ext to specify a single extension to use for all exported JPEG images. Valid values are jpeg, jpg, JPEG, JPG; e.g. ‘–jpeg-ext jpg’ to use ‘.jpg’ for all JPEGs.

Options

jpeg | jpg | JPEG | JPG

--strip

Optionally strip leading and trailing whitespace from any rendered templates. For example, if –filename template is “{title,} {original_name}” and image has no title, resulting file would have a leading space but if used with –strip, this will be removed.

--edited-suffix <SUFFIX>

Optional suffix template for naming edited photos. Default name for edited photos is in form ‘photoname_edited.ext’. For example, with ‘–edited-suffix _bearbeiten’, the edited photo would be named ‘photoname_bearbeiten.ext’. The default suffix is ‘_edited’. Multi-value templates (see Templating System) are not permitted with –edited-suffix.

--original-suffix <SUFFIX>

Optional suffix template for naming original photos. Default name for original photos is in form ‘filename.ext’. For example, with ‘–original-suffix _original’, the original photo would be named ‘filename_original.ext’. The default suffix is ‘’ (no suffix). Multi-value templates (see Templating System) are not permitted with –original-suffix.

--use-photos-export

Force the use of AppleScript or PhotoKit to export even if not missing (see also ‘–download-missing’ and ‘–use-photokit’).

--use-photokit

Use with ‘–download-missing’ or ‘–use-photos-export’ to use direct Photos interface instead of AppleScript to export. Highly experimental alpha feature; does not work with iTerm2 (use with Terminal.app). This is faster and more reliable than the default AppleScript interface.

--report <path to export report>

Write a CSV formatted report of all files that were exported.

--cleanup

Cleanup export directory by deleting any files which were not included in this export set. For example, photos which had previously been exported and were subsequently deleted in Photos. WARNING: –cleanup will delete any files in the export directory that were not exported by osxphotos, for example, your own scripts or other files. Be sure this is what you intend before using –cleanup. Use –dry-run with –cleanup first if you’re not certain.

--exportdb <EXPORTDB_FILE>

Specify alternate name for database file which stores state information for export and –update. If –exportdb is not specified, export database will be saved to ‘.osxphotos_export.db’ in the export directory. Must be specified as filename only, not a path, as export database will be saved in export directory.

--load-config <config file path>

Load options from file as written with –save-config. This allows you to save a complex export command to file for later reuse. For example: ‘osxphotos export <lots of options here> –save-config osxphotos.toml’ then ‘osxphotos export /path/to/export –load-config osxphotos.toml’. If any other command line options are used in conjunction with –load-config, they will override the corresponding values in the config file.

--save-config <config file path>

Save options to file for use with –load-config. File format is TOML.

Arguments

PHOTOS_LIBRARY

Optional argument(s)

DEST

Required argument

help

Print help; for help on commands: help <command>.

osxphotos help [OPTIONS] [TOPIC]

Arguments

TOPIC

Optional argument

info

Print out descriptive info of the Photos library database.

osxphotos info [OPTIONS] [PHOTOS_LIBRARY]...

Options

--db <Photos database path>

Specify Photos database path. Path to Photos library/database can be specified using either –db or directly as PHOTOS_LIBRARY positional argument. If neither –db or PHOTOS_LIBRARY provided, will attempt to find the library to use in the following order: 1. last opened library, 2. system library, 3. ~/Pictures/Photos Library.photoslibrary

--json

Print output in JSON format.

Arguments

PHOTOS_LIBRARY

Optional argument(s)

keywords

Print out keywords found in the Photos library.

osxphotos keywords [OPTIONS] [PHOTOS_LIBRARY]...

Options

--db <Photos database path>

Specify Photos database path. Path to Photos library/database can be specified using either –db or directly as PHOTOS_LIBRARY positional argument. If neither –db or PHOTOS_LIBRARY provided, will attempt to find the library to use in the following order: 1. last opened library, 2. system library, 3. ~/Pictures/Photos Library.photoslibrary

--json

Print output in JSON format.

Arguments

PHOTOS_LIBRARY

Optional argument(s)

labels

Print out image classification labels found in the Photos library.

osxphotos labels [OPTIONS] [PHOTOS_LIBRARY]...

Options

--db <Photos database path>

Specify Photos database path. Path to Photos library/database can be specified using either –db or directly as PHOTOS_LIBRARY positional argument. If neither –db or PHOTOS_LIBRARY provided, will attempt to find the library to use in the following order: 1. last opened library, 2. system library, 3. ~/Pictures/Photos Library.photoslibrary

--json

Print output in JSON format.

Arguments

PHOTOS_LIBRARY

Optional argument(s)

list

Print list of Photos libraries found on the system.

osxphotos list [OPTIONS]

Options

--json

Print output in JSON format.

persons

Print out persons (faces) found in the Photos library.

osxphotos persons [OPTIONS] [PHOTOS_LIBRARY]...

Options

--db <Photos database path>

Specify Photos database path. Path to Photos library/database can be specified using either –db or directly as PHOTOS_LIBRARY positional argument. If neither –db or PHOTOS_LIBRARY provided, will attempt to find the library to use in the following order: 1. last opened library, 2. system library, 3. ~/Pictures/Photos Library.photoslibrary

--json

Print output in JSON format.

Arguments

PHOTOS_LIBRARY

Optional argument(s)

places

Print out places found in the Photos library.

osxphotos places [OPTIONS] [PHOTOS_LIBRARY]...

Options

--db <Photos database path>

Specify Photos database path. Path to Photos library/database can be specified using either –db or directly as PHOTOS_LIBRARY positional argument. If neither –db or PHOTOS_LIBRARY provided, will attempt to find the library to use in the following order: 1. last opened library, 2. system library, 3. ~/Pictures/Photos Library.photoslibrary

--json

Print output in JSON format.

Arguments

PHOTOS_LIBRARY

Optional argument(s)

query

Query the Photos database using 1 or more search options; if more than one option is provided, they are treated as “AND” (e.g. search for photos matching all options).

osxphotos query [OPTIONS] [PHOTOS_LIBRARY]...

Options

--db <Photos database path>

Specify Photos database path. Path to Photos library/database can be specified using either –db or directly as PHOTOS_LIBRARY positional argument. If neither –db or PHOTOS_LIBRARY provided, will attempt to find the library to use in the following order: 1. last opened library, 2. system library, 3. ~/Pictures/Photos Library.photoslibrary

--json

Print output in JSON format.

--keyword <KEYWORD>

Search for photos with keyword KEYWORD. If more than one keyword, treated as “OR”, e.g. find photos matching any keyword

--person <PERSON>

Search for photos with person PERSON. If more than one person, treated as “OR”, e.g. find photos matching any person

--album <ALBUM>

Search for photos in album ALBUM. If more than one album, treated as “OR”, e.g. find photos matching any album

--folder <FOLDER>

Search for photos in an album in folder FOLDER. If more than one folder, treated as “OR”, e.g. find photos in any FOLDER. Only searches top level folders (e.g. does not look at subfolders)

--name <FILENAME>

Search for photos with filename matching FILENAME. If more than one –name options is specified, they are treated as “OR”, e.g. find photos matching any FILENAME.

--uuid <UUID>

Search for photos with UUID(s).

--uuid-from-file <FILE>

Search for photos with UUID(s) loaded from FILE. Format is a single UUID per line. Lines preceded with # are ignored.

--title <TITLE>

Search for TITLE in title of photo.

--no-title

Search for photos with no title.

--description <DESC>

Search for DESC in description of photo.

--no-description

Search for photos with no description.

--place <PLACE>

Search for PLACE in photo’s reverse geolocation info

--no-place

Search for photos with no associated place name info (no reverse geolocation info)

--label <LABEL>

Search for photos with image classification label LABEL (Photos 5 only). If more than one label, treated as “OR”, e.g. find photos matching any label

--uti <UTI>

Search for photos whose uniform type identifier (UTI) matches UTI

-i, --ignore-case

Case insensitive search for title, description, place, keyword, person, or album.

--edited

Search for photos that have been edited.

--external-edit

Search for photos edited in external editor.

--favorite

Search for photos marked favorite.

--not-favorite

Search for photos not marked favorite.

--hidden

Search for photos marked hidden.

--not-hidden

Search for photos not marked hidden.

--shared

Search for photos in shared iCloud album (Photos 5 only).

--not-shared

Search for photos not in shared iCloud album (Photos 5 only).

--burst

Search for photos that were taken in a burst.

--not-burst

Search for photos that are not part of a burst.

--live

Search for Apple live photos

--not-live

Search for photos that are not Apple live photos.

--portrait

Search for Apple portrait mode photos.

--not-portrait

Search for photos that are not Apple portrait mode photos.

--screenshot

Search for screenshot photos.

--not-screenshot

Search for photos that are not screenshot photos.

--slow-mo

Search for slow motion videos.

--not-slow-mo

Search for photos that are not slow motion videos.

--time-lapse

Search for time lapse videos.

--not-time-lapse

Search for photos that are not time lapse videos.

--hdr

Search for high dynamic range (HDR) photos.

--not-hdr

Search for photos that are not HDR photos.

--selfie

Search for selfies (photos taken with front-facing cameras).

--not-selfie

Search for photos that are not selfies.

--panorama

Search for panorama photos.

--not-panorama

Search for photos that are not panoramas.

--has-raw

Search for photos with both a jpeg and raw version

--only-movies

Search only for movies (default searches both images and movies).

--only-photos

Search only for photos/images (default searches both images and movies).

--from-date <from_date>

Search by item start date, e.g. 2000-01-12T12:00:00, 2001-01-12T12:00:00-07:00, or 2000-12-31 (ISO 8601 with/without timezone).

--to-date <to_date>

Search by item end date, e.g. 2000-01-12T12:00:00, 2001-01-12T12:00:00-07:00, or 2000-12-31 (ISO 8601 with/without timezone).

--from-time <from_time>

Search by item start time of day, e.g. 12:00, or 12:00:00.

--to-time <to_time>

Search by item end time of day, e.g. 12:00 or 12:00:00.

--has-comment

Search for photos that have comments.

--no-comment

Search for photos with no comments.

--has-likes

Search for photos that have likes.

--no-likes

Search for photos with no likes.

--is-reference

Search for photos that were imported as referenced files (not copied into Photos library).

--in-album

Search for photos that are in one or more albums.

--not-in-album

Search for photos that are not in any albums.

--min-size <SIZE>

Search for photos with size >= SIZE bytes. The size evaluated is the photo’s original size (when imported to Photos). Size may be specified as integer bytes or using SI or NIST units. For example, the following are all valid and equivalent sizes: ‘1048576’ ‘1.048576MB’, ‘1 MiB’.

--max-size <SIZE>

Search for photos with size <= SIZE bytes. The size evaluated is the photo’s original size (when imported to Photos). Size may be specified as integer bytes or using SI or NIST units. For example, the following are all valid and equivalent sizes: ‘1048576’ ‘1.048576MB’, ‘1 MiB’.

--regex <REGEX TEMPLATE>

Search for photos where TEMPLATE matches regular expression REGEX. For example, to find photos in an album that begins with ‘Beach’: ‘–regex “^Beach” “{album}”’. You may specify more than one regular expression match by repeating ‘–regex’ with different arguments.

--query-eval <CRITERIA>

Evaluate CRITERIA to filter photos. CRITERIA will be evaluated in context of the following python list comprehension: photos = [photo for photo in photos if CRITERIA] where photo represents a PhotoInfo object. For example: –query-eval photo.favorite returns all photos that have been favorited and is equivalent to –favorite. You may specify more than one CRITERIA by using –query-eval multiple times. CRITERIA must be a valid python expression. See https://rhettbull.github.io/osxphotos/ for additional documentation on the PhotoInfo class.

--deleted

Include photos from the ‘Recently Deleted’ folder.

--deleted-only

Include only photos from the ‘Recently Deleted’ folder.

--missing

Search for photos missing from disk.

--not-missing

Search for photos present on disk (e.g. not missing).

--cloudasset

Search for photos that are part of an iCloud library

--not-cloudasset

Search for photos that are not part of an iCloud library

--incloud

Search for photos that are in iCloud (have been synched)

--not-incloud

Search for photos that are not in iCloud (have not been synched)

Arguments

PHOTOS_LIBRARY

Optional argument(s)