Skip to main content

filtertree

Apply a filter to the directory tree.

Install

filtertree can be installed with pip:

$ pip install filtertree

Usage

filtertree module provides a function filtertree.

from filtertree import filtertree

filtertree(func, src_dir_path, dest_dir_path, overwrite=overwrite)

Arguments are:

  • func is a filter function that takes 2 arguments, source and destination file paths.
  • src_dir_path is a base directory path for source.
  • dest_dir_path is a base directory path for destination.
  • overwrite is a flag to overwrite destination files.

filtertree function applies func to each file under src_dir_path directory tree and the same location under dest_dir_path.

If overwrite is True, overwrite the destination files, Or not. Default to False.

CLI tool filtre

filtre applies command to src_dir directory tree as follows:

$ filtre src_dir dest_dir cp

Or you can give one-line-script with -c option.

$ filtre -c "cp $1 $2" src_dir dest_dir

$1 and $2 in one-lien-script are replaced by src and dest file paths.

If -o / --overwite option is passed, overwrite the destination files. Otherwise, skip.

License

MIT license.

Metadata

Release files for filtertree 0.2.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 filtertree 0.2.0
File Size Uploaded Provenance
filtertree-0.2.0.tar.gz 2.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 6.4 kB

Release files / filtertree-0.2.0.tar.gz

Download URL filtertree-0.2.0.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6124604ff58b8de036092d698a3767e513971743dc37dbda3c69547a589d7caf
BLAKE2b-256 checksum
How to use checksums
27933ef9d0f122917dc64d8c681c363de94aee1f87870a768b6a0e9a9845a4cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.8 Linux/6.8.0-51-generic

Release files / filtertree-0.2.0-py3-none-any.whl

Download URL filtertree-0.2.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6ae0e144335265b84d2283d4cd040dff5374ab34be5723eee66e826a6f511bc
BLAKE2b-256 checksum
How to use checksums
46dcaeab17669dde19da98cbb9e08c3187b73ee26b381fce682638d0081f7ec5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.8 Linux/6.8.0-51-generic

Security for filtertree 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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