Metadata-Version: 2.5
Name: quote-vetter
Version: 0.1.0
Summary: Vet a quote or poem before you publish it: public-domain check, known misattributions, Wikiquote source check and a credit line. CLI, MCP server and Claude Code skill.
Project-URL: Homepage, https://github.com/ali-saad-khan/quote-vetter
Project-URL: Source, https://github.com/ali-saad-khan/quote-vetter
Project-URL: Issues, https://github.com/ali-saad-khan/quote-vetter/issues
License: MIT
License-File: LICENSE
Keywords: claude-code,copyright,mcp,misattribution,poetry,public-domain,quotes,shorts,wikiquote
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Text Processing
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == 'dev'
Provides-Extra: mcp
Requires-Dist: mcp>=1.2; extra == 'mcp'
Description-Content-Type: text/markdown

# quote-vetter

**Vet a quote or poem before you publish it.** One command tells you whether it is public domain where you publish, whether the person really said it, and what credit line to add. Verdict: **safe**, **review** or **avoid**, with every reason.

Quote channels trip over two quiet problems: misattributed quotes ("Be the change you wish to see in the world" is not Gandhi's) and copyright on newer authors. This is the check I run by hand on every quote before it goes into a Short, as a CLI with no dependencies, an MCP server and a Claude Code skill. It reads [versereel](https://github.com/ali-saad-khan/versereel) specs directly.

```console
$ pip install quote-vetter

$ quote-vetter "Be the change you wish to see in the world" --author "Mahatma Gandhi" --death 1948
AVOID   Be the change you wish to see in the world  — Mahatma Gandhi
        [avoid] misattributed: commonly credited to Mahatma Gandhi. No record of Gandhi saying this; the closest real passage
                is a longer, different sentence from 1913. (Wikiquote: Mahatma Gandhi > Misattributed)

$ quote-vetter "Hope is the thing with feathers" --author "Emily Dickinson" \
      --death 1886 --born 1830 --published 1890 --source "Poems (1890)"
SAFE    Hope is the thing with feathers  — Emily Dickinson
        [ok] verbatim source stated by you: Poems (1890)
        credit: Emily Dickinson (1830–1886), public domain. Source: Poems (1890)
```

## What it checks
| Check | How |
|---|---|
| **Public domain** | Date maths from the author's death year and the work's publication year: life + 70 (EU, UK and many others), life + 50 (older or other terms), and the US rule for works published 95+ years ago. `--profiles` picks which apply to you. |
| **Known misattributions** | A short, curated, cited list that works offline: never said, misattributed, altered, unverified, with the likely true source. |
| **Source check** (`--online`) | Looks the quote up on the author's Wikiquote page and sorts it into sourced, unsourced, disputed or misattributed, with fuzzy matching so punctuation and spacing do not matter. Wikidata supplies the death year if you did not give it. |
| **Credit line** | A ready attribution for the description, only produced when the verdict is not *avoid*. |

### The honesty rule
`safe` means **public domain in the chosen profiles and the exact wording was checked against a source** (Wikiquote's sourced list, or a source you state with `--source`). Anything not verified is `review`. Known misattributions and still-protected works are `avoid`. If the network fails, the answer degrades to `review`, never to `safe`.

**Not legal advice.** Copyright terms vary by country and by work, and posthumous publication can change the dates. Wikiquote is community edited. The offline list is short on purpose and is not exhaustive. A close match is reported with its similarity so you can compare word for word.

## Use it
```bash
quote-vetter "text" --author "Name" [--death YEAR] [--born YEAR] [--published YEAR] [--source "where you checked it"] [--online]
quote-vetter --file quotes.json            # a list of {quote, author, death_year, published_year, source}
quote-vetter --file versereel-spec.json    # vets a versereel poem spec (author and stanzas)
quote-vetter ... --json --strict           # JSON out; exit 2 on avoid, and 1 on review with --strict
```
Exit codes: `0` ok, `2` at least one *avoid*, `1` at least one *review* when `--strict`.

### Python
```python
from quote_vetter import vet_quote
v = vet_quote("Hope is the thing with feathers", "Emily Dickinson", death_year=1886, published_year=1890, source="Poems (1890)")
v.verdict, v.credit
```

## As an MCP server
```bash
pip install "quote-vetter[mcp]"
```
```json
{ "mcpServers": { "quote-vetter": { "command": "quote-vetter-mcp" } } }
```
Tools: `vet_quote` (optional network), `pd_status` (dates only), `check_known_misattribution` (offline).

## As a Claude Code skill
Copy `skill/quote-vetter/` to `~/.claude/skills/quote-vetter/`. It makes the assistant vet every quote before rendering or posting, record the verdict and use the credit line.

## Known limits
- The Wikiquote lookup follows Wikiquote's documented section layout (Quotes, Disputed, Misattributed) and is tested against fixtures written in that layout. It has not yet been verified against live pages in the development environment, so treat `--online` as beta and report any page it misreads.
- The US rule uses the publication date only; renewal and notice rules for works from 1931 to 1977 are not modelled.
- Author matching on Wikidata picks the first person found; the output names who it found so you can confirm.

## Develop
```bash
git clone https://github.com/ali-saad-khan/quote-vetter && cd quote-vetter
uv venv && uv pip install -e ".[dev,mcp]" && pytest
```

## Author
Built by Saad Ali Khan, a full stack and AI engineer. Portfolio: [saadconsulting.tech](https://saadconsulting.tech). Available for freelance work on AI tooling, MCP servers and automation.

## Licence
MIT
