Skip to main content

Rename Files With Date

Project description

Rename Files With Date

背景

文件的排序方式 通常只有【创建时间、修改时间、标题】,但问题是:

  • 照片的标题通常是无效的(固定前缀+编号,甚至是无意义字符串)
  • 时间也是不准的(创建时间、修改时间 其实与照片的拍摄时间 是不一致的),

所以就需要基于现有排序方式 修改相关信息,以便能够已正确的排序显示

因此,我就写了这个工具:读取文件的创建时间(照片则是拍摄时间),将其重命名,以便【在以标题排序显示时 是符合预期的】

为了避免命名重复,所以命名规则为「年月日时分秒+3位随机数,共15位数字」,示例如下:

202204062217.699.png
201601011713.247.JPG
201602251612.551.JPG
201712311343.878.JPG
202204041615.719.HEIC
202204041615.813.HEIC
202204041710.478.HEIC
202204041710.595.JPG
202204041710.749.HEIC
202204041710.750.HEIC

安装

可通过如下命令 快速安装:

$ pip install amk.rename_files_with_date

使用

查看说明

$ rfwd -h
usage: rfwd [-h] [-d] [-v] [-l] path

Rename Photos With Date

positional arguments:
  path           待重命名的「文件/目录」的路径

optional arguments:
  -h, --help     show this help message and exit
  -d, --debug    启用调试模式
  -v, --verbose  显示详细日志
  -l, --list     仅列表显示可能的处理,但不执行具体操作,以便检查

查看将要执行的操作

$ rfwd ./photos -l

或是指定 -v 以查看很多信息:

$ rfwd ./photos -lv

执行重命名

# 可追加 -v、-d 以启用详情、调试模式,以查看更多信息
$ rfwd ./photos

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

amk.rfwd-1.0.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

amk.rfwd-1.0.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file amk.rfwd-1.0.0.tar.gz.

File metadata

  • Download URL: amk.rfwd-1.0.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.3

File hashes

Hashes for amk.rfwd-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b4bad50e4cf3f70201098aad8212a6e90e5cfbd15f4f72e7043646a70fe04652
MD5 6195b05786e3930114222dcc56fb6d81
BLAKE2b-256 9272751f1794f8189e1759bd343dbb38fa6ea1bf3ce808a7317df864df2ecc1e

See more details on using hashes here.

File details

Details for the file amk.rfwd-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: amk.rfwd-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.3

File hashes

Hashes for amk.rfwd-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23a2789c81e91b25351a77b6aae137b07b2a9e82d61b46006060e3a4b7ec94c5
MD5 87b6a1ae9d8807b39afec527cb84b49e
BLAKE2b-256 5ca5eb6ac2fca5f813392926984c9fd5e0a2a1066606b37caf43e58d20f4e5a5

See more details on using hashes here.

Supported by

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