Skip to main content

Multithread geotagging of photos using EXIF and GPX data

Project description

geotag

基于 exiftool 和 GPX 文件的批量图片地理标记 CLI 工具。

特性

  • 支持多线程批量处理图片
  • 支持灵活的日期表达式过滤(如 date > 20250101 and date < 20260101
  • 支持 dry-run 预览
  • 自动分发任务到多线程

安装

  1. 安装 Python 3.12+
  2. 安装 exiftool(需加入系统 PATH)
  3. 安装本工具:
pip install .

或直接通过 PyPI(发布后):

pip install 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 > 20250101date > 20250101 and date < 20260101
  • --threads:线程数(可选,默认自动)
  • --dry-run:仅显示将要执行的命令,不实际修改文件

日期表达式语法

  • 支持 date >, <, =, >=, <=, != 等比较
  • 支持 and, or 逻辑组合,支持括号
  • 日期格式支持:
    • YYYYMMDD(如 20250101)
    • YYYY-MM-DDYYYY/MM/DD
    • ISO 8601(如 2025-05-25T10:00:00+08:00)
    • Unix 时间戳(秒)

依赖

  • Python 3.12+
  • exiftool

发布到 PyPI

  1. 安装构建工具:
    pip install build twine
    
  2. 构建包:
    python -m build
    
  3. 上传:
    twine upload dist/*
    

License

MIT

Project details


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.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geotag-0.1.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file geotag-0.1.0.tar.gz.

File metadata

  • Download URL: geotag-0.1.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.17

File hashes

Hashes for geotag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 db74096a177325f7434833de7fddb81f336393fd5218b554e78c970b97fa609c
MD5 0db09e59458c8da5a9745505c0136977
BLAKE2b-256 52b5855f3a03689aa166d944885ed0b19cfe787c8e34119e5a1c5d014cf5cd40

See more details on using hashes here.

File details

Details for the file geotag-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: geotag-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.17

File hashes

Hashes for geotag-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c31a350e455f96b7fcbee8e1dad9df21a2a74116576308446e583a30f3bb171
MD5 9cc624ec1ce3af9433aa70807bfb0d0f
BLAKE2b-256 3a9635db8c2701886dd5fd2cb4bade4ed9f6928d2e42258fadecebb7effb048a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page