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.41.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.41-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for abstract_search-0.0.0.41.tar.gz
Algorithm Hash digest
SHA256 c9684b40d519c25a2e248686948ae3fc98bc447544ac7fa7724e0189be9027fe
MD5 5b12e2e0fe9471eb8a292eb96de610e5
BLAKE2b-256 d3e66c114706191ca89f0216f24d41fa18008794358f4f576177e9b9cd36f3bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for abstract_search-0.0.0.41-py3-none-any.whl
Algorithm Hash digest
SHA256 6ef1d0eafa13cde051d7a84f47ec008f6b4212ef25595fe1cc841d910862d6e7
MD5 3812d87d3e1122a48928bb088153dfd2
BLAKE2b-256 c32debf08b122c154b33e2c7a975ff75ef73bcb3bef4c7b817ea8c41d6304132

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.0.42

2 files

This release

0.0.0.41 This release

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