Installation¶
ddi-l requires Python 3.11 or newer and is available on PyPI.
Install from PyPI¶
Use this unless you want to change ddi-l itself.
Verify the installation
ddi --helpconfirms the CLI entry point is on yourPATH.python -c "import ddi_l; print(ddi_l.__version__)"prints the installed version.
Optional dependencies¶
| Need | Command | What it unlocks |
|---|---|---|
| Accelerated XML parsing | pip install 'ddi-l[full]' |
Enables the lxml backend: faster parsing, and near-instant validation of valid documents. |
| HTTP API | pip install 'ddi-l[server]' |
Adds the Litestar service behind ddi serve; see HTTP API. |
Schemas are already included
The DDI 3.1, 3.2, and 3.3 XML Schemas ship inside the package, so
doc.validate() and ddi validate work offline with no extra download
and no network access.
Install from source¶
Developers contributing to ddi-l should install from a local checkout:
Install the development toolchain. The project is managed with
uv, and uv.lock pins every dependency version:
uv sync --group dev # Runtime + development dependencies
uv sync --group dev --extra full # ...plus the optional lxml backend
Note that full is an extra, not a dependency group: --group full
fails.
With plain pip instead (pip 25.1 or later reads dependency groups):
For documentation work (docs is a dependency group, not an extra):
Verify with a quick smoke test¶
import ddi_l as ddi
doc = ddi.new_study(title="Test", agency="example.org")
doc.add_question(text="Does it work?")
print(f"Questions: {len(doc.questions)}") # -> 1
For more details, see the user guide or the contributor guide.