Repository navigation
Releases: lukwam/nytimes-games
Release list
v0.9.2
Added
connections_latest(puzzle_ids)andstrands_latest(puzzle_ids): your
saved Connections and Strands games, shaped likewordle_latest()(up to
30 puzzle IDs per call;statesonly includes games you've played). Game
data is lenient, since older games vary: every field is optional and extra
fields are kept.isPlayingArchivetells games played from the archive
apart. Requested by nyt-puzzles.nytg history connections(won or lost, mistakes, groups found) and
nytg history strands(solved, other words found).GET /connections/latestandGET /strands/latestin the API.
v0.9.1
Fixed
nytg archive crossword-*saved only one puzzle on dates with two (such as
2022-12-31, where it kept the Supermega and skipped the daily). Crosswords
are now listed from the games archive and fetched by ID; dates with two
puzzles save each asYYYY-MM-DD-ID, and single-puzzle dates keep their
YYYY-MM-DDnames, so existing archives resume as before. Future dates
are still fetched by date.
v0.9.0: an MCP server for AI agents
Added
nytg-mcp, a local MCP server for AI agents, behind themcpextra
(pip install "nytimes-games[mcp]"): 15 tools for puzzles (with crossword
entries and crossings), WordleBot, the puzzle archive, your stats, today's
games and histories, and crossword export. Answers are hidden unless
include_answersis set; cookies come fromNYT_COOKIESor your nytg
profile and are never returned or logged; every tool is read-only except
export_crossword.nytgames.views: the plain data behind nytg's commands (puzzle views with
answers hidden, today, histories, WordleBot comparisons), shared by nytg and
the MCP server.
v0.8.4
Fixed
- Saved game states from older games failed validation, failing whole
batches inspelling_bee_latest()andwordle_latest(): Spelling Bee
games without arank, and Wordle games in a rounds-based format
(rounds,currentRoundIndex,puzzleComplete, no guesses). These fields
are now optional, the rounds-based fields are typed, and
WordleGameData.rounds_formattells the formats apart.print_date(often
empty on older games) andtimestampare optional too. Found by
nyt-puzzles. nytg todayandnytg historyshow these games as "played".
v0.8.3: cookie safety fix
Security
nytgcould print cookie values in a traceback whenNYT_COOKIESor
--cookiesheld a Cookie-Editor JSON export: it was parsed as a Cookie
header string, producing an invalid header whose error message contained
every cookie. Reported by nyt-puzzles. If you hit this, rotate your NYT
cookies (log out and back in).
Fixed
parse_cookies()(and soNYTGamesClient,NYT_COOKIESand
--cookies) accepts a JSON export or JSON object as a string.- Cookies are checked before any request; invalid ones raise
ValueError
naming the cookie but never showing its value. nytgnever prints raw tracebacks: unexpected errors print a one-line
message with any cookie values redacted.
v0.8.2: WordleBot
Added
- WordleBot:
wordlebot()returns your analysis of today's Wordle (luck and
skill, overall and by round; needs cookies, today only, after you've opened
WordleBot), andwordlebot_summary(date)returns how everyone did on any
day since 2021-06-19, including the bot's solve paths. nytg wordlebot [DATE]compares your luck and skill with everyone's and
shows where your skill falls among players;--answersshows the bot's
paths. API routes/wordlebotand/wordlebot/{date}/summary.- Cookies are only sent to NYT's main site, never to its static file server.
v0.8.1
Fixed
archive()could silently drop the first day of a 31-day window when a
date in it had two puzzles, because NYT returns at most 31 puzzles per
request (e.g. 2022-12-01, next to 2022-12-31's daily and Supermega).
Windows that hit the limit are now split and fetched again. Both puzzles on
a two-puzzle date are returned, sorted by date and ID. Found by nyt-puzzles.
Added
crossword_by_id(puzzle_id)for any crossword by ID, such as the second
puzzle on a date that has two. API route/crosswords/id/{puzzle_id}and
nytg crossword --id.
v0.8.0: puzzle structure, retries, fidelity reports and a live NYT check
Added
-
A live check of every game against NYT runs every morning, with a README
badge showing the latest result. Failures open an issue automatically. -
A coverage badge.
-
Puzzle structure helpers:
CrosswordPuzzle.entries()(each entry's clue,
full answer, squares, coordinates, crossings and referenced clues) and
.squares(),StrandsPuzzle.words()(words with their paths) and
ConnectionsPuzzle.board(). Special puzzles are kept as they are. -
formats.fidelity(puzzle, fmt, game=None): what an export approximates or
leaves out, such as shading shown as circles in .puz or italics in clues.
nytg crossword --saveprints these notes. -
nytg archivekeeps amanifest.jsonper game with each file's retrieval
time, NYT's update time, the nytimes-games version and a SHA-256 hash.
With--overwrite, puzzles NYT has changed keep their previous version
inrevisions/and are reported as changed. -
Examples: a Letter Boxed solver, clue reuse across crosswords, and solve
times by weekday and constructor. -
A README capability matrix: what each method returns and which fields are
spoilers. -
Retries with exponential backoff for failed connections, timeouts, rate
limits and NYT server errors, honoringRetry-After
(NYTGamesClient(retries=3, backoff=0.5)). Sessions you pass in are used
as is. -
NYTGamesRateLimitError(429 after retries) withretry_after, and a
matching nytg message. -
NYTGamesClient(base_url=...), for proxies and testing. -
urllib3is declared as a dependency (it comes with requests).
Fixed
crossword_puzzles()returned a validation error when NYT sends null
results (for empty ranges and ranges that are too long); it now returns an
empty list. Its docs recommend ranges of 90 days or less.
v0.7.0: export crosswords to .puz, .ipuz and XML
Added
nytgames.formats: export crosswords to Across Lite.puz,.ipuzand
Crossword Compiler rectangular-puzzle.xml, with the user's saved
progress (fill, revealed and penciled squares, and the .puz timer).
Rebus squares, circles and shading are kept where the format allows.
export(),to_puz(),to_ipuz(),to_xml()andexport_problems().NYTGamesExportErrorfor puzzles whose gimmicks a format can't represent,
with the reasons.nytg crossword ... --save FILE [--progress]and
nytg archive crossword-* --as puz|ipuz|xml.- API route
/crosswords/{publish_type}/{date}/download?format=puz.
v0.6.1
Fixed
- Crosswords with special square labels no longer fail validation.
CrosswordPuzzleCell.labelis still an int for numbered squares, and a
string for text labels such asCWor arrows (2000-02-13, 2007-07-01,
2017-07-02).CrosswordPuzzleClue.labelis optional, for special clues
like 2016-03-24's "Around" clue. nytg crossword --answersno longer repeats letters in clues that turn a
corner.