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.42.tar.gz (24.9 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.42-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for abstract_search-0.0.0.42.tar.gz
Algorithm Hash digest
SHA256 c47ac4df6b326d06f721f41d458c7ac7bda09390e0275be97903e0c5672447b6
MD5 7b7c26447dd1cadc08dd254f5260720f
BLAKE2b-256 cfe3b683f3943dca71545b750fbea662a4c15c8fba9f8d85f626646b3eeb6151

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for abstract_search-0.0.0.42-py3-none-any.whl
Algorithm Hash digest
SHA256 83a69fcdef247774221d8cd9906843cf3d0302b9454fa95babe3c4dca1d1f637
MD5 d14794d483bff30542309fe9274bb2f9
BLAKE2b-256 710aff8cc37e38314a6c78c7eb33231269a3e8ebafaadb03b4616d4a2f3176f4

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.0.42 This release

2 files

0.0.0.41

2 files

0.0.0.4

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