Skip to main content

A read-only, unofficial Goodreads metadata client.

Project description

goodscraps

goodscraps is a standalone, read-only Python client for public Goodreads metadata, including books, authors, works, series, editions, and cover images.

Goodreads has no supported public developer API. These endpoints are unofficial and may change or become unavailable. The package does not log in, read cookies, mutate shelves, submit ratings, or fetch review text.

Development

poetry install
poetry run pytest
poetry run ruff check .
poetry run mypy src/

The test suite runs the live Goodreads smoke test by default. Set GOODSCRAPS_LIVE=0 to run completely offline:

GOODSCRAPS_LIVE=0 poetry run pytest

CI and PyPI releases

GitHub Actions runs offline tests, Ruff, and mypy on pushes to main and on pull requests. Live Goodreads requests are intentionally disabled in CI. After those checks pass, a change to the package version on main automatically creates the matching GitHub release, which triggers PyPI publishing.

To release a new version:

# Bump the package version in pyproject.toml and the CLI source, then commit
# and push it. CI handles the tag,
# GitHub release, and PyPI publication.
poetry run python scripts/set_version.py 0.1.2
git add pyproject.toml
git add src/goodscraps/__init__.py
git commit -m "Bump package version"
git push origin main

Usage

Install the package and create a ~/.local/bin/goodscraps command:

./install.sh

If needed, add ~/.local/bin to your PATH.

Help and usage output uses Tinta ANSI colors when displayed in a terminal. Set NO_COLOR=1 to disable them.

from goodscraps import Goodscraps

with Goodscraps() as client:
    matches = client.search("Elantris", limit=5, resolve_canonical=True)
    book_id = matches[0].canonical_book_id or matches[0].book_id
    book = client.book(book_id)
    work = client.work(book.book_id)
    requested_book = work.requested_book
    canonical_book = work.canonical_book
    editions = client.editions(book.book_id, limit=5)
    series = client.series(book.series[0].series_id) if book.series else None
    client.download_cover(book.book_id, "/tmp/elantris.jpg")

The optional smoke CLI is available as:

poetry run goodscraps search "Elantris" --limit 5
poetry run goodscraps search "Elantris" --limit 5 --no-canonical
poetry run goodscraps book 68427

Searches resolve each result to the first edition Goodreads returns for its work by default and include that ID as canonical_book_id. Use --no-canonical when the original search-result edition IDs are required.

Lookup failures return readable JSON by default:

{
  "error": {
    "type": "NotFound",
    "message": "No author matched 'Unknown'"
  }
}

Use --raise-errors when debugging or when a shell traceback is preferred:

goodscraps --raise-errors author "Unknown"

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

goodscraps-0.1.2.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

goodscraps-0.1.2-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file goodscraps-0.1.2.tar.gz.

File metadata

  • Download URL: goodscraps-0.1.2.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for goodscraps-0.1.2.tar.gz
Algorithm Hash digest
SHA256 990ec139521ab1291e162c5255c8ffbe5d1297c1ad445521c66691dabe9c0b53
MD5 7076591813f8e1e0f9e2b2ab1d85fbd0
BLAKE2b-256 8451378b1c23222dd648161ab05c3787667e513cf227035374312370c98cd90b

See more details on using hashes here.

Provenance

The following attestation bundles were made for goodscraps-0.1.2.tar.gz:

Publisher: publish.yml on brandonscript/goodscraps

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

File details

Details for the file goodscraps-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: goodscraps-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for goodscraps-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f92cdf110bac255ba201fb340e3ce318a08a65b500a8b32808379fd5a216e473
MD5 71d1a85ba952bc2cd1b2cd0873542fb8
BLAKE2b-256 5666052d1ea4b652b23c7e3c17b7820f011d4fd3944ae2e4093b93f9e31d129d

See more details on using hashes here.

Provenance

The following attestation bundles were made for goodscraps-0.1.2-py3-none-any.whl:

Publisher: publish.yml on brandonscript/goodscraps

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