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.3.tar.gz (16.2 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.3-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: abstract_search-0.0.0.3.tar.gz
  • Upload date:
  • Size: 16.2 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.3.tar.gz
Algorithm Hash digest
SHA256 d9057deeec28481be8ef66900bab7b166b66eb03d4c6c8596be2365e74b7dd3c
MD5 8203d0b75de9caf501dadd55edb75c86
BLAKE2b-256 21f5569a5ee0487db439a80e0810ec99b603eb615edc6d7c4a4eaf8d25749df2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for abstract_search-0.0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ada40bfb1ad371c39a3a65ab8d8977275ebe2fb2e8b38b53916070efb9b08381
MD5 7eeb926724b36bdce4b72dbc47aa076e
BLAKE2b-256 24efaec63479fa6698acb9d8f11df477940b8e28644a926b03b31f6c33f6cd0a

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

0.0.0.4

2 files

This release

0.0.0.3 This release

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