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.2.tar.gz (16.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.2-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: abstract_search-0.0.0.2.tar.gz
  • Upload date:
  • Size: 16.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.2.tar.gz
Algorithm Hash digest
SHA256 b7ab6e2cd1e5b18b793d3f71cfebd3d735e74365440188c9b65aea134268e7a5
MD5 8f3f5021ba150c5cbea6a2677ba88af3
BLAKE2b-256 991ae86a693bba99565cb4de835486f258bedd976f009f5fb1bd74021155ad74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for abstract_search-0.0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e08b138a69925748dc64e4ac4a5a8eb4019fa191457639ce366c94dab36eef89
MD5 c2e229858aef8db59062b65aa916915e
BLAKE2b-256 3adcc7db2b20d26e2f505064f0f25732d858eab5ff23ed93379c8fb712e2a413

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

0.0.0.3

2 files

This release

0.0.0.2 This release

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