Metadata-Version: 2.4
Name: purebible
Version: 0.1.2
Summary: PureBible terminal client for nvim/btop/terminal lovers — vim-keys, btop-style TUI, zero dependencies
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/ripekern/purebible-py
Project-URL: Repository, https://github.com/ripekern/purebible-py.git
Keywords: kjv,bible,bible-search,king-james,tui,terminal,curses,vim
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console :: Curses
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Religion
Classifier: Topic :: Terminals
Classifier: Topic :: Text Processing :: General
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# purebible (Python) — for people who live in nvim, btop & the terminal

Zero-dependency Python remake of the `purebible` terminal client.
Vim keys. btop-style bars. Pipes like a good Unix citizen. No Qt, no build.

Stateless by design: no daemon, no server, no background state. Every
invocation reads the KJV text fresh and exits; the TUI keeps results in
memory only and writes nothing.

```
purebible "God | Jesus"        # OR search
purebible "God Jesus"          # exact phrase
purebible "James* & John*"     # AND in same verse (new: old CLI gave 0 rows)
purebible "John 3:16"          # smart-dispatch → lookup
purebible lookup "Rom 12:1-2"  # ranges + whole chapters ("John 3")
purebible tui "love*"          # fullscreen: j/k, /, :, n/N, y, q
```

## Install (PyPI)

```sh
sudo pacman -S python-pipx      # isolated CLI installs, the Arch-friendly way
pipx install purebible
purebible "John 3:16"           # verify
purebible tui                   # full-screen mode
```

The KJV text (9 MB, public domain) ships bundled inside the package —
no setup needed. To use a different transcription instead, point at it
explicitly (`--text`, `PUREBIBLE_TEXT`) or drop it in
`~/.local/share/purebible/SW1769Bible_both.txt`, which takes precedence
over the bundled copy. Bundled transcription from the
[KingJamesPureBibleSearch](https://github.com/dewhisna/KingJamesPureBibleSearch)
project.

`pipx` keeps it off system python — Arch is
externally-managed, so plain `pip` would need `--break-system-packages`.
Zero runtime dependencies either way (curses ships with Arch's `python`).

From GitHub instead: `pipx install
git+https://github.com/ripekern/purebible-py.git`.

No AUR package yet — new AUR registrations are currently paused for
spam, so it can't be submitted right now. Planned once they reopen.

## Install for development

```sh
cd ~/Work/purebible-py
pip install -e . --break-system-packages   # gives `purebible` + short alias `pb`
# or without install:
python3 -m purebible "John 3:16"
```

The KJV text ships bundled (`purebible/data/`), so a checkout works out
of the box — to use a different copy instead, one-time setup:

```sh
mkdir -p ~/.local/share/purebible
ln -s ~/Work/purebiblesearch/text/complete/SW1769Bible_both.txt \
      ~/.local/share/purebible/SW1769Bible_both.txt
# alternatives: export PUREBIBLE_TEXT=/path/to/SW1769Bible_both.txt,
# or copy it to ./data/ or ~/.config/purebible/
```

## Why this exists

`purebible-cli` (C++/Qt) is exact but heavy: CMake, Qt6, daemon
sockets, 30 MB servers. This is the same *terminal client* rewritten in
pure Python for terminal-first users:

- **nvim**: `purebible` prints `ref: text`, one per line — `:r !pb "Rom 12:1-2"`,
  quickfix-friendly, `--refs-only` + `fzf` ready, `--no-color` for pipes.
- **btop**: `purebible tui` is a live dashboard — header stats bar,
  reverse-video statusline, instant ms timings.
- **terminal**: nvim-style NORMAL/INSERT/COMMAND modes (`/` fresh search,
  `i` caret before current query, `a` caret after it, arrows + `C-u`/`C-w`
  editing, `:` for commands, `Esc` drops back to NORMAL and never quits — quitting
  is `q`, `ZZ`/`ZQ` or `:q`, NORMAL mode only), `:` opens a centered
  noice-style popup in the upper third, and the bar stays minimal —
  mode tag + current search only (confirmations flash briefly).
  Jumplist (`Enter` opens a
  chapter, `C-o` jumps back), `↑`/`↓` prompt history, `C-u`/`C-w` line
  editing, even `:w` politely refuses. Lualine-style mode tags and refs
  colored for your system theme (auto-detected,
  `PUREBIBLE_THEME=dark|light` to override), `:help` opens a scrollable
  screen with the key list + every search and lookup pattern, `:clear` to
  clear results, `NO_COLOR` respected, works over SSH with zero deps.

## Query language

| syntax | meaning | example |
|---|---|---|
| `a b` | phrase (consecutive) | `"God said"` → 9 hits |
| `a \| b` | OR (union) | `"God \| Jesus"` |
| `a & b` | AND (same verse) | `"James* & John*"` |
| `a & -b` | NOT (verse must lack `b`) | `"love & -loved"` |
| `love* ?eth [a-z]` | wildcards per word | `"four*"` |
| `\c` / `\C` | vim case override (`\C` sensitive) | `"Amen\C"` → 77 |
| bare `*` | any single word gap | `"God * heaven"` |

Flags mirror the old client: `-c/--case`, `-A/--abbrev`,
`-w/--no-wordindex`, `-d/--no-dup`, `--comma`, `--refs-only`,
`--book/--chapter/--verse` (scope for `&`), plus `--count`, `--limit N`.

## License

Open source. Code is GPL-3.0-or-later (same as the project it was ported
from) — see [LICENSE](LICENSE); the King James Bible text itself is public domain.

## Notes / differences

- Native build ships **KJV 1769 only** (`bibles` → `1`). Asking for another
  id prints a note and maps to 1 (the old Qt backend had 40+).
- Search runs on the whole-Bible word stream like KJPBS (phrases may span
  verse boundaries); `*` inside a phrase is a single-word skip. Hyphenated
  compounds (`Bar-jesus`), ligatures (`Cæsar`→`Caesar`), psalm
  superscriptions and Pauline colophons all match the C++ concordance —
  verified identical counts and word indexes on a battery of queries
  (`Jesus` 973, `God` 4444, `David` 930 deduped, …). `-y` enables
  hyphen-sensitive mode.
- `&` is new (old CLI treated it as a literal word → always 0). `|` and
  phrase/wildcard semantics match the original.
