Skip to main content

Fast local search across public-domain literary works

Project description


gutenbit brand mark

A command line tool for fast local search across public-domain literary works.
Find, browse and search books from your terminal.

PyPI version Python 3.11+ License Docs site

CLI Install

Try the latest stable release from PyPI without a persistent install:

uvx gutenbit --help

Or install it like this and then run gutenbit --help:

uv tool install gutenbit

gutenbit stores its database and catalog cache in a .gutenbit/ folder.

CLI Example

Find a book in the Project Gutenberg catalog and download it locally. Sections are parsed automatically during import.

gutenbit catalog --author "Austen, Jane"
gutenbit add 1342

Inspect the table of contents, read the opening, or jump into a section. If a book is missing locally, gutenbit toc <id> adds it automatically first.

gutenbit toc 1342
gutenbit view 1342
gutenbit view 1342 --section 1 --forward 5

Search within the book and read exact matches or nearby context.

gutenbit search "truth universally acknowledged" --book 1342 --phrase
gutenbit search "bennet" --book 1342 --limit 3 --radius 1

All commands support --json for machine-readable output. CLI-managed state is stored under .gutenbit/ by default, including the database at .gutenbit/gutenbit.db and the catalog cache under .gutenbit/cache/.

Python

gutenbit can also be used as a python module. Add it to your project with:

uv add gutenbit
from gutenbit import Catalog, Database

catalog = Catalog.fetch()
book = catalog.get(1342)

if book is not None:
    with Database(".gutenbit/gutenbit.db") as db:
        db.ingest([book])
        for hit in db.search("truth universally acknowledged", book_id=1342):
            print(hit.title, hit.div1, hit.content[:80])

Documentation

Full documentation: Getting Started | CLI | Python API | Concepts

Project Gutenberg Access

gutenbit is an open-source project not affiliated with Project Gutenberg. It is for individual downloads, not bulk downloading. It prefers official mirrors and uses the main site only as a zip fallback, with a default 2.0 second delay between downloads. gutenbit also sends an identifying default User-Agent on Gutenberg and PGLAF requests: gutenbit/<version> (+https://gutenbit.textualist.org). Review Project Gutenberg's Robot Access Policy and Terms of Use.

Development

uv run pytest                    # fast local suite (excludes live Gutenberg downloads)
uv run pytest -m network         # live parser regression corpus against Gutenberg
uv run ruff check .              # lint
uv run ruff format --check .     # format check
uv run ty check                  # type check

License

MIT

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

gutenbit-0.1.10.tar.gz (307.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gutenbit-0.1.10-py3-none-any.whl (66.2 kB view details)

Uploaded Python 3

File details

Details for the file gutenbit-0.1.10.tar.gz.

File metadata

  • Download URL: gutenbit-0.1.10.tar.gz
  • Upload date:
  • Size: 307.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gutenbit-0.1.10.tar.gz
Algorithm Hash digest
SHA256 ec0ef65c43007d1b58b05008706afa70e28bf6f532e6d913d72200dbbe2eee5c
MD5 13d9bdc24f30582a89a61cca0b529425
BLAKE2b-256 f4babc3bd742c51330cccfd771b47222b2cd3d94b3950f5d3220e9d58a5bd5a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for gutenbit-0.1.10.tar.gz:

Publisher: release.yml on textualist/gutenbit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gutenbit-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: gutenbit-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 66.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gutenbit-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 c1a46d050b87f36f7912f4399cdd432f6285d650f076a79bacba32eed5133929
MD5 be7ea612e45f445b8568a326cd0323c6
BLAKE2b-256 b464a3d3dec4a870d5fdcd406a43d90458300adf0e66b5ef79ee3b5d2e5db428

See more details on using hashes here.

Provenance

The following attestation bundles were made for gutenbit-0.1.10-py3-none-any.whl:

Publisher: release.yml on textualist/gutenbit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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