--- id: dawg2-python version: "0.9.0" license: MIT license_treatment: permissive maintenance: active --- # DAWG2-Python — Pure-python reader for DAWGs (DAFSAs) created by dawgdic C++ library or DAWG Python extension. License: permissive · Maintenance: active · Downloads: 400.6K/mo ## 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 above — 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 pip install dawg2-python uv add dawg2-python poetry add dawg2-python ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 400.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags dawg reader pure python, directed acyclic word graph, trie-like data structure lookup, prefix search dictionary, linguistic data structure, word graph file reader, no-compile dawg access, data-structures, nlp-tools, pure-python [View on SkillFed](https://skillfed.io/packages/dawg2-python) · [View on PyPI](https://pypi.org/project/dawg2-python/)