Skip to main content

Standalone string search across files and directories with allow/exclude filtering; stdlib-only core that reads code, text, pdf, office, and archive-based formats.

Project description

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].

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

abstract_search-0.0.0.1.tar.gz (16.0 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.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: abstract_search-0.0.0.1.tar.gz
  • Upload date:
  • Size: 16.0 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.1.tar.gz
Algorithm Hash digest
SHA256 97829f724467aa3df6b1a5d80039953720dc65d26d805d08e89f7d29700656fd
MD5 a686f9f2b2d2a804893ab859954c83d3
BLAKE2b-256 d0a02c82391768b312b16f9c1a6011fbef0fad76cd6f0a4e19765ad12ca2e17a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for abstract_search-0.0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a17d20cf8e06a89ddbf005ee872f02624e16ed81c33ce3e0f7a35d63d507368
MD5 7aa62c2e3bae050353c31d0651bd3d97
BLAKE2b-256 f3b580bea740a10d94e07ec88f3254ae6719ad41491e98c5cb117385bd75c985

See more details on using hashes here.

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