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, then commit and push it. CI handles the tag,
# GitHub release, and PyPI publication.
poetry version patch
git add pyproject.toml
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.1.tar.gz (12.9 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.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: goodscraps-0.1.1.tar.gz
  • Upload date:
  • Size: 12.9 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.1.tar.gz
Algorithm Hash digest
SHA256 ec82e866fec9202f171a7e00c44c431840f7e710dc20d4e5caf031a7ae0a72b8
MD5 22dd5a45edb1f22e925586409e090005
BLAKE2b-256 d1f79685ba7c44ffa20cabb1a4d4841c8025cba510a3a51c76dfb7f00e0bc462

See more details on using hashes here.

Provenance

The following attestation bundles were made for goodscraps-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: goodscraps-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03f075ae184362779dc4bb4765532129e579478447bbcd613f2677de6262ee2d
MD5 6ff4b9bb79fac42d461d26d2e9d3e13b
BLAKE2b-256 a64c9e78ed9d49383e6bb217cbbb4801462ba1adc39133c078e40b08cba6db56

See more details on using hashes here.

Provenance

The following attestation bundles were made for goodscraps-0.1.1-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