Skip to main content

Batch file rename tool

Project description

Barenames

Commandline tool for batch renaming files using regular expressions.

Usage

Usage: barenames [OPTIONS] PATTERN REPLACEMENT

  Batch file rename tool with regex substitution.

  Example:

      barenames "myfile-(\d+)" "yourfile-\g<1>"

Options:
  --dir PATH                Directory to perform actions in (default: current
                            working directory)
  --preview / --no-preview  Show preview of renames with confirmation prompt.
  -r, --recursive           Search files to rename recursively
  --help                    Show this message and exit

Barenames uses regex to change file names, which is very powerful tool. But power comes with responsibility, it is adviced to use --preview option to view what program is gonna do, before it does it, cause with regex you never truly know....

Change file extension:

This example changes extension of all .md files in current working directory to .rst

barenames --preview "(?P<filename>.+)\.md" "\g<filename>.rst"

If your files are not in current working directory just pass --dir option to override dir.

barenames --dir ~/my-notes/ --preview "(?P<filename>.+)\.md" "\g<filename>.rst"

If you wish to rename files in subdirectories too, use --recursive or -r for short.

barenames --recursive --preview "(?P<filename>.+)\.md" "\g<filename>.rst"

Use this option with caution though.

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

barenames-0.1.2.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

barenames-0.1.2-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file barenames-0.1.2.tar.gz.

File metadata

  • Download URL: barenames-0.1.2.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.2 Windows/10

File hashes

Hashes for barenames-0.1.2.tar.gz
Algorithm Hash digest
SHA256 334dd3e44fa6049c32208eaa20aaae362816ac6879c90926aae4070d79adc339
MD5 886e6ecd787113ac6d7a38276358cf56
BLAKE2b-256 cbdd81720710b00a78a0f1f17d062545ad56f901162fbc303f1f897c284f19e0

See more details on using hashes here.

File details

Details for the file barenames-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: barenames-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.2 Windows/10

File hashes

Hashes for barenames-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bf72a428b1f07fa6f7a7bb488aa84a05e24126ff6fca0db6b46209a0b9d50c7c
MD5 94eae3c8322205c65ad90d84829c6dd6
BLAKE2b-256 0499c3e2c0f6eaecd7a3cd07da36727181482d0217fbfad9d48f155beed28b58

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page