Harmonize file and directory names for Linux and Windows.
Project description
Harmonize file and directory names for Linux and Windows.
Table of Contents
Introduction
CrossRename is a command-line tool designed to harmonize file and directory names across Linux and Windows systems. It ensures that your file names are compatible with both operating systems, eliminating naming conflicts when transferring files between different environments.
Features
Sanitizes file names to be Windows-compatible (and thus Linux-compatible)
NEW: Optionally renames directories to be cross-platform compatible
Handles both individual files and entire directories
Supports recursive renaming of files in subdirectories
Preserves file extensions, including compound extensions like .tar.gz
Provides informative logging
Provides a dry-run mode to preview renaming changes without executing them
Interactive safety warnings with option to skip for automation
Skips recursive symlinks to avoid infinite loops
Installation
From PyPI (Using PIP)
pip install CrossRename
Usage
usage: crossrename [-h] [-p PATH] [-v] [-u] [-r] [-d] [-D] [--force] [--credits]
CrossRename: Harmonize file and directory names for Linux and Windows.
options:
-h, --help show this help message and exit
-p, --path PATH The path to the file or directory to rename.
-v, --version Prints out the current version and quits.
-u, --update Check if a new version is available.
-r, --recursive Rename all files in the directory path given and its subdirectories. When used with -D, also renames subdirectories.
-d, --dry-run Perform a dry run, logging changes without renaming.
-D, --rename-directories Also rename directories to be cross-platform compatible. Use with caution!
--force Skip safety prompts (useful for automated scripts)
--credits Show credits and support information
Examples
Rename a single file:
crossrename -p /path/to/file.txt
Rename all files in a directory (and its subdirectories):
crossrename -p /path/to/directory -r
Rename all files AND directories recursively:
crossrename -p /path/to/directory -r -D
Rename a single directory:
crossrename -p /path/to/problematic_directory -D
Perform a dry run to preview renaming changes without executing them:
crossrename -p /path/to/directory -r -D -d
Skip safety prompts for automated scripts:
crossrename -p /path/to/directory -r -D --force
Check for an update:
crossrename -u
Show credits and project information:
crossrename --credits
Safety First
CrossRename will show interactive safety warnings before making any changes to help prevent accidental data loss. However, it’s strongly recommended to:
Run a dry run first to preview what will be changed:
crossrename -p /your/path -r -D -dBackup your data before running the tool on important files
Use --force flag for automation in CI/CD pipelines:
crossrename -p /build/output -r -D --force
Directory renaming is particularly powerful and potentially disruptive since it changes folder paths that other applications might reference.
Why did I build this?
So I was dual-booting Windows 10 and Lubuntu 22.04, and one day I’m trying to move some files between the two systems. Five files just wouldn’t copy over because of what I later found out were the differences in Windows and Linux’s file naming rules.
That got me thinking because I’d already built a Python package that had to deal with some file creation and renaming ( It’s called FicImage please check it out 🫶) before, so I had an idea or two about how to go about this.
Long story short, I got annoyed enough to build CrossRename. Now I don’t have to deal with file naming headaches when switching between systems.
Contributing
Contributions are welcome! If you’d like to improve CrossRename or add support for other operating systems (like macOS), please feel free to submit a pull request.
Wait a minute, who are you?
Hello there! I’m Emmanuel Jemeni, and while I primarily work as a Frontend Developer, Python holds a special place as my first programming language. You can find me on various platforms:
License
Changelog
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
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
File details
Details for the file crossrename-1.2.0.tar.gz.
File metadata
- Download URL: crossrename-1.2.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ffdb6ba4dd5179f099d14cebf663c0c150335aa5d7f77f869d0bf619265148a
|
|
| MD5 |
cbdfe62f1a98a21578b30934374807d9
|
|
| BLAKE2b-256 |
b2261b61a2653e9a7e2a4b246fcb6d3a9fa275ddbd8aeae13d5fb27f89de3842
|
File details
Details for the file crossrename-1.2.0-py3-none-any.whl.
File metadata
- Download URL: crossrename-1.2.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6840a891496513282c2c63ad2c66d58c322fe881ab763cc7f47db07f4b70b976
|
|
| MD5 |
db81bf782250a282e97c98e89a11a44d
|
|
| BLAKE2b-256 |
e579d388c29273530ee3ac23b023d9120934474fffaad0e6ac4681c68632e016
|