Command line tool to export photos from the macOS Photos library, organized by album and/or date.
MIT License
This program exports all images and videos from an Apple Photos Library to a local directory, making the files easily accessible without the need to use the native Photos app. It is intended for backup purposes and does not modify the library in any way.
[!IMPORTANT] The project works by reverse-engineering the Apple Photos Library database and file structure. Thus, it is not guaranteed to work with future versions of the Photos app or at all. Use it at your own risk and always keep a backup of your library.
[!NOTE] Currently, each version of this app only works with a sepcific combination of macOS and the Photos app. Backwards compatibility to older versions is planned for future releases.
The following versions of the app are compatible with the following macOS/PhotosLibrary version:
App version | macOS Name | macOS Version | Photos Version | Notes |
---|---|---|---|---|
0.4.0-SNAPSHOT |
Sequoia | 15.0 |
10.0 |
|
0.3.0 |
Sonoma | 14.6 |
9.0 |
The internal schema of the Photos app has changed, making this release incompatible with other Sonoma releases |
0.2.0 , 0.1.0 , 0.0.1
|
Sonoma |
14.0 - 14.5
|
9.0 |
For an overview of the changes made between each version, please have a look at the CHANGELOG.
$ cargo build --release
$ ./target/release/apple-photos-export --help
$ brew install haukesomm/repo/apple-photos-export
OR
$ brew tap haukesomm/repo
$ brew install apple-photos-export
$ apple-photos-export list-albums <LIBRARY_PATH>
$ apple-photos-export export [OPTIONS] <LIBRARY_PATH> <OUTPUT_DIR>
-a, --by-album Group assets by album
-m, --by-year-month Group assets by year/month
-M, --by-year-month-album Group assets by year/month/album
-i, --include-albums [<INCLUDE>...] Include assets in the albums matching the given ids
-x, --exclude-albums <EXCLUDE>... Exclude assets in the albums matching the given ids
-H, --include-hidden Include hidden assets
--must-be-hidden Assets must be hidden
-r, --restore-original-filenames Restore original filenames
-f, --flatten-albums Flatten album structure
-e, --include-edited Include edited versions of the assets if available
-E, --only-edited Always export the edited version of an asset if available
-d, --dry-run Dry run
-h, --help Print help
The following snippets show as an example how to export assets from a Photos Library and may be used as a starting point.
[!IMPORTANT] Remember to test the different configuration options using the
-d
flag (dry-run) before running any actual exports!
Year/Month/Album
structure$ apple-photos-export export <LIBRARY_PATH> <OUTPUT_DIR> -MHrfe
700
and 701
)
list-albums
command$ apple-photos-export export <LIBRARY_PATH> <OUTPUT_DIR> -i 700 701
700
and 701
)
list-albums
command$ apple-photos-export export <LIBRARY_PATH> <OUTPUT_DIR> -x 700 701
$ apple-photos-export export [library_path] [output_path] --must-be-hidden