Skip to main content

Tempren - template-based file renaming utility

run-tests codecov Maintainability PyPI version pre-commit.ci status

Get it from the Snap Store

tempren is a powerful file renaming utility that uses flexible template expressions to generate names for your files.
Tag templates can modify original filename, extract metadata from the files or anything in between.
A rich library of built-in tags helps with working with many common file types out-of-the-box.

Whether you need to organize your files, standardize naming conventions, or perform complex renaming tasks, tempren can help you get the job done efficiently.

Features

  • Template-based generation of file names, directory names or whole relative paths
  • Built-in tags for Audio/Video/Image metadata, GPS/GPX geolocation data, checksums and text manipulation
  • Ad-hoc tags to leverage external programs for metadata extraction
  • Tag aliases for reusing commonly used (sub)templates
  • Configurable, metadata-based file selection (filtering) and sorting

Installation

tempren is available as:

  • Snap (auto-updating): snap install tempren
  • AppImage (self-contained, no Python needed): download tempren-<version>-x86_64.AppImage from the latest release, then:
    chmod +x tempren-*-x86_64.AppImage
    sudo mv tempren-*-x86_64.AppImage /usr/local/bin/tempren
    
  • PyPI (requires Python 3.11+): pip install 'tempren[video]'

See the installation instructions for details, updating and optional dependencies.

Documentation

For comprehensive documentation of all features, advanced usage, and troubleshooting, please visit the Manual page. tempren also has extensive built-in documentation: use tempren --list-tags to see available tags and tempren --help <tag name> to read about a specific one.

Examples

Note: When experimenting on your own please use -dr/--dry-run flag!
tempren will not overwrite your files by default, but an invalid template can mangle their names.

Cleaning up names for sensitive (e.g. FAT32) filesystems
$ tempren --dry-run --recursive --name "%Strip(){%Base()|%Unidecode()|%Sanitize()|%Collapse()}%Ext()" ./Some\ OST/
Renamed: Disk 1/14 - 接近.flac
     to: Disk 1/14 - Jie Jin.flac
Renamed: Disk 1/02 - なつのあお.flac
     to: Disk 1/02 - natsunoao.flac
Renamed: Disk 1/11 - 灯火-re.flac
     to: Disk 1/11 - Deng Huo -re.flac
Renamed: Disk 1/05 - 記録.flac
     to: Disk 1/05 - Ji Lu.flac
Renamed: Disk 1/10 - むかしむかし、あるところに.flac
     to: Disk 1/10 - mukashimukashi, arutokoroni.flac
Renamed: Disk 1/09 - 阿良句のテーマ(ハイ).flac
     to: Disk 1/09 - A Liang Ju notema(hai).flac
...
Adding resolution to the image files
$ tempren --dry-run --name "%Base()_%Image.Width()x%Image.Height()%Ext()" ~/Pictures/Wallpapers
Renamed: 0sa5yfiskqr21.jpg
     to: 0sa5yfiskqr21_3728x4660.jpg
Renamed: rkgjq6883fp81.jpg
     to: rkgjq6883fp81_3024x4032.jpg
Renamed: lcrkvphf28911.jpg
     to: lcrkvphf28911_4016x4684.jpg
Renamed: y6nzcv55k3851.jpg
     to: y6nzcv55k3851_3784x5670.jpg
Renamed: 1211740803547.jpg
     to: 1211740803547_1200x1109.jpg
...
Sorting files into directories based on their MIME type
$ tempren --dry-run --path "%Capitalize(){%Mime(subtype)}/%Name()" ~/Downloads
Renamed: dotnet-install.sh
     to: X-shellscript/dotnet-install.sh
Renamed: openrgb_0.7_amd64_buster_6128731.deb
     to: Vnd.debian.binary-package/openrgb_0.7_amd64_buster_6128731.deb
Renamed: prometheus-2.26.0.linux-amd64.tar.gz
     to: Gzip/prometheus-2.26.0.linux-amd64.tar.gz
Renamed: nldb remote.zip
     to: Zip/nldb remote.zip
Renamed: artifacts.zip
     to: Zip/artifacts.zip
Renamed: 2021-06-11_12-09-34.webm
     to: X-matroska/2021-06-11_12-09-34.webm
Renamed: antlr-4.9.2-complete.jar
     to: Java-archive/antlr-4.9.2-complete.jar
...
Adding checksums to the names of the audio files
$ tempren --dry-run --filter-template "%IsMime('audio')" --name "%Base() [%Upper(){%Crc32()}]%Ext()" ./Roger\ Subirana\ Mata\ -\ Point\ of\ no\ return
Renamed: 10-169205-Roger Subirana Mata-Island of light.mp3
     to: 10-169205-Roger Subirana Mata-Island of light [08E46C33].mp3
Renamed: 12-169207-Roger Subirana Mata-Tales of trees.mp3
     to: 12-169207-Roger Subirana Mata-Tales of trees [33EFEC5E].mp3
Renamed: 11-169206-Roger Subirana Mata-Requiem.mp3
     to: 11-169206-Roger Subirana Mata-Requiem [5E48759B].mp3
Renamed: 05-168950-Roger Subirana Mata-The mask.mp3
     to: 05-168950-Roger Subirana Mata-The mask [045DBC19].mp3
Renamed: 03-168948-Roger Subirana Mata-Thryst.mp3
     to: 03-168948-Roger Subirana Mata-Thryst [5D23E43B].mp3
...

Contributing

If you noticed a bug or have an idea for a new tag please open an issue with appropriate (GitHub) tags. If you would like to contribute to the development you can visit contributing page designed specially for that.

Metadata

Release files for tempren 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tempren 1.5.0
File Size Uploaded Provenance Actions
tempren-1.5.0.tar.gz 61.5 kB Without provenance Details for tempren-1.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tempren 1.5.0
File Interpreter ABI Platform Actions
tempren-1.5.0-py3-none-any.whl Python 3 none any Details for tempren-1.5.0-py3-none-any.whl

Total release size: 136.8 kB

Release files / tempren-1.5.0.tar.gz

Download URL tempren-1.5.0.tar.gz
Size 61.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1b58c43bdf64906876bb4a4861204d06ff8dace7247b89df6767984a154023fd
BLAKE2b-256 checksum
How to use checksums
fc6206129448db7f117dbe08a01aa96f4ba573500e29eab8205567f430270f2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.11.0 Linux/7.0.0-1017-azure

Release files / tempren-1.5.0-py3-none-any.whl

Download URL tempren-1.5.0-py3-none-any.whl
Size 75.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6c298101ca17a7d62dbc84021cf5ade5576fa3c193b4cf9b3acf999571c57c8
BLAKE2b-256 checksum
How to use checksums
40ca5a29ddd6840d636dab0f03adcfc4f2d163a69375a2b8cdfd2880031a94d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.11.0 Linux/7.0.0-1017-azure

Security for tempren 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page