Metadata-Version: 2.4
Name: vgrep
Version: 0.1.4
Summary: Vector-based grep tool
License-Expression: GPL-3.0-only
Requires-Python: >=3.8
Description-Content-Type: text/plain
License-File: LICENSE
Requires-Dist: chromadb
Requires-Dist: jinja2
Requires-Dist: langchain-core
Requires-Dist: langchain-text-splitters
Requires-Dist: pydantic
Requires-Dist: pathspec
Dynamic: license-file

#+title: Vector-Grep
Sync your DB to a vector DB and perform queries.

* Installation
Install the published package with [[https://pip.pypa.io/en/stable/][pip]]:
#+begin_src shell
pip install vgrep
#+end_src

To build and install locally:
#+begin_src shell
python -m build
pip install dist/vgrep-*.whl
#+end_src

* Publishing
Releases are published to [[https://pypi.org/][PyPI]] automatically via GitHub Actions when a
GitHub release is created. Configure the repository with a
``PYPI_API_TOKEN`` secret and the workflow will build and upload the
distribution for you.

* Usage
** Command line
Sync the database with tracked folders or search for text:
#+begin_src shell
vgrep /path/to/dir --sync --match '*.org'
vgrep /path/to/dir --query "search text" --match "*.org"
#+end_src

** Library
Interact with the index programmatically using the ``Manager``:
#+begin_src python
from pathlib import Path
from vgrep.manager import Manager

mgr = Manager(Path("/my/notes"), file_match=lambda p: p.suffix == ".org")
mgr.sync()
results = mgr.query("needle")
#+end_src

* Development
Install the dependencies

#+begin_src shell
pip install -r requirements.txt
#+end_src

Run the tests with:

#+begin_src shell
pytest
#+end_src

Install the package in editable mode so Emacs/Elpy can discover the modules:

#+begin_src shell
pip install -e .
#+end_src

