Skip to main content

Python bindings for FFF (Fast File Finder)

Project description

fff-search

Python bindings for FFF (Fast File Finder), built with PyO3 and Maturin. Install with pip install fff-search; import as fff.

Requirements

  • Python >= 3.10
  • Rust toolchain (to build the native extension)
  • uv (recommended)

Development setup

cd packages/fff-python
uv sync --all-extras
uv run maturin develop --release

Running tests

cd packages/fff-python
uv run pytest -v

Standalone example

cd packages/fff-python
uv run python examples/basic.py .

Basic usage

from fff import FileFinder

with FileFinder("/path/to/project", watch=False) as finder:
    finder.wait_for_scan_blocking(timeout_ms=5000)
    print(f"Indexed under {finder.base_path}")

    result = finder.search("main")
    if result:
        print(f"Showing {len(result)} of {result.total_matched} matches")
    for item, score in zip(result.items, result.scores):
        print(f"{item.relative_path}: {score.total}")

Async usage

wait_for_scan is a coroutine that polls the scan status and yields to the event loop, so it never blocks other tasks. Use wait_for_scan_blocking from synchronous code.

import asyncio
from fff import FileFinder

async def main():
    with FileFinder("/path/to/project", watch=False) as finder:
        await finder.wait_for_scan(timeout_ms=5000)
        result = finder.search("main")
        print(result)

asyncio.run(main())

Watching files

Subscribe to filesystem changes with a glob, an exact path, or a directory subtree (requires watch=True, the default). The callback receives normalized batches of up to 128 events on a dedicated callback thread. Each path appears at most once; avoid long-running work so later callbacks are not delayed.

from fff import FileFinder

with FileFinder("/path/to/project") as finder:
    finder.wait_for_scan_blocking(timeout_ms=5000)

    def on_change(events):
        for e in events:
            print(e.kind, e.path)  # created | modified | removed | rescan

    # Globs are relative to the project root; wildcard-free patterns resolve
    # inside the indexed tree — an existing directory watches its whole
    # subtree, anything else is an exact file path.
    sub = finder.watch("src/**/*.py", on_change)
    ...
    sub.unsubscribe()  # non-blocking; the callback never runs after this

    # No pattern (None) watches the entire indexed tree
    with finder.watch(None, on_change):
        ...

    # Directory subtree with per-subscription excludes (parcel-watcher style)
    with finder.watch("src", on_change, ignore=["*.log", "src/vendor"]):
        ...

A rescan event means individual changes were lost (index overflow or an ignore-file change) — re-check anything you care about.

Building wheels

cd packages/fff-python
uv run maturin build --release

The produced wheel is abi3 compatible with Python 3.10+.

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

fff_search-0.10.1.tar.gz (2.1 MB view details)

Uploaded Source

Built Distributions

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

fff_search-0.10.1-cp310-abi3-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.10+Windows x86-64

fff_search-0.10.1-cp310-abi3-manylinux_2_38_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.38+ x86-64

fff_search-0.10.1-cp310-abi3-manylinux_2_38_aarch64.whl (4.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.38+ ARM64

fff_search-0.10.1-cp310-abi3-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

fff_search-0.10.1-cp310-abi3-macosx_10_12_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file fff_search-0.10.1.tar.gz.

File metadata

  • Download URL: fff_search-0.10.1.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for fff_search-0.10.1.tar.gz
Algorithm Hash digest
SHA256 27151504876d5eae2db08b5c7eb80e3bcd461f57861a1e6b7f4acfd3a72fd891
MD5 d7cba1d30eebaa4544e95b5e408e47ce
BLAKE2b-256 c465ef410932b9d2d27d78f19db1493fa82761cfdcf73cc9c15498961903016f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fff_search-0.10.1.tar.gz:

Publisher: release.yaml on dmtrKovalenko/fff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fff_search-0.10.1-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: fff_search-0.10.1-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for fff_search-0.10.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c3f9b170363df73a70eda6ab9f55aa1a29771e9391d638574b99f80cb54fca73
MD5 87d824f0b9118139c4e127db87efdc26
BLAKE2b-256 9a76b767d9d3349a33f552218d013e4b1ba973f82fd534dbf6f486e49b461b85

See more details on using hashes here.

Provenance

The following attestation bundles were made for fff_search-0.10.1-cp310-abi3-win_amd64.whl:

Publisher: release.yaml on dmtrKovalenko/fff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fff_search-0.10.1-cp310-abi3-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for fff_search-0.10.1-cp310-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 9b73350ba8883746c1674defc89573358f20f6d537433f5ddb70afea4a882efb
MD5 17ba848a15238e69b9c641f32398105f
BLAKE2b-256 9e3bd3b9e526e92e1513943533d94471b40612839be6212ee499705e3a8dd1a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for fff_search-0.10.1-cp310-abi3-manylinux_2_38_x86_64.whl:

Publisher: release.yaml on dmtrKovalenko/fff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fff_search-0.10.1-cp310-abi3-manylinux_2_38_aarch64.whl.

File metadata

File hashes

Hashes for fff_search-0.10.1-cp310-abi3-manylinux_2_38_aarch64.whl
Algorithm Hash digest
SHA256 3bd840b54cd94ba75d244f266bce917f3588ca6d43bd020ae696863320defbbe
MD5 a87cc4eaead6531cd4ae4443a480c994
BLAKE2b-256 e18a6ffb5cdc31ea73b5a857139ab7a7e7de5bfbe414537b672fe227e4c02136

See more details on using hashes here.

Provenance

The following attestation bundles were made for fff_search-0.10.1-cp310-abi3-manylinux_2_38_aarch64.whl:

Publisher: release.yaml on dmtrKovalenko/fff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fff_search-0.10.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fff_search-0.10.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8393349478cbe296db0f2f4f3e6d521307827d05e6c1ffd6d449ee67df25decf
MD5 f45b1a6f6cd684a7378eee59fe1b3df8
BLAKE2b-256 47b972e6749281518610115e2e9eb8d51529178aebe3beb76dfa1e6ec3e6e3aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for fff_search-0.10.1-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yaml on dmtrKovalenko/fff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fff_search-0.10.1-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fff_search-0.10.1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ca5505d9baa8b96a637d83f10094935e8d337816592b571512cb039bc488776a
MD5 3a587152db0dad2b1b6e0a9b0cc95cc0
BLAKE2b-256 0491bb52a1d12b99576ca5491cdca13288a6aa83d45f22354181421dfe88e48a

See more details on using hashes here.

Provenance

The following attestation bundles were made for fff_search-0.10.1-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yaml on dmtrKovalenko/fff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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