skillfed

DAWG-Python

Pure-python reader for DAWGs (DAFSAs) created by dawgdic C++ library or DAWG Python extension.

dawg-python v0.7.2 219.9K downloads/30d#9,318 on PyPI50
Permissive license UNKNOWN DORMANT released

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-python

uv

uv add dawg-python

poetry

poetry add dawg-python

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Scientific/Engineering :: Information AnalysisTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: Linguistic

Tags

DAWG file readerdirected acyclic word graphpure python DAWGDAFSA lookuptrie-like data structureprefix searchword graph access
data-structuretext-processingpypy-friendly

More Python Modules packages