Skip to main content

bd-wubi Python SDK

bd-wubi Python SDK 内置五笔数据集,提供线程安全的正向(文本 → 编码)、反向(编码 → 文本)以及长词猜码功能,接口设计与 .NET 版本保持一致。

安装与使用

pip install bd-wubi
import bd_wubi

bd_wubi.initialize()  # 可省略;首次调用其他函数会自动初始化

entries = bd_wubi.get_by_text("信息")
codes = bd_wubi.get_by_code("nt")
guess = bd_wubi.guess_code("发展趋势")

initialize 可接受 WubiDictionaryOptions,用于配置缓存大小、是否缓存猜码结果、或指定自定义数据集路径。

运行单元测试

pip install -e .[test]
pytest

运行基准测试

python benchmarks/benchmark_wubi.py

Metadata

Release files for bd-wubi 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bd-wubi 0.1.0
File Size Uploaded Provenance
bd_wubi-0.1.0.tar.gz 1.3 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bd-wubi 0.1.0
File Interpreter ABI Platform
bd_wubi-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.8 MB

Release files / bd_wubi-0.1.0.tar.gz

Download URL bd_wubi-0.1.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
e98bc21b672de2d96750ce1db8f7135c0c25ee9a6e203f03022fb5742dfbfea7
BLAKE2b-256 checksum
How to use checksums
50a36dffd36b26a67c9400b7e9a34a64ad3ce945877925c4d9a91e6c51dedf9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / bd_wubi-0.1.0-py3-none-any.whl

Download URL bd_wubi-0.1.0-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8ea29eeab39812fe279b5d30c34ae623413e83508433903080be6ced75449207
BLAKE2b-256 checksum
How to use checksums
2bfbb26b6bce6a581f16aa78082500f2835d03541de9cfb139df6a5f129edb07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for bd-wubi 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page