Skip to main content

KLNote

股票笔记管理工具,为专注股票投资的人群设计。

背景

投资股票时,每次决策都需要记录:为什么买、为什么卖、当时想到了什么。这些记录是后续复盘的核心素材。但普通笔记软件太通用,无法围绕"股票"这个实体组织信息——查一只股票的笔记,要翻半天。

KLNote 的核心思路是:先有股票,再有笔记。每条笔记属于某只股票,每次查看都围绕股票展开。

核心概念

  • 股票:用 code(代码)或 name(名称)标识,如 000001、平安银行
  • 笔记:附属于某只股票,每条包含 summary(摘要) 和 content(内容)
  • 标识符:支持三种方式定位股票 — UUID、股票代码、股票名称

安装

pip install klnote

使用

# 股票操作
klnote stk ls              # 列出所有股票
klnote stk add 000001 -n 平安银行    # 添加股票
klnote stk get 000001       # 查看股票(支持 id/code/name)
klnote stk del 000001      # 删除股票
klnote stk get-meta 000001  # 查看 metadata
klnote stk set-meta 000001 --name 平安银行 --country CN  # 更新 metadata

# 笔记操作
klnote note add 000001 -s "摘要" -c "内容"   # 添加笔记
klnote note ls 000001       # 列出笔记
klnote note read 000001 0  # 读取第0条笔记
klnote note edit 000001 0 -c "新内容"  # 编辑笔记
klnote note edit 000001 0 -e  # 弹出 GUI 编辑器
klnote note del 000001 0 # 删除第0条笔记

数据库

默认路径: ~/.KLNote/KLNote.db

可通过环境变量 KLNOTE_DB_PATH 自定义路径。

命令指南

全局命令

klnote --help

股票操作 (stk)

klnote stk ls                       # 列出所有股票(表格对齐)
klnote stk add <code> [-n name] [-d desc]   # 添加股票
klnote stk get <identifier>         # 查看股票详情
klnote stk del <identifier>         # 删除股票
klnote stk get-meta <identifier>   # 查看 metadata
klnote stk set-meta <identifier>    # 更新 metadata

输出示例:

 id                                code    name      description  note_num  created_at                   updated_at 
 38578199c19644ebab18ce7b5c16d699  688102  斯瑞新财   None         1         2026-06-04T15:52:20.853674Z  None 

笔记操作 (note)

klnote note add <stock_identifier> [-s 摘要] [-c 内容]   # 添加笔记
klnote note ls <stock_identifier>     # 列出某只股票的所有笔记
klnote note read <stock_identifier> <index>   # 读取单条笔记
klnote note edit <stock_identifier> <index> [-c 内容] [-s 摘要] [-e]  # 编辑笔记
klnote note del <stock_identifier> <index>   # 删除指定笔记

高级操作 (admin)

klnote admin match_and_read <value> <field>    # 按字段匹配读取
klnote admin match_and_update <value> <field> <update_field>   # 按字段匹配更新(危险)

标识符说明

所有 <identifier> 位置均支持三种写法:

格式 示例 解析方式
UUID (32位十六进制) a1b2c3d4e5f6... 精确匹配 id
纯数字 000001 匹配 code
字母/中文混合 平安银行 先试 code,再试 name

环境变量

变量 说明 默认值
KLNOTE_DB_PATH 数据库文件路径 ~/.KLNote/KLNote.db

Metadata

Release files for klnote 0.3.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 klnote 0.3.0
File Size Uploaded Provenance Actions
klnote-0.3.0.tar.gz 13.3 kB Without provenance Details for klnote-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for klnote 0.3.0
File Interpreter ABI Platform Actions
klnote-0.3.0-py3-none-any.whl Python 3 none any Details for klnote-0.3.0-py3-none-any.whl

Total release size: 26.8 kB

Release files / klnote-0.3.0.tar.gz

Download URL klnote-0.3.0.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6256d41b6061e382f2c3a6378e5a583c1eced6096900e906177c8b7b79642330
BLAKE2b-256 checksum
How to use checksums
172eaa7b49bd69ef78bc0de91d02a017d936630ea84f31b927438b89eae0675f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Release files / klnote-0.3.0-py3-none-any.whl

Download URL klnote-0.3.0-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7d0c4209f7cce6529a30f9b3cae59f2b3c376c8bb84fa5cd133ac0785069aad
BLAKE2b-256 checksum
How to use checksums
79bd207896d4a502c8f7ecf3b8d25a207cc2b21ffed7fa0ca43b7e57eedfb7ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Security for klnote 0.3.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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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