基于关键词匹配的文档知识库,使用 jieba 分词 + SQLite 倒排索引
Project description
po-docs-db
基于关键词匹配的文档知识库,使用 jieba 分词 + SQLite 倒排索引,提供中文/英文混合的关键词搜索。
安装
pip install po-docs-db
使用
from po_docs_db import PoDocsDB
docs = PoDocsDB(db_path="./data/docs.db", docs_dir="./docs")
# 写入文档
docs.write(
type="前端",
lang="vue",
question="Font Awesome 在 Vue 中如何使用",
doc_name="fontawesome-usage",
content="# Font Awesome\n...",
)
# 查询
result = docs.query(type="前端", lang="vue", query="fontawesome 图标")
for item in result.results:
print(f"{item.doc_path} | 匹配 {item.match_count} 个词: {item.matched_words}")
# 关闭
docs.close()
许可证
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file po_docs_db-0.1.0.tar.gz.
File metadata
- Download URL: po_docs_db-0.1.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6ec1925562caf0568dbffc8d244fb0fe48a09f62d2413047a26ca272907187f
|
|
| MD5 |
b6c4c34d32d0153090eb07f88aa06d0a
|
|
| BLAKE2b-256 |
3509ee198b841f01761a0d3f06fdd01eec927c4b1ed665bb892ccdfef1604871
|
Provenance
The following attestation bundles were made for po_docs_db-0.1.0.tar.gz:
Publisher:
po-docs-release.yml on a327730684/yo-iterative-review
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
po_docs_db-0.1.0.tar.gz -
Subject digest:
a6ec1925562caf0568dbffc8d244fb0fe48a09f62d2413047a26ca272907187f - Sigstore transparency entry: 2158946965
- Sigstore integration time:
-
Permalink:
a327730684/yo-iterative-review@6652cc95f764cb7400aebdb2a01aedfb76a7f41a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/a327730684
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
po-docs-release.yml@6652cc95f764cb7400aebdb2a01aedfb76a7f41a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file po_docs_db-0.1.0-py3-none-any.whl.
File metadata
- Download URL: po_docs_db-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e26b06758364da5d8df99b874ee8ee3c7356c7f21781c828b8ac021e9aa87f1
|
|
| MD5 |
ed19fe1c777f9b08c22f4a89e373eca4
|
|
| BLAKE2b-256 |
121a7f23c07edda963c228b1de7e1b52c9b7ac4dd2c6d54faef77128308d91b0
|
Provenance
The following attestation bundles were made for po_docs_db-0.1.0-py3-none-any.whl:
Publisher:
po-docs-release.yml on a327730684/yo-iterative-review
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
po_docs_db-0.1.0-py3-none-any.whl -
Subject digest:
1e26b06758364da5d8df99b874ee8ee3c7356c7f21781c828b8ac021e9aa87f1 - Sigstore transparency entry: 2158947022
- Sigstore integration time:
-
Permalink:
a327730684/yo-iterative-review@6652cc95f764cb7400aebdb2a01aedfb76a7f41a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/a327730684
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
po-docs-release.yml@6652cc95f764cb7400aebdb2a01aedfb76a7f41a -
Trigger Event:
workflow_dispatch
-
Statement type: