{"id":18914265,"url":"https://github.com/pytries/dawg-python","last_synced_at":"2025-12-11T21:03:06.588Z","repository":{"id":4743836,"uuid":"5893389","full_name":"pytries/DAWG-Python","owner":"pytries","description":"Pure-python reader for DAWGs created by dawgdic C++ library or DAWG Python extension.","archived":false,"fork":false,"pushed_at":"2023-09-11T12:36:30.000Z","size":4411,"stargazers_count":48,"open_issues_count":4,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T18:51:50.346Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pypi.python.org/pypi/DAWG-Python/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pytries.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-09-20T21:38:25.000Z","updated_at":"2023-08-28T18:40:05.000Z","dependencies_parsed_at":"2024-06-18T20:05:04.378Z","dependency_job_id":"ad2a54d6-792f-4533-8b4d-afdd48b47b9e","html_url":"https://github.com/pytries/DAWG-Python","commit_stats":null,"previous_names":["kmike/dawg-python"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytries%2FDAWG-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytries%2FDAWG-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytries%2FDAWG-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytries%2FDAWG-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pytries","download_url":"https://codeload.github.com/pytries/DAWG-Python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249035419,"owners_count":21202081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T10:10:46.856Z","updated_at":"2025-12-11T21:03:05.105Z","avatar_url":"https://github.com/pytries.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"DAWG-Python\n===========\n\n.. image:: https://travis-ci.org/kmike/DAWG-Python.png?branch=master\n    :target: https://travis-ci.org/kmike/DAWG-Python\n.. image:: https://coveralls.io/repos/kmike/DAWG-Python/badge.png?branch=master\n    :target: https://coveralls.io/r/kmike/DAWG-Python\n\n\nThis pure-python package provides read-only access for files\ncreated by `dawgdic`_ C++ library and `DAWG`_ python package.\n\n.. _dawgdic: https://code.google.com/p/dawgdic/\n.. _DAWG: https://github.com/kmike/DAWG\n\nThis package is not capable of creating DAWGs. It works with DAWGs built by\n`dawgdic`_ C++ library or `DAWG`_ Python extension module. The main purpose\nof DAWG-Python is to provide an access to DAWGs without requiring compiled\nextensions. It is also quite fast under PyPy (see benchmarks).\n\nInstallation\n============\n\npip install DAWG-Python\n\nUsage\n=====\n\nThe aim of DAWG-Python is to be API- and binary-compatible\nwith `DAWG`_ when it is possible.\n\nFirst, you have to create a dawg using DAWG_ module::\n\n    import dawg\n    d = dawg.DAWG(data)\n    d.save('words.dawg')\n\nAnd then this dawg can be loaded without requiring C extensions::\n\n    import dawg_python\n    d = dawg_python.DAWG().load('words.dawg')\n\nPlease consult `DAWG`_ docs for detailed usage. Some features\n(like constructor parameters or ``save`` method) are intentionally\nunsupported.\n\nBenchmarks\n==========\n\nBenchmark results (100k unicode words, integer values (lenghts of the words),\nPyPy 1.9, macbook air i5 1.8 Ghz)::\n\n    dict __getitem__ (hits):        11.090M ops/sec\n    DAWG __getitem__ (hits):        not supported\n    BytesDAWG __getitem__ (hits):   0.493M ops/sec\n    RecordDAWG __getitem__ (hits):  0.376M ops/sec\n\n    dict get() (hits):              10.127M ops/sec\n    DAWG get() (hits):              not supported\n    BytesDAWG get() (hits):         0.481M ops/sec\n    RecordDAWG get() (hits):        0.402M ops/sec\n    dict get() (misses):            14.885M ops/sec\n    DAWG get() (misses):            not supported\n    BytesDAWG get() (misses):       1.259M ops/sec\n    RecordDAWG get() (misses):      1.337M ops/sec\n\n    dict __contains__ (hits):           11.100M ops/sec\n    DAWG __contains__ (hits):           1.317M ops/sec\n    BytesDAWG __contains__ (hits):      1.107M ops/sec\n    RecordDAWG __contains__ (hits):     1.095M ops/sec\n\n    dict __contains__ (misses):         10.567M ops/sec\n    DAWG __contains__ (misses):         1.902M ops/sec\n    BytesDAWG __contains__ (misses):    1.873M ops/sec\n    RecordDAWG __contains__ (misses):   1.862M ops/sec\n\n    dict items():           44.401 ops/sec\n    DAWG items():           not supported\n    BytesDAWG items():      3.226 ops/sec\n    RecordDAWG items():     2.987 ops/sec\n    dict keys():            426.250 ops/sec\n    DAWG keys():            not supported\n    BytesDAWG keys():       6.050 ops/sec\n    RecordDAWG keys():      6.363 ops/sec\n\n    DAWG.prefixes (hits):    0.756M ops/sec\n    DAWG.prefixes (mixed):   1.965M ops/sec\n    DAWG.prefixes (misses):  1.773M ops/sec\n\n    RecordDAWG.keys(prefix=\"xxx\"), avg_len(res)==415:       1.429K ops/sec\n    RecordDAWG.keys(prefix=\"xxxxx\"), avg_len(res)==17:      36.994K ops/sec\n    RecordDAWG.keys(prefix=\"xxxxxxxx\"), avg_len(res)==3:    121.897K ops/sec\n    RecordDAWG.keys(prefix=\"xxxxx..xx\"), avg_len(res)==1.4: 265.015K ops/sec\n    RecordDAWG.keys(prefix=\"xxx\"), NON_EXISTING:            2450.898K ops/sec\n\nUnder CPython expect it to be about 50x slower.\nMemory consumption of DAWG-Python should be the same as of `DAWG`_.\n\n.. _marisa-trie: https://github.com/kmike/marisa-trie\n\nCurrent limitations\n===================\n\n* This package is not capable of creating DAWGs;\n* all the limitations of `DAWG`_ apply.\n\nContributions are welcome!\n\n\nContributing\n============\n\nDevelopment happens at github: https://github.com/kmike/DAWG-Python\nIssue tracker: https://github.com/kmike/DAWG-Python/issues\n\nFeel free to submit ideas, bugs or pull requests.\n\nRunning tests and benchmarks\n----------------------------\n\nMake sure `tox`_ is installed and run\n\n::\n\n    $ tox\n\nfrom the source checkout. Tests should pass under python 2.6, 2.7, 3.2, 3.3,\n3.4 and PyPy \u003e= 1.9.\n\nIn order to run benchmarks, type\n\n::\n\n    $ tox -c bench.ini -e pypy\n\nThis runs benchmarks under PyPy (they are about 50x slower under CPython).\n\n.. _tox: http://tox.testrun.org\n\nAuthors \u0026 Contributors\n----------------------\n\n* Mikhail Korobov \u003ckmike84@gmail.com\u003e\n\nThe algorithms are from `dawgdic`_ C++ library by Susumu Yata \u0026 contributors.\n\nLicense\n=======\n\nThis package is licensed under MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytries%2Fdawg-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpytries%2Fdawg-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytries%2Fdawg-python/lists"}