Skip to main content

xdformat

.xd is a plain-text format for crossword puzzles, modeled after the simplicity of markdown. A complete puzzle -- metadata, grid, clues, answers, notes -- is one small UTF-8 file that can be read, edited, diffed, and grepped like any other text file:

Title: New York Times, Saturday, January 1, 1955
Author: Anthony Morse
Editor: Margaret Farrar
Rebus: 1=HEART 2=DIAMOND 3=SPADE 4=CLUB
Date: 1955-01-01


1ACHE#ADAM#2LIL
BLUER#GULL#MATA
EATIN#APEX#ICER
[...]


A1. Sadness. ~ HEARTACHE
A6. Progenitor. ~ ADAM
A10. Mae West stand-by. ~ DIAMONDLIL
[...]

D1. Vital throb. ~ HEARTBEAT
D2. Having wings. ~ ALATE
[...]

The format supports 99.99% of published crosswords and is intended to be convenient for bulk analysis by both humans and machines, from the present and into the future.

This repo holds the format specification and the reference tools for parsing .xd and converting other puzzle formats into it.

The spec

The xdformat Python package

The core package parses and emits .xd with no dependencies:

pip install xdformat
import xdformat

xd = xdformat.parse("nyt1955-01-01.xd")
xd.get_header("Title")        # "New York Times, Saturday, January 1, 1955"
xd.grid                       # list of row strings
for pos, clue, answer in xd.iterclues():
    ...
print(xd.to_unicode())        # canonical .xd text

The converters need the [convert] extra (pulls in puzpy and ipuz):

pip install xdformat[convert]

puz2xd foo.puz > foo.xd
puz2xd -o xd/ *.puz
ipuz2xd bar.ipuz > bar.xd

xdformat/crossword/ is a vendored fork of Simeon Visser's crossword library, updated for changes in the ipuz module.

  • century-arcade/xd -- the corpus pipeline: downloads puzzles from many sources, converts them (using additional publisher-specific converters), analyzes grids and clues, validates with xdlint.py, and builds the website at xd.saul.pw
  • gxd -- the corpus itself, 95k+ puzzles in .xd format (private; join #crosswords on the Discord to discuss getting access)
  • century-arcade/xdcontrib -- deprecated; its minimal converters were merged into this repo

Citing xd

If you publish any research or results using the xd crossword corpus, please cite xd accordingly:

Pwanson, Saul. (2019). "xd Crossword Corpus." Retrieved from http://xd.saul.pw

The year of publication should be the year that the corpus was accessed.

License

MIT; see LICENSE.

Metadata

Release files for xdformat 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xdformat 0.1.0
File Size Uploaded Provenance
xdformat-0.1.0.tar.gz 26.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for xdformat 0.1.0
File Interpreter ABI Platform
xdformat-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.7 kB

Release files / xdformat-0.1.0.tar.gz

Download URL xdformat-0.1.0.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d4acff7d03a7b67b5c6790537398c17def66de361709f32e0df5b6382e701afa
BLAKE2b-256 checksum
How to use checksums
f139a3e5f63eae6446b90b7e178ac3075f1c6996b15a5b45894250406a26f405
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / xdformat-0.1.0-py3-none-any.whl

Download URL xdformat-0.1.0-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30a641742ccf66f7815190bface3a6868474a90c0b5a51959f494bc331437c95
BLAKE2b-256 checksum
How to use checksums
263863d5491265c11468aabecfcf729bc0b4500f21dee221f969784a56a2cd89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Security for xdformat 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page