Skip to main content

Indexed code search for Python - ripgrep-parity regex search over a persisted trigram index, with ranked definition-first results.

Project description

gist - indexed code search for Python

Exact regex search over a working tree, with ripgrep's semantics and a persisted trigram index underneath. Same ignore precedence, same match semantics; the index just proves most files cannot match before anything opens them, and every survivor is checked against current bytes.

pip install gist-search

The distribution is gist-search but the import stays gist. The plain gist name on PyPI belongs to an unrelated author, so installing under it would fetch a stranger's package; this is the same bs4 / PIL / cv2 split.

import gist

for m in gist.search(r"func\s+\w+\(", paths=["src/server/api"]):
    print(f"{m.path}:{m.line_number}: {m.text}")

hits = gist.files("TODO", types=["py"])
total = gist.count("panic", paths=["services"])
refs = gist.rank("SearchRequest", limit=8)

rank is the one with no grep equivalent: it puts a symbol's definition above its two hundred call sites and sinks generated files below authored ones, which is the shape you want when the best hit matters more than every hit.

This package exposes search and its trigram-index lifecycle only. Kinship lives in relate-search and the composed verbs in blast-search; importing gist does not make either reachable. It depends on the irregex Python package for the shared substrate (request types, row protocol, shell / daemon / native transports), which imports as irgx.

What it needs

The gist binary on PATH (or $GIST_BIN), which the repository builds with zig build. No index is required; without one gist scans the live tree and returns the same answers, just slower.

Layout

Path Owns
gist/exact/ SearchRequest consumers — aggregate, ranked, warm Engine/Cursor
gist/index/ trigram index status / build / capabilities
gist/agent.py tool-boundary dict → SearchRequest

Shared contract mirrors, the analytic ladder, and binary location live under irgx.contract / irgx.runtime.

The rest of the family

Package Question
gist-search where is this exact pattern?
relate-search what resembles this, and what repeats?
blast-search what breaks if I change this symbol?
irregex the linear-time regex engine underneath all three

Development

cd bindings/python && uv sync --group dev && uv run pytest

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

gist_search-1.0.0.tar.gz (73.3 kB view details)

Uploaded Source

Built Distribution

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

gist_search-1.0.0-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

Details for the file gist_search-1.0.0.tar.gz.

File metadata

  • Download URL: gist_search-1.0.0.tar.gz
  • Upload date:
  • Size: 73.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gist_search-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d2bde02a7e2ad8b9ec3dd2ea7b51361bba545527abe025da74c456f1e73b660c
MD5 fa4cc1ce0844e9ea21765f9904ef81df
BLAKE2b-256 b211c41b88d001beb0b89982788401e312376cd73dfb088ea9ea2c6fa8e63972

See more details on using hashes here.

Provenance

The following attestation bundles were made for gist_search-1.0.0.tar.gz:

Publisher: release.yml on The-Billy-Company/gist

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

File details

Details for the file gist_search-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gist_search-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 36.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gist_search-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1075325f8a41358a99541b87eb7da9475f74ade86cd3a1851a12cfe5fafe96fc
MD5 f58f8f7373e5e9c5ccb11993ba851fb8
BLAKE2b-256 064d78d78b4d77e04cd704a5f40e165552552d78cd3bc33aab13bc298968b09b

See more details on using hashes here.

Provenance

The following attestation bundles were made for gist_search-1.0.0-py3-none-any.whl:

Publisher: release.yml on The-Billy-Company/gist

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