d5f207424b
e2e Tests / e2e (macos-latest) (push) Waiting to run
Nix CI / check (push) Waiting to run
Python CI / Python bindings (macos-latest) (push) Waiting to run
e2e Tests / e2e (windows-latest) (push) Waiting to run
Python CI / Python bindings (windows-latest) (push) Waiting to run
Build & Publish / Build Neovim aarch64-apple-darwin (push) Waiting to run
Build & Publish / Build Neovim aarch64-pc-windows-msvc (push) Waiting to run
Build & Publish / Build Neovim x86_64-apple-darwin (push) Waiting to run
Build & Publish / Build Neovim x86_64-pc-windows-msvc (push) Waiting to run
Build & Publish / Build C FFI aarch64-apple-darwin (push) Waiting to run
Build & Publish / Build C FFI aarch64-pc-windows-msvc (push) Waiting to run
Build & Publish / Build C FFI x86_64-apple-darwin (push) Waiting to run
Build & Publish / Build C FFI x86_64-pc-windows-msvc (push) Waiting to run
Build & Publish / Build MCP aarch64-apple-darwin (push) Waiting to run
Build & Publish / Build MCP aarch64-pc-windows-msvc (push) Waiting to run
Build & Publish / Build MCP x86_64-apple-darwin (push) Waiting to run
Build & Publish / Build MCP x86_64-pc-windows-msvc (push) Waiting to run
Build & Publish / Build Python wheels aarch64 (macos-latest) (push) Waiting to run
Build & Publish / Build Python wheels x86_64 (macos-latest) (push) Waiting to run
Build & Publish / Build Python wheels x86_64 (windows-latest) (push) Waiting to run
Build & Publish / Release (push) Blocked by required conditions
Build & Publish / Publish Python wheels to PyPI (push) Blocked by required conditions
Build & Publish / Publish Rust crates (push) Blocked by required conditions
Build & Publish / Publish npm packages (push) Blocked by required conditions
Rust CI / Fuzz Tests (windows-latest) (push) Waiting to run
Rust CI / Test (macos-latest) (push) Waiting to run
Rust CI / Test (windows-latest) (push) Waiting to run
Rust CI / Fuzz Tests (macos-latest) (push) Waiting to run
Python CI / Python bindings (ubuntu-latest) (push) Failing after 0s
Build & Publish / Build Neovim aarch64-linux-android (push) Failing after 0s
Build & Publish / Build Neovim aarch64-unknown-linux-gnu (push) Failing after 0s
Build & Publish / Build MCP x86_64-unknown-linux-musl (push) Failing after 1s
Build & Publish / Build Python wheels aarch64 (ubuntu-latest) (push) Failing after 0s
Build & Publish / Build Python wheels x86_64 (ubuntu-latest) (push) Failing after 1s
Build & Publish / Build Python sdist (push) Failing after 1s
Rust CI / Fuzz Tests (ubuntu-latest) (push) Failing after 1s
Rust CI / Build i686-unknown-linux-gnu (push) Failing after 0s
Rust CI / cargo clippy (push) Failing after 1s
e2e Tests / e2e (ubuntu-latest) (push) Failing after 1s
Lua CI / luacheck lint (push) Failing after 1s
Build & Publish / Build Neovim aarch64-unknown-linux-musl (push) Failing after 1s
Build & Publish / Build Neovim x86_64-unknown-linux-gnu (push) Failing after 0s
Build & Publish / Build Neovim x86_64-unknown-linux-musl (push) Failing after 1s
Build & Publish / Build C FFI aarch64-linux-android (push) Failing after 0s
Build & Publish / Build C FFI aarch64-unknown-linux-gnu (push) Failing after 0s
Build & Publish / Build C FFI aarch64-unknown-linux-musl (push) Failing after 1s
Build & Publish / Build C FFI x86_64-unknown-linux-gnu (push) Failing after 0s
Build & Publish / Build C FFI x86_64-unknown-linux-musl (push) Failing after 1s
Build & Publish / Build MCP aarch64-unknown-linux-gnu (push) Failing after 1s
Build & Publish / Build MCP aarch64-unknown-linux-musl (push) Failing after 0s
Build & Publish / Build MCP x86_64-unknown-linux-gnu (push) Failing after 1s
Spelling / Spell Check with Typos (push) Failing after 0s
Rust CI / Test (ubuntu-latest) (push) Failing after 0s
Rust CI / cargo fmt (push) Failing after 0s
Stylua / Check lua files using Stylua (push) Failing after 1s
Lua CI / lua-language-server type check (push) Failing after 12m29s
e2e Tests / e2e (alpine-musl) (push) Successful in 57m31s
76 lines
1.7 KiB
Markdown
76 lines
1.7 KiB
Markdown
# fff-search
|
|
|
|
Python bindings for [FFF (Fast File Finder)](https://github.com/dmtrKovalenko/fff.nvim), built with [PyO3](https://pyo3.rs/) and [Maturin](https://www.maturin.rs/). Install with `pip install fff-search`; import as `fff`.
|
|
|
|
## Requirements
|
|
|
|
- Python >= 3.10
|
|
- Rust toolchain (to build the native extension)
|
|
- [uv](https://docs.astral.sh/uv/) (recommended)
|
|
|
|
## Development setup
|
|
|
|
```bash
|
|
cd packages/fff-python
|
|
uv sync --all-extras
|
|
uv run maturin develop --release
|
|
```
|
|
|
|
## Running tests
|
|
|
|
```bash
|
|
cd packages/fff-python
|
|
uv run pytest -v
|
|
```
|
|
|
|
## Standalone example
|
|
|
|
```bash
|
|
cd packages/fff-python
|
|
uv run python examples/basic.py .
|
|
```
|
|
|
|
## Basic usage
|
|
|
|
```python
|
|
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.
|
|
|
|
```python
|
|
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())
|
|
```
|
|
|
|
## Building wheels
|
|
|
|
```bash
|
|
cd packages/fff-python
|
|
uv run maturin build --release
|
|
```
|
|
|
|
The produced wheel is `abi3` compatible with Python 3.10+.
|