Skip to main content

batchlink

pdm-managed Imports: isort Code style: black linting: pylint Ruff Flake8: checked

Packaging status

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? If you are serving BT files on a media server like Jellyfin, 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.

Examples

Create example files:

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:

$ 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:

$ 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:

$ 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:

$ 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:

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'

Metadata

Release files for batchlink 1.1.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 batchlink 1.1.0
File Size Uploaded
batchlink-1.1.0.tar.gz 6.6 kB Details

Built distribution (wheel)

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

Total release size: 14.3 kB

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.1.0

2 release files

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