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.0.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.0-cp310-abi3-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.10+Windows x86-64

fff_search-0.10.0-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.0-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.0-cp310-abi3-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

fff_search-0.10.0-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.0.tar.gz.

File metadata

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

File hashes

Hashes for fff_search-0.10.0.tar.gz
Algorithm Hash digest
SHA256 0c0f9d57274b8b2a9504ee508313325a68f1e7ac169915a896f4d24030d85e55
MD5 35fade21c3d46e2db99084e53e4a06bf
BLAKE2b-256 797c20b23de8e8a816754cbc6573312c7da0b8ee9af502bd3ab2bb9d04276e3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for fff_search-0.10.0.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.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: fff_search-0.10.0-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.12

File hashes

Hashes for fff_search-0.10.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 892ba94611003c04dd22e84463ad88b0e7f2c50342dff98dc468a7b93c3ef248
MD5 55363944bad3e71eddea4db11e33f67a
BLAKE2b-256 f2e0f36052818e97562bcf4c4fa40178473b07c761f6e49dd22967f778177708

See more details on using hashes here.

Provenance

The following attestation bundles were made for fff_search-0.10.0-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.0-cp310-abi3-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for fff_search-0.10.0-cp310-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 9968b945851a94feb7082addb24910cf2c0ab0e0b04db0c6c1fc866dee70d4cb
MD5 7175ec11e9e65752310a4c17f3df7747
BLAKE2b-256 05b0258bff7a42e34ad7bde6fcdb604bca7427aace7edf9fe1f47e4895156898

See more details on using hashes here.

Provenance

The following attestation bundles were made for fff_search-0.10.0-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.0-cp310-abi3-manylinux_2_38_aarch64.whl.

File metadata

File hashes

Hashes for fff_search-0.10.0-cp310-abi3-manylinux_2_38_aarch64.whl
Algorithm Hash digest
SHA256 f0f70a1d97d7640a2b9099055edd07af936ed2d05f0d5e7af2e168e34e6bcc1c
MD5 ec24c39ae2a8998f5374128213c01b94
BLAKE2b-256 3d4510f56ed27f5fd2c1933163c5cf89acb13666f546f435c9b40aaaa1753a9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for fff_search-0.10.0-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.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fff_search-0.10.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 09ba8445caa96c2ab5db53a5b6abedaaa7b2dcc7dd967fdbd47797fd3de713aa
MD5 a2d8a4c667588c067d597ad5c5ba5b9a
BLAKE2b-256 06741899b744f64ad7a0cc5f045883594661df5b1955cdd1276842db1c3cc469

See more details on using hashes here.

Provenance

The following attestation bundles were made for fff_search-0.10.0-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.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fff_search-0.10.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b7ad61543e4ce23bd6ca848dc1334163ef35a50a795689770ceacc8c919374ab
MD5 8424523511c99ded2a8c39737f4e9705
BLAKE2b-256 cd93711945d0f1149d7b1c11b6d21c1bf3b17a226d6b9fd23fb66dc281570b37

See more details on using hashes here.

Provenance

The following attestation bundles were made for fff_search-0.10.0-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