DAWG2-Python
Pure-python reader for DAWGs (DAFSAs) created by dawgdic C++ library or DAWG Python extension.
What it is and what it does
DAWG2-Python is a pure-Python reader for DAWG (directed acyclic word graph) files, a space-efficient data structure for storing and querying large sets of strings with common prefixes. It provides read-only access to DAWGs built by the dawgdic C++ library or the DAWG Python extension, without requiring compiled dependencies. The package aims for API compatibility with the original DAWG module where feasible, making it a drop-in replacement for loading and querying pre-built DAWGs.
The main use case is accessing DAWG data structures in pure Python environments—particularly under PyPy, where it performs well—or when you want to avoid the compilation overhead of C extensions. It supports prefix-based lookups, key iteration, and membership testing. The package is read-only by design; DAWGs must be created externally using the DAWG or dawgdic libraries.
Use it for:
- Load and query large word lists or dictionaries built as DAWGs without C extension dependencies.
- Perform prefix-based searches on linguistic or dictionary data stored in DAWG format.
- Run DAWG lookups under PyPy for better performance than CPython without recompiling.
- Integrate DAWG-based data structures into pure-Python applications or libraries.
- Check membership and iterate over keys in pre-built DAWG files for NLP or spell-checking tasks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Read-only access to DAWG (directed acyclic word graph) files created by the dawgdic C++ library or DAWG Python package, without requiring compiled extensions.
Yes. The package is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a specific problem well: reading DAWG files in pure Python. Install it if you have pre-built DAWG data and want to query it without compiled extensions or C dependencies. Not suitable if you need to create DAWGs or require the fastest possible CPython performance.
Install
dawg2-python on PyPI
pip
pip install dawg2-pythonuv
uv add dawg2-pythonpoetry
poetry add dawg2-pythonInstalling DAWG2-Python
Before you install
Low friction: single pure-Python dependency (typing-extensions), wheel distribution, and active maintenance with recent commits. Supports Python 3.8 through 3.13 and PyPy.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install DAWG2-Python
from DAWG2-Python import DAWG
d = DAWG().load('words.dawg')
if 'word' in d:
print(d['word'])
Requires a pre-built DAWG file created by the DAWG Python package or dawgdic C++ library; this package cannot create DAWGs.
Verify before relying
- Whether performance under CPython (stated as ~50x slower than PyPy) is acceptable for your use case.
- Compatibility with DAWG files created by specific versions of the dawgdic or DAWG libraries.
- Exact API compatibility scope with the original DAWG module beyond what the description states.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — typing-extensions |
| Maintenance | actively maintained — 543 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 400,636/month — #6,937 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dawg2_python-0.9.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
DAWG-PythonReads DAWG (Directed Acyclic Word Graph) files…
permissive · top 15,000 on PyPI
asciidagRenders directed acyclic graphs as ASCII art in…
copyleft · top 15,000 on PyPI
ipydagred3ipydagred3 is an ipywidgets library for…
permissive · top 15,000 on PyPI
adagioAdagio provides a directed acyclic graph (DAG)…
permissive · top 5,000 on PyPI
bigtreeBigtree provides tree, binary tree, and…
permissive · top 15,000 on PyPI
pure-pcapy3Pure-Python implementation of the pcapy API for…
permissive · top 15,000 on PyPI
toposortImplements topological sorting of directed…
permissive · top 5,000 on PyPI
textparserA fast text parser library that lets you define…
permissive · top 5,000 on PyPI
apache-airflow-coreApache Airflow's core runtime that schedules,…
permissive · top 5,000 on PyPI
syllapyCounts syllables in English words, returning an…
permissive · top 5,000 on PyPI