中国知网搜索与引文处理系统
Project description
CNKS - 中国知网搜索与引文处理系统
简介
CNKS是一个用于搜索中国知网并提取引文数据的工具。该系统能够自动化搜索过程,提取文献信息,并以结构化的方式返回结果。
系统架构
CNKS采用服务器-客户端架构,包含以下主要组件:
-
服务器 (Server):
- 处理来自客户端的请求
- 按需调用Worker API处理关键词搜索
- 管理搜索结果缓存
-
工作模块 (Worker):
- 提供搜索和数据提取API
- 使用Playwright自动浏览网页
- 解析和提取引文数据
- 不再作为独立进程运行,而是由服务器直接调用
-
客户端 (Client):
- 命令行界面,用于发送搜索请求
- 接收并显示搜索结果
-
引文处理器 (Citzer):
- 解析和格式化引文数据
- 支持多种引文格式
安装
要求
- Python 3.12 或更高版本
- Playwright
- MCP
安装步骤
-
克隆仓库:
git clone https://github.com/your-username/cnks.git cd cnks -
安装依赖:
pip install -e . playwright install
使用方法
启动服务器
cnks
或
cnks-server
使用客户端发送请求
cnks-client "搜索关键词"
选项:
--timeout SECONDS: 设置响应超时时间(默认为60秒)
直接测试Worker模块 (仅用于调试)
cnks-worker-test "搜索关键词"
配置
系统可通过以下环境变量进行配置:
CACHE_FILE: 缓存文件路径,默认为 "cache.json"SEARCH_URL: 搜索URL,默认为中国知网搜索页面
可以创建.env文件设置这些环境变量。
许可证
[项目许可证信息]
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
cnks-0.3.1.tar.gz
(54.1 kB
view details)
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
cnks-0.3.1-py3-none-any.whl
(47.7 kB
view details)
File details
Details for the file cnks-0.3.1.tar.gz.
File metadata
- Download URL: cnks-0.3.1.tar.gz
- Upload date:
- Size: 54.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84aa0188905a0a1f4436cefa906e9cb86c3b6bb1dcbb58de2bb05d2cd594aa4d
|
|
| MD5 |
b5aa0c6780d14e832fcd378f11b58f3f
|
|
| BLAKE2b-256 |
736516356305db8f877baa907a57fb658f409ecd8c01145df73f47dc31279d1c
|
File details
Details for the file cnks-0.3.1-py3-none-any.whl.
File metadata
- Download URL: cnks-0.3.1-py3-none-any.whl
- Upload date:
- Size: 47.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53337b694df99b327be41b7093c825da0ead07e94e1812114b5adf03b3a46572
|
|
| MD5 |
7888db3fb2505ebca6ed7d8a1e9d802e
|
|
| BLAKE2b-256 |
27c3db1826820d6b4253cd28ea9054334972b34b2696e7fc89bcae828f0bd2f3
|