A utility for copying files based on pattern matching
Project description
Filesmith
A command-line utility for copying files based on pattern matching, with support for filtering by modification time.
Overview
Filesmith is a Python utility that helps you copy files from one directory to another based on regular expression patterns. It's particularly useful for selective file copying, backup operations, and automated file management tasks.
Installation
You can install filesmith using pip:
pip install filesmith
Usage
filesmith <origin> <destination> <pattern> [options]
Arguments
origin: The source directory.destination: The destination directory.pattern: The regex pattern to match filenames against.
Options
--newermt <file_or_isodate>: Only copy files newer than a reference file's modification time or a given ISO date/datetime.-n,--dry-run: Show which files would be copied without actually copying them.-q,--quiet: Suppress output for successfully copied files.
Examples
-
Copy all .txt files from
sourcetodest:filesmith /path/to/source /path/to/dest ".*\.txt$"
-
Perform a dry run to see which .jpg files would be copied:
filesmith /path/to/source /path/to/dest ".*\.jpg$" --dry-run
-
Copy .log files newer than a specific date:
filesmith /path/to/logs /path/to/backup ".*\.log$" --newermt 2023-10-27T10:00:00
-
Copy .py files that are newer than
main.py:filesmith /path/to/src /path/to/old_src ".*\.py$" --newermt /path/to/src/main.py
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file filesmith-0.1.0.tar.gz.
File metadata
- Download URL: filesmith-0.1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ae542fd40be6c57e16b3ff39bef16bdd2f30c517c9826a64be3538d75ab4288
|
|
| MD5 |
1de75e983ef2441b784c6b90a54e54e3
|
|
| BLAKE2b-256 |
4426ebc353023fac5d5b11d6b41890281e572a20f128408c1a57861ea7d40f9e
|
File details
Details for the file filesmith-0.1.0-py3-none-any.whl.
File metadata
- Download URL: filesmith-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72657027f45c7be5a89a02105947fb8de559bd4bb86921555c1c107d00983dfd
|
|
| MD5 |
5c8782ab659deb0b931f0d0f88567626
|
|
| BLAKE2b-256 |
372d4a88c4ad48ebd579ef9c4ffeabceb19fab2c91939c9107b9ca48821658bb
|