Name | mdict-rs JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | Python bindings for mdict-rs: A fast MDict dictionary format parser |
upload_time | 2025-08-10 07:22:58 |
maintainer | None |
docs_url | None |
author | zhimoe |
requires_python | >=3.8 |
license | MIT |
keywords |
mdict
dictionary
parser
rust
pyo3
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# mdict-rs
This project provides **Python bindings** via PyO3, allowing you to use the fast Rust MDict parser from Python
code.
#### How to build
```bash
# Install maturin for building Python extensions
python3 -m venv .venv && source .venv/bin/activate && pip install maturin
# Build and install the Python package
maturin develop --release
```
#### Usage
```python
import mdict_rs
# Parse from file
mdx = mdict_rs.parse_mdx_file("dictionary.mdx")
# Parse from bytes
with open("dictionary.mdx", "rb") as f:
data = f.read()
mdx = mdict_rs.parse_mdx_bytes(data)
# Get all entries
records = mdx.items()
for record in records:
print(f"{record.text}: {record.definition}")
# Get total count
count = mdx.get_entries_count()
print(f"Total entries: {count}")
```
#### Building for PyPI
```bash
# Build wheels for distribution
maturin build --release
# Publish to PyPI (requires API token)
maturin publish
```
## Screenshot

## References
MDX的解析功能和mdx文件规范参考[mdict-analysis](https://bitbucket.org/xwang/mdict-analysis/src/master/)
和文章[MDX/MDD 文件格式解析](http://einverne.github.io/post/2018/08/mdx-mdd-file-format.html)
Raw data
{
"_id": null,
"home_page": null,
"name": "mdict-rs",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "mdict, dictionary, parser, rust, pyo3",
"author": "zhimoe",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/0f/75/81ad467c52ce66a48441ead7c9add654721cf97586440866309a2c68e28b/mdict_rs-0.1.0.tar.gz",
"platform": null,
"description": "# mdict-rs\n\nThis project provides **Python bindings** via PyO3, allowing you to use the fast Rust MDict parser from Python\ncode.\n\n#### How to build\n\n```bash\n# Install maturin for building Python extensions\npython3 -m venv .venv && source .venv/bin/activate && pip install maturin\n\n# Build and install the Python package\nmaturin develop --release\n```\n\n#### Usage\n\n```python\nimport mdict_rs\n\n# Parse from file\nmdx = mdict_rs.parse_mdx_file(\"dictionary.mdx\")\n\n# Parse from bytes\nwith open(\"dictionary.mdx\", \"rb\") as f:\n data = f.read()\nmdx = mdict_rs.parse_mdx_bytes(data)\n\n# Get all entries\nrecords = mdx.items()\nfor record in records:\n print(f\"{record.text}: {record.definition}\")\n\n# Get total count\ncount = mdx.get_entries_count()\nprint(f\"Total entries: {count}\")\n```\n\n#### Building for PyPI\n\n```bash\n# Build wheels for distribution\nmaturin build --release\n\n# Publish to PyPI (requires API token)\nmaturin publish\n```\n\n## Screenshot\n\n\n\n## References\nMDX\u7684\u89e3\u6790\u529f\u80fd\u548cmdx\u6587\u4ef6\u89c4\u8303\u53c2\u8003[mdict-analysis](https://bitbucket.org/xwang/mdict-analysis/src/master/)\n\u548c\u6587\u7ae0[MDX/MDD \u6587\u4ef6\u683c\u5f0f\u89e3\u6790](http://einverne.github.io/post/2018/08/mdx-mdd-file-format.html)\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python bindings for mdict-rs: A fast MDict dictionary format parser",
"version": "0.1.0",
"project_urls": {
"Repository": "https://github.com/zhimoe/mdict-rs-py"
},
"split_keywords": [
"mdict",
" dictionary",
" parser",
" rust",
" pyo3"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1dfa441d6a754247f174375a4728b04835f7ec1b42763479fc8f9e175654844e",
"md5": "f7bbdf5d47fab92674fcff3ebfb1db4e",
"sha256": "168af179818ee3033c3da6086e2fe18bb2e10587fd99fc958c72ac1864b59d2f"
},
"downloads": -1,
"filename": "mdict_rs-0.1.0-cp313-cp313-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "f7bbdf5d47fab92674fcff3ebfb1db4e",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.8",
"size": 1074603,
"upload_time": "2025-08-10T07:22:52",
"upload_time_iso_8601": "2025-08-10T07:22:52.596556Z",
"url": "https://files.pythonhosted.org/packages/1d/fa/441d6a754247f174375a4728b04835f7ec1b42763479fc8f9e175654844e/mdict_rs-0.1.0-cp313-cp313-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0f7581ad467c52ce66a48441ead7c9add654721cf97586440866309a2c68e28b",
"md5": "0f6558d7d8824e8c971cb8a31c6d2461",
"sha256": "4af852317da67b220bd7c22d964c9f56599938cabcef75b9d5d22d58dabf3f77"
},
"downloads": -1,
"filename": "mdict_rs-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "0f6558d7d8824e8c971cb8a31c6d2461",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 13706664,
"upload_time": "2025-08-10T07:22:58",
"upload_time_iso_8601": "2025-08-10T07:22:58.463275Z",
"url": "https://files.pythonhosted.org/packages/0f/75/81ad467c52ce66a48441ead7c9add654721cf97586440866309a2c68e28b/mdict_rs-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-10 07:22:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zhimoe",
"github_project": "mdict-rs-py",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "mdict-rs"
}