Skip to main content

sheetah

sheetah is a lightweight Python library for working with Markdown documents. It splits a Markdown file into segments based on H2 headers ("##"), provides fuzzy search over segment titles and content, and includes an interactive command-line interface with clipboard copy support.

Installation

Install from PyPI:

pip install sheetah

Or install and develop locally in a virtual environment:

cd sheetah
python -m venv .venv
# Windows
. .venv/Scripts/activate
# macOS / Linux
source .venv/bin/activate
python -m pip install -e .[all]

The optional extras include prompt_toolkit and pyperclip for the interactive UI.

Usage

Programmatic

from sheetah import Document

md = """Introduction

## Section 1
Text1

## Section 2
Text2
"""

doc = Document.from_markdown(md)
print(doc.description)
for seg in doc.search("Text"):
    print(seg.name)
    print(seg.text())

Command line

sheetah path/to/file.md

The interactive UI lets you:

  1. Enter a search query at the top.
  2. See results listed with the best match selected by default.
  3. Navigate results with the arrow keys and preview the segment.
  4. Press Enter to copy the selected segment's text to the clipboard.
  5. Press Ctrl-C or Ctrl-Q to exit.

The document description (everything before the first ##) is shown above the search input.

API

  • Document.from_markdown(markdown: str) -> Document — create a document from a Markdown string.
  • Document.items — list of Segment instances.
  • Document.description — Markdown text before the first H2 header.
  • Document.search(query: str, limit: Optional[int] = None) — fuzzy search.
  • Segment.name — segment title (header).
  • Segment.text() — plain-text representation of the segment.
  • Segment.html() — HTML representation of the segment.

Tests

Run the test suite with:

pytest

Contributing

Contributions are welcome. Please open issues or pull requests on GitHub.

License

MIT — see the LICENSE file for details.

Metadata

Release files for sheetah 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sheetah 0.2.1
File Size Uploaded
sheetah-0.2.1.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sheetah 0.2.1
File Interpreter ABI Platform
sheetah-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.4 kB

Release files / sheetah-0.2.1.tar.gz

Download URL sheetah-0.2.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
33f2b61515aef9787d5cb0c06dd5af736b0d337c52a4e209103d84dc6f4229d5
BLAKE2b-256 checksum
How to use checksums
2a8996c14a48ac084eb8312b11ac6e7b3d570565f0dc9ad291e1f41361bebfcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / sheetah-0.2.1-py3-none-any.whl

Download URL sheetah-0.2.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58cdc7c888ed8da281c2feb0ab7e4c763071a2b3d38c736fa756c4644241b8d6
BLAKE2b-256 checksum
How to use checksums
28f9b9e17fda7e5f999681aba6340c166dcd6b26e995e1f8a27cb6f9af6ad167
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release 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