Skip to main content

Recursively find and replace in file names and contents.

Project description

usage: pyreplace [-h] [-d DIRECTORY] [-r] [-v] [-g EXPRESSION]
[-f FIND REPLACE] [-fi] [-c FIND REPLACE] [-ci]

Recursively find and replace in file names and contents.

optional arguments:
-h, --help show this help message and exit
-d DIRECTORY, --directory DIRECTORY
Set starting directory.
-r, --dry-run Dont make any changes, just list what would happen.
-v, --verbose Display changes made.
-g EXPRESSION, --glob EXPRESSION
Find files with matching extension. Example: *.txt
-f FIND REPLACE, --filename FIND REPLACE
Search filename for FIND and replace with REPLACE.
-fi, --filename-insensitive
Ignore capital/lowercase when searching filename.
-c FIND REPLACE, --contents FIND REPLACE
Search contents for FIND and replace with REPLACE.
-ci, --contents-insensitive
Ignore capital/lowercase when searching contents.

Usage Examples:
Replace foo with bar in filenames matching *.txt:
pyreplace -g *.txt -f foo bar

Find and replace foo with bar in files matching *.txt (Contents):
pyreplace -g *.txt -c foo bar

As above with all files in current directory:
pyreplace -c foo bar

As above with all files in another directory:
pyreplace -d /home/foo -c foo bar

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyreplace-1.0-py3.2.egg (5.2 kB view details)

Uploaded Egg

File details

Details for the file pyreplace-1.0-py3.2.egg.

File metadata

  • Download URL: pyreplace-1.0-py3.2.egg
  • Upload date:
  • Size: 5.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyreplace-1.0-py3.2.egg
Algorithm Hash digest
SHA256 c7f8b6ccfb6071318ab373d399e47d18b2a5da7cd9132f5ba4ccbd0ccc390c02
MD5 96dd4737e729d53ff2e5a65276e147ce
BLAKE2b-256 ab040052a15c9a8aba3ab8ba830e7602d86cf3ae61b8099c960aa8ae0be7da88

See more details on using hashes here.

Supported by

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