DAWG-Python
Pure-python reader for DAWGs (DAFSAs) created by dawgdic C++ library or DAWG Python extension.
What it is and what it does
DAWG-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 cannot create DAWGs itself; instead, it reads files built by the dawgdic C++ library or the DAWG Python extension module. The main value proposition is providing DAWG access without requiring compiled extensions, making it portable and fast under PyPy.
The package implements several DAWG variants (DAWG, BytesDAWG, RecordDAWG, IntDAWG, IntCompletionDAWG) and supports operations like membership testing, prefix enumeration, and key/value iteration. It is API-compatible with the DAWG package where possible. Performance under CPython is significantly slower than native implementations, but PyPy execution is competitive for many workloads.
Use it for:
- Load pre-built DAWG files for fast prefix-based lookups in spell-checking or autocomplete systems
- Query large word lists or dictionaries without the overhead of compiled C extensions
- Integrate DAWG-based data structures into pure-Python applications that must run on restricted or portable environments
- Enumerate all words matching a prefix in linguistic or NLP pipelines
- Use PyPy to accelerate DAWG queries in performance-sensitive code paths
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads DAWG (Directed Acyclic Word Graph) files created by the dawgdic C++ library or DAWG Python package, providing pure-Python access without compiled extensions.
Yes, if you have pre-built DAWG files and need pure-Python access without C extensions. No, if you need active maintenance or Python 3.5+ support—the package is dormant and classifiers only declare support through Python 3.4. Suitable for legacy systems or PyPy-based deployments where the DAWG format is already in use.
Install
dawg-python on PyPI
pip
pip install dawg-pythonuv
uv add dawg-pythonpoetry
poetry add dawg-pythonInstalling DAWG-Python
Before you install
No runtime dependencies and low install friction. The package is dormant (last release 2015-04-18, last commit 2023-09-11), so expect no active maintenance or updates for modern Python versions.
License in practice
Licensed under MIT, a permissive open-source license with no restrictions on commercial or private use.
Quickstart
import dawg_python
d = dawg_python.DAWG().load('words.dawg')
if 'hello' in d:
print(d['hello'])
Requires a pre-built DAWG file created by the dawgdic C++ library or DAWG Python package; this package cannot create DAWGs from scratch.
Verify before relying
- Whether the package works reliably with Python versions beyond 3.4 (classifiers list only up to 3.4)
- Current compatibility with modern PyPy versions (benchmarks reference PyPy 1.9 from ~2012)
- Whether DAWG files created by recent versions of the dawgdic library remain compatible
Package facts
| License | UNKNOWN (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 4,136 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 219,943/month — #9,318 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: DAWG_Python-0.7.2-py2.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
DAWG2-PythonRead-only access to DAWG (directed acyclic word…
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
graphttyRenders directed graphs as colored ASCII art in…
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
pytzdataProvides access to the Olson timezone database…
permissive · top 5,000 on PyPI