Multithread geotagging of photos using EXIF and GPX data
Project description
geotag
基于 exiftool 和 GPX 文件的批量图片地理标记 CLI 工具。
特性
- 支持多线程批量处理图片
- 支持灵活的日期表达式过滤(如
date > 20250101 and date < 20260101) - 支持 dry-run 预览
- 自动分发任务到多线程
安装
- 安装 Python 3.12+
- 安装 exiftool(需加入系统 PATH)
- 安装本工具:
pip install .
或直接通过 PyPI(发布后):
pip install geotag
使用 pipx 安装
推荐使用 pipx 进行全局隔离安装:
pipx install geotag
安装后可直接在命令行使用 geotag 命令。
用法
geotag <图片目录> <gpx文件1> [gpx文件2 ...] <日期表达式> [--threads N] [--dry-run]
示例
geotag ./photos track1.gpx "date > 20250101"
geotag ./photos track1.gpx track2.gpx "date > 20250101 and date < 20260101" --threads 8
<图片目录>:待处理图片的文件夹<gpx文件>:一个或多个 GPX 轨迹文件<日期表达式>:如date > 20250101或date > 20250101 and date < 20260101--threads:线程数(可选,默认自动)--dry-run:仅显示将要执行的命令,不实际修改文件
日期表达式语法
- 支持
date >,<,=,>=,<=,!=等比较 - 支持
and,or逻辑组合,支持括号 - 日期格式支持:
YYYYMMDD(如 20250101)YYYY-MM-DD、YYYY/MM/DD- ISO 8601(如 2025-05-25T10:00:00+08:00)
- Unix 时间戳(秒)
依赖
- Python 3.12+
- exiftool
发布到 PyPI
- 安装构建工具:
pip install build twine
- 构建包:
python -m build
- 上传:
twine upload dist/*
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
geotag-0.1.1.tar.gz
(14.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
geotag-0.1.1-py3-none-any.whl
(13.1 kB
view details)
File details
Details for the file geotag-0.1.1.tar.gz.
File metadata
- Download URL: geotag-0.1.1.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e4c032634d4290f77e61f2c31f92844d760dec91b0038c931227a3c83dc2653
|
|
| MD5 |
10ddc0ba08ef3198051b6ea8c46557d5
|
|
| BLAKE2b-256 |
d45cd3c4e1167974223b60b6223a1e2ad4c0bc590a022839f99ca92674e4931e
|
File details
Details for the file geotag-0.1.1-py3-none-any.whl.
File metadata
- Download URL: geotag-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1d828f02298bc883376b6bbbe9e4eaeb999f32df957d04cfdace125888a1fd7
|
|
| MD5 |
5e3f8c32e97d22fdfd68a41b429bd056
|
|
| BLAKE2b-256 |
54a033acd12a91dbb3597845d57b0f3e7fec9938dd8b5a842ad9b5492430bee8
|