https://github.com/jaxvanyang/batchlink
Batch link files without modifying original files
https://github.com/jaxvanyang/batchlink
auto-rename batch-link batch-rename python
Last synced: 28 days ago
JSON representation
Batch link files without modifying original files
- Host: GitHub
- URL: https://github.com/jaxvanyang/batchlink
- Owner: jaxvanyang
- License: mit
- Created: 2024-06-04T07:03:26.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-20T10:08:55.000Z (8 months ago)
- Last Synced: 2025-06-09T22:49:34.167Z (about 1 month ago)
- Topics: auto-rename, batch-link, batch-rename, python
- Language: Python
- Homepage: https://pypi.org/project/batchlink
- Size: 28.3 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# batchlink
[](https://pdm-project.org)
[](https://pycqa.github.io/isort)
[](https://github.com/psf/black)
[](https://github.com/pylint-dev/pylint)
[](https://github.com/astral-sh/ruff)
[](https://flake8.pycqa.org)[](https://repology.org/project/python:batchlink/versions)
Batch link files without modifying original files.
## Why
To solve the problem - [Is there a way to rename files from a torrent and still be able to seed?](https://www.reddit.com/r/qBittorrent/comments/ie3p10/is_there_a_way_to_rename_files_from_a_torrent_and)
If you are serving BT files on a media server like [Jellyfin](https://jellyfin.org), you
may want this.## Features
- A CLI to easily batch link, rename, copy files.
- An extensible library.## Installation
Besides package managers, you can also use self-contained executables for Linux, macOS
and Windows from [Releases](https://github.com/jaxvanyang/batchlink/releases).## Examples
Create example files:
```bash
mkdir -p a b && touch a/0.log a/1.log a/1.txt a/2.txt
```Create hard links in `b/` pointing to all files in `a/` with original file names:
> [!NOTE]
> It's recommended to add option `--dry-run` to see what will happen at first.```console
$ batchlink -S a -d b '*' '{path}'
Create hard link b/0.log to a/0.log
Create hard link b/1.log to a/1.log
Create hard link b/1.txt to a/1.txt
Create hard link b/2.txt to a/2.txt
```Only create links for log files:
```console
$ batchlink -S a -d b '*.log' '{path}'
Create hard link b/0.log to a/0.log
Create hard link b/1.log to a/1.log
```And rename to one-based numbering file names:
```console
$ batchlink -S a -d b '*.log' '{num}.log'
Create hard link b/1.log to a/0.log
Create hard link b/2.log to a/1.log
```Format replacement values:
```console
$ batchlink -S a -d b '*.log' '{num:02}.log'
Create hard link b/01.log to a/0.log
Create hard link b/02.log to a/1.log
```Absolute symbolic link, relative symbolic link, rename, copy:
```bash
batchlink -s -S a -d b '*.log' '{num:02}.log'
batchlink -sR -S a -d b '*.log' '{num:02}.log'
batchlink -r -S a -d b '*.log' '{num:02}.log'
batchlink -c -S a -d b '*.log' '{num:02}.log'
```