Skip to main content

abstract_search

Standalone string search across files and directories with allow/exclude filtering. Stdlib-only at import time — pdf, office, and spreadsheet readers load lazily and are optional extras.

from abstract_search import findContent

# search every readable file under a directory
hits = findContent("/path/to/project", strings=["needle"], get_lines=True)

# narrow by extension, merge extra excludes with the defaults
hits = findContent("/path/to/project", strings=["needle"],
                   allowed_exts="py", exclude_dirs="tests", add=True)

# exact multi-line match locations
locs = findContent("/path/to/project", strings=["def main(", "return"],
                   structured=True)

Filter semantics: passing a filter kwarg replaces its default set; add=True merges with the defaults instead. Defaults skip node_modules, __pycache__, backups, media/binary extensions, and __init__* files (see constants.py).

from abstract_search import make_allowed_predicate, filter_allowed_items, search_files

allowed = make_allowed_predicate(exclude_exts=".log", add=True)
kept = filter_allowed_items(paths, allowed_exts=[".py", ".md"])
hits = search_files("needle", "/path/to/project")   # line-level SearchHit records

Optional readers: pip install abstract_search[pdf] (pdfplumber), [ocr], [xls], [xlsb], [dbf], [parquet], or [all].

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abstract_search-0.0.0.4.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

abstract_search-0.0.0.4-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file abstract_search-0.0.0.4.tar.gz.

File metadata

  • Download URL: abstract_search-0.0.0.4.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for abstract_search-0.0.0.4.tar.gz
Algorithm Hash digest
SHA256 f66dc236e61a461fa7a6aa604caf24ab2f65819e1eb1efa8274d7bac459dfdef
MD5 02bdc93a6502948112769635aae9fc35
BLAKE2b-256 298dae5b8c1944b702a4260891200672c12c4a6586710f11d5c0bad25495b3ad

See more details on using hashes here.

File details

Details for the file abstract_search-0.0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for abstract_search-0.0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6580783c2bda479ac71fb6474ed77f1801d1ddf0666dec7b128a3c76ff034d7c
MD5 bd2addd161e0cb8c86159e76c283f910
BLAKE2b-256 891ccd712185d1720d6085492408da34a3dabc7434397dd0bd465e6fd7ff1ac5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.0.42

2 files

0.0.0.41

2 files

This release

0.0.0.4 This release

2 files

0.0.0.3

2 files

0.0.0.2

2 files

0.0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page