Osxphotos

Latest version: v0.69.2

Safety actively analyzes 693883 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 9

0.67.0

Several enhancements to `osxphotos import` that now allow it to be used to import a Google Takeout archive into Photos.app. Enhancements to `osxphotos export` to store the history of exported photos and videos in the export database and to allow checking and repairing the export database with `osxphotos exportdb`.

For example, to import a Google Takeout archive into Photos.app:

Download the Google Photos Takeout archive from Google and unzip it. This will create a folder with a name like `Takeout`. Inside this folder will be a folder named `Google Photos` which contains all the photos and videos. You can import the photos and videos into Photos.app using the following command (assuming you unzipped the Takeout file in your Downloads folder):

bash
osxphotos import ~/Downloads/Takeout/Google\ Photos --walk --album "{filepath.parent.name}" --skip-dups --dup-albums --sidecar --verbose --sidecar-ignore-date --keyword "{person}" --report takeout_import.csv


This will import all the photos and videos into Photos.app, creating albums with the same name as the folder they were in in the Takeout archive (which is how Google Takeout stores photos in albums). It will skip duplicates (Google Takeout exports duplicate copies of photos that are in more than one album) but add the duplicate photo that's already in the library to the albums it would have been added to if it were imported (`--skip-dups --dup-albums`). It will also import metadata from the sidecar files (Google Takeout exports metadata in JSON format) (`--sidecar`).

The `--sidecar-ignore-date` option is optional but prevents osxphotos from setting the photo's date from the sidecar metadata. This is helpful because Google Takeout does not preserve the timezone of the photo in the Takeout metadata but converts all times to UTC. This will be handled by osxphotos by converting to local timezone upon import. However, if the photo's already have correct time in the EXIF data, `--sidecar-ignore-date` will prevent osxphotos from setting the date from the sidecar metadata, allowing Photos to set the date from the image.

The `--keyword "{person}"` option will add any people in the photo to the photo's keywords. The `osxphotos import` command cannot set person info in Photos (this is a limitation of Photos) but Google will preserve the person names if you've used the face naming feature. You can optionally include `--keyword "{person}"` to add keywords for the persons found in each image.

The `--report takeout_import.csv` option will create a report of the import in CSV format.

Added

