batchlink


Namebatchlink JSON
Version 1.1.0 PyPI version JSON
download
home_pageNone
SummaryBatch link files without modifying original files.
upload_time2024-11-20 10:06:37
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT
keywords batch-link batch-rename auto-rename
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # batchlink

[![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet)](https://pdm-project.org)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/pylint-dev/pylint)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Flake8: checked](https://img.shields.io/badge/flake8-checked-blueviolet)](https://flake8.pycqa.org)

[![Packaging status](https://repology.org/badge/vertical-allrepos/python:batchlink.svg)](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'
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "batchlink",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "batch-link, batch-rename, auto-rename",
    "author": null,
    "author_email": "Jax Young <jaxvanyang@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/f6/79/76005e1f32f8fbc0cb9d38f012ebb5e9f7b16d6466b9ac35973ecc19d0b5/batchlink-1.1.0.tar.gz",
    "platform": null,
    "description": "# batchlink\n\n[![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet)](https://pdm-project.org)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/pylint-dev/pylint)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Flake8: checked](https://img.shields.io/badge/flake8-checked-blueviolet)](https://flake8.pycqa.org)\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/python:batchlink.svg)](https://repology.org/project/python:batchlink/versions)\n\nBatch link files without modifying original files.\n\n## Why\n\nTo 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)\nIf you are serving BT files on a media server like [Jellyfin](https://jellyfin.org), you\nmay want this.\n\n## Features\n\n- A CLI to easily batch link, rename, copy files.\n- An extensible library.\n\n## Installation\n\nBesides package managers, you can also use self-contained executables for Linux, macOS\nand Windows from [Releases](https://github.com/jaxvanyang/batchlink/releases).\n\n## Examples\n\nCreate example files:\n\n```bash\nmkdir -p a b && touch a/0.log a/1.log a/1.txt a/2.txt\n```\n\nCreate hard links in `b/` pointing to all files in `a/` with original file names:\n\n> [!NOTE]\n> It's recommended to add option `--dry-run` to see what will happen at first.\n\n```console\n$ batchlink -S a -d b '*' '{path}'\nCreate hard link b/0.log to a/0.log\nCreate hard link b/1.log to a/1.log\nCreate hard link b/1.txt to a/1.txt\nCreate hard link b/2.txt to a/2.txt\n```\n\nOnly create links for log files:\n\n```console\n$ batchlink -S a -d b '*.log' '{path}'\nCreate hard link b/0.log to a/0.log\nCreate hard link b/1.log to a/1.log\n```\n\nAnd rename to one-based numbering file names:\n\n```console\n$ batchlink -S a -d b '*.log' '{num}.log'\nCreate hard link b/1.log to a/0.log\nCreate hard link b/2.log to a/1.log\n```\n\nFormat replacement values:\n\n```console\n$ batchlink -S a -d b '*.log' '{num:02}.log'\nCreate hard link b/01.log to a/0.log\nCreate hard link b/02.log to a/1.log\n```\n\nAbsolute symbolic link, relative symbolic link, rename, copy:\n\n```bash\nbatchlink -s -S a -d b '*.log' '{num:02}.log'\nbatchlink -sR -S a -d b '*.log' '{num:02}.log'\nbatchlink -r -S a -d b '*.log' '{num:02}.log'\nbatchlink -c -S a -d b '*.log' '{num:02}.log'\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Batch link files without modifying original files.",
    "version": "1.1.0",
    "project_urls": {
        "Issues": "https://github.com/jaxvanyang/batchlink/issues",
        "Repository": "https://github.com/jaxvanyang/batchlink.git",
        "Source": "https://github.com/jaxvanyang/batchlink"
    },
    "split_keywords": [
        "batch-link",
        " batch-rename",
        " auto-rename"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "09d47c5acd297d33196b16e3d59c2351d09686926f27a316eec87ba877677303",
                "md5": "206380f624cd0b77fdc20c51d7a44d26",
                "sha256": "972e56e510371cf6a69d6d68511615d4faad7cbe3778eb6800926c888e71c8dc"
            },
            "downloads": -1,
            "filename": "batchlink-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "206380f624cd0b77fdc20c51d7a44d26",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 7678,
            "upload_time": "2024-11-20T10:06:35",
            "upload_time_iso_8601": "2024-11-20T10:06:35.881543Z",
            "url": "https://files.pythonhosted.org/packages/09/d4/7c5acd297d33196b16e3d59c2351d09686926f27a316eec87ba877677303/batchlink-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f67976005e1f32f8fbc0cb9d38f012ebb5e9f7b16d6466b9ac35973ecc19d0b5",
                "md5": "52568278978b78813e9e6990e8d72cd1",
                "sha256": "3df7396e5b4c095cdba8d06dcfd91c4de405f6139b5063e7ab87f8942c2fe8e5"
            },
            "downloads": -1,
            "filename": "batchlink-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "52568278978b78813e9e6990e8d72cd1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 6595,
            "upload_time": "2024-11-20T10:06:37",
            "upload_time_iso_8601": "2024-11-20T10:06:37.315063Z",
            "url": "https://files.pythonhosted.org/packages/f6/79/76005e1f32f8fbc0cb9d38f012ebb5e9f7b16d6466b9ac35973ecc19d0b5/batchlink-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-20 10:06:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jaxvanyang",
    "github_project": "batchlink",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "batchlink"
}
        
Elapsed time: 2.08511s