Metadata-Version: 2.4
Name: grimmoire
Version: 0.1.0
Summary: Search Library Genesis, preview in zathura, opt to keep.
Author: grimmoire contributors
License: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/f2e6/grimmoire
Project-URL: Issues, https://github.com/f2e6/grimmoire/issues
Keywords: libgen,tui,zathura,ebook,cli
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: libgen-api-enhanced>=0.2
Requires-Dist: questionary<3,>=1.10
Requires-Dist: requests>=2.28
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Dynamic: license-file

# grimmoire

A small terminal spellbook for [Library Genesis]: search, stream a book to a
temp cache, open it in [zathura] for a quick read, then either **keep** it in
a persistent collection folder or **discard** it.

[Library Genesis]: https://libgen.is/
[zathura]: https://pwmt.org/projects/zathura/

- Type-to-filter TUI for picking from search results.
- Books stream to a temp cache first; only kept on explicit confirmation.
- Two-tier storage: ephemeral cache + persistent collection (XDG-compliant).
- Top-level menu: search / browse / delete.

## Requirements

- Python 3.10+
- [zathura] installed at the system level (via your package manager)

## Installation

`pipx` keeps grimmoire in an isolated venv but exposes the `grimmoire`
command on your PATH:

```bash
pipx install grimmoire
```

Or with `pip`:

```bash
pip install --user grimmoire
```

To install from a working copy of this repo (e.g. for development), see
[DEVELOPING.md](./DEVELOPING.md).

## Usage

```bash
grimmoire
```

Then choose what to do from the menu:

1. **Search Library** — search, pick a book (preferring EPUB),
   download, open in zathura. After reading, choose **Keep** (default) or
   **Discard**.
2. **Browse my collection** — pick a saved book, open in zathura. After
   reading, choose **Delete** (default: keep).
3. **Delete from collection** — pick a saved book, confirm, delete. (No
   zathura; for batch pruning without re-reading each one.)

`Ctrl+C` cancels any prompt.

## Storage

Storage follows the [XDG Base Directory Specification]:

- Cache (in-flight downloads): `$XDG_CACHE_HOME/grimmoire/tmp/`
  (default `~/.cache/grimmoire/tmp/`)
- Collection (kept books): `$XDG_DATA_HOME/grimmoire/library/`
  (default `~/.local/share/grimmoire/library/`)

The collection folder is created automatically on first use.

[XDG Base Directory Specification]: https://specifications.freedesktop.org/basedir-spec/

## License

GPLv3