- Added `--sidecar` and `--sidecar-template` to `osxphotos import` to import metadata from sidecar files during import. Supported sidecar formats are XMP, osxphotos JSON, exiftool JSON, and Google Takeout JSON. `--sidecar` will automatically find the sidecar (even with Google Takeout's weird naming scheme) and `--sidecar-template` allows to specify the sidecar file name using a template.
- Added `--dup-albums` to `osxphotos import` to add photos to the appropriate albums even if photo is skipped due to `--skip-dups`. This will add the duplicate photo already in the library to the albums the photo would have been added to if it were imported.
- Added `--parse-folder-date` to `osxphotos import` to parse date from folder name just as `--parse-date` can parse date from the filename. `--parse-folder-date` and `--parse-date` can be used together if part of the date is in the filename and part in the folder name. For example `--parse-folder-date "%Y/%m/%d" --parse-date "%H%M%S"` would parse a date from a folder name like `2021/01/01` and time from filename like `IMG_1234_125600.jpg`.
- Added `--check`, `--repair` to `osxphotos exportdb` to check and repair database
- Added `--history` to `osxphotos exportdb` to show history of exported photos and videos

Removed

Changed

- Export database now stores history of exported photos and videos which can be used with `osxphotos exportdb --history` to see why a specific file or UUID was exported or skipped and the history of the file.
- The report format for `osxphotos import` has changed (added photo date to report), thus if you use `--report --append` you'll need to archive the existing reports and start fresh with this version.

Fixed

Contributors

- RhetTbull [RhetTbull](https://github.com/RhetTbull) for code
- finestream [finestream](https://github.com/finestream) for the idea to add `--sidecar` to `osxphotos import`
- mikekenyon99 [mikekenyon99](https://github.com/mikekenyon99) for the idea to add a repair option to `osxphotos exportdb`

[v0.66.0](https://github.com/RhetTbull/osxphotos/compare/v0.65.0...v0.66.0)

Bug Fixes

0.66.0

Added

Removed

Changed

- Templates which return lists of strings such as `{album}` now return results in sorted order 1317

Fixed

- Fixed install issues for Monterey, 1324

Contributors

- RhetTbull [RhetTbull](https://github.com/RhetTbull) for code

[v0.65.0](https://github.com/RhetTbull/osxphotos/compare/v0.64.3...v0.65.0)

Thanksgiving Release: A cornucopia of new features and bug fixes for the Thanksgiving holiday. Thanks to all the contributors who helped make this release possible. Please note there are some breaking changes in this release, see notes below. If you have scripts or workflows that use `osxphotos` CLI commands, you may need to update them to specify the library with `--library` or `--db` instead of as a positional argument.

0.65.0

Added

- `osxphotos batch-edit --album` to add photos to an album (1009)

This allows `batch-edit` to be used to sync albums between iCloud shared libraries (Photos does not sync albums between shared libraries). For example:

bash
osxphotos batch-edit --verbose --keyword "{album?album:{folder_album}}"


will write the album name in form `album:Folder/Album` to the keyword field. Then on the other user's machine:

bash
osxphotos batch-edit --verbose --album "{keyword|filter(startswith album:)|sslice(6:)}" --split-folder "/"


reads the album name from the keyword field and splits it into folder and album name and adds the photo to the album, creating album and folders as necessary.

Both commands can be run on each user's machine to sync albums between shared libraries. The commands can also be combined into a single command:

bash
osxphotos batch-edit --verbose --album "{keyword|filter(startswith album:)|sslice(6:)}" --split-folder "/" --keyword "{album?album:{folder_album}}"


- `osxphotos export --checkpoint` to auto-save the export database during export when using `--ramdb`. This prevents data loss if the export is interrupted or crashes. If using `--ramdb` and `--checkpoint` is not identified, export database will be auto-saved every 1000 photos (1051)
- `osxphotos push-exif --dry-run` to show what will be pushed without updating metadata (1259)
- `osxphotos export --ignore-exportdb` to ignore warnings about exporting into a folder with an existing export database without using `--update` (1285)
- `osxphotos export --no-exportdb` to export without creating an export database; use with caution as this is a "one time" export that will not work with `--update` in the future
- `osxphotos import --dry-run` to `osxphotos import` to show what would be imported without actually importing
- `osxphotos import --skip-dups` to skip importing photos that are already in the library (1262, 1264)

Removed

- Removed photos library argument from CLI commands which had previously been deprecated; library must now be specified with `--library` or `--db`

**WARNING**: This is a breaking change if you have scripts that use `osxphotos` CLI commands and specify the library as a positional argument. You must now specify the library with `--library` or `--db`. For example, if you have a script that looks like this:

bash
osxphotos export ~/Pictures/Photos\ Library.photoslibrary /path/to/export


you must now change it to:

bash

osxphotos export --library ~/Pictures/Photos\ Library.photoslibrary /path/to/export


Changed

- `osxphotos import` now prints a message if the photo is already in the library (1264)
- `osxphotos export` now checks if the destination is a Photos library and warns if it is (1268)
- `osxphotos export` now checks if the destination is a folder with an existing export database and warns if exporting without `--update` (1285)
- `export_cli()` can now be used to run the `osxphotos export` command as a stand-alone function in your own code (1253):

pycon
>>> from osxphotos.cli.export import export_cli
>>> export_cli(dest="/private/tmp", update=True)


- `--query-function` (`query`, `export`), `--post-function` (`export`), `--function` (`timewarp`), `osxphotos run`, and `{function}` template now all support providing a URL to a Python file containing the function (1224). This allows sharing of functions and makes it easier to give examples to new users. For example:
- `osxphotos run https://raw.githubusercontent.com/RhetTbull/osxphotos/main/examples/count_photos.py`
- `osxphotos query --quiet --print "{function:https://raw.githubusercontent.com/RhetTbull/osxphotos/main/examples/template_function.py::example}"`
- `osxphotos query --query-function https://raw.githubusercontent.com/RhetTbull/osxphotos/main/examples/find_unnamed_faces.py::unnamed_faces --count`

- CLI commands now show progress when loading the Photos library to stderr. This is useful when running commands against a large database on a slow disk

Fixed

- Allow `library` to be specified in config TOML file (1274)

Contributors

- Rhet Turnbull ([RhetTbull](https://github.com/RhetTbull)) for code, documentation, and testing
- Added nicad ([nicad](https://github.com/nicad)) as a contributor for bug, test, and documentation
- Added nkxco ([nkxco](https://github.com/nkxco)) as a contributor for ideas
- Added santiagoGPNC ([santiagoGPNC](https://github.com/santiagoGPNC)) as a contributor for ideas
- Added mikapietrus ([mikapietrus](https://github.com/mikapietrus)) as a contributor for ideas

[v0.64.3](https://github.com/RhetTbull/osxphotos/compare/v0.64.2...v0.64.3)

Adds `--alt-db` option to export. You probably (almost certainly) don't need this.

0.64.3

Added

- `--alt-db` option to export to specify a different database than the one in the Photos library. This is a niche option you likely don't need but enables certain use cases that previously weren't possible.

Removed

Changed

Fixed

Contributors

- RhetTbull [RhetTbull](https://github.com/RhetTbull) for code and testing

[v0.64.2](https://github.com/RhetTbull/osxphotos/compare/v0.64.0...v0.64.2)

Updated dependencies for Python 3.12

0.64.2

Added

Removed

Changed

Fixed

- Support for Python 3.12, 1254

Contributors

- RhetTbull [RhetTbull](https://github.com/RhetTbull) for code and testing

[v0.64.0](https://github.com/RhetTbull/osxphotos/compare/v0.63.5...v0.64.0)

Adds support for exporting and querying iPhoto databases. iPhoto support only works on Python >= 3.10.

0.64.0

Fixed

Added

- osxphotos export, query, dump, info, persons, keywords, and albums commands now work with iPhoto libraries.

Removed

Changed

Contributors

- Special thanks to jensb ([jensb](https://github.com/jensb)) who kindly allowed me to use code from his [iphoto2xmp](https://github.com/jensb/iphoto2xmp) as a starting point for the osxphotos iPhoto support and allowed me to relicense this code under MIT License to be compatible with osxphotos.
- RhetTbull ([RhetTbull]((https://github.com/RhetTbull)) for code and tests.

[v0.63.5](https://github.com/RhetTbull/osxphotos/compare/v0.63.4...v0.63.5)

Fixed `osxphotos keywords` to also show keywords with no associated photos.

Page 4 of 9

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.