Skip to main content

minifind

minifind is os.walk wrapper with predicates

Install

pip install minifind

Use

from minifind import find, size_kb

Find have two modes of operation:

  1. trigger callback on each matched file / directory
def callback(name, path):
    print(path)

find("path/to/dir").for_each(callback)
  1. collect matched items
paths = find("path/to/dir").collect()

Examples

Find source files of size 5kb+:

def not_moc(name, path):
    return not name.startswith('moc_')

paths = find("D:\\dev").ext(".cpp", ".h").filter(not_moc).size(size_kb(5)).collect()

Find git dirs, but dont go deeper that two directories in:

paths = find("D:\\dev").maxdepth(2).name('.git').collect()

Predicates and modifiers

.files() - match files

.dirs() - match dirs

.ext(*patterns) - match file extensions

.name(*patterns) - match name patterns

.size(low, high) - match file size

.mtime(low, high) - match modification time

.filter(predicate) - match with your predicate

.maxdepth(n) - don't go deeper than n levels in.

.first(n) - stop after n matched files

See also

https://github.com/mugiseyebrows/pyfindlib

Metadata

Release files for minifind 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minifind 0.0.3
File Size Uploaded Provenance
minifind-0.0.3.tar.gz 3.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 7.8 kB

Release files / minifind-0.0.3.tar.gz

Download URL minifind-0.0.3.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
de20a9b19ce011a9754bca771ce08ac066b38e511cdad2fd7e178e7a2fa5ad93
BLAKE2b-256 checksum
How to use checksums
2a716488c8ae09e087889973cf0b067a00a2ede13725e82da0777dd4caa57b8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / minifind-0.0.3-py3-none-any.whl

Download URL minifind-0.0.3-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20d2e971b5f4e0effea15d62091d81ce32edda4ecd9ede0b7af8b4b0289c4a32
BLAKE2b-256 checksum
How to use checksums
e688a119e09ed7ec68767b1d5e869de02378f3235419a232d7f3ba0018d9371f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for minifind 0.0.3

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.

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