Skip to main content

Stock note management tool

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

klnote-0.3.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

klnote-0.3.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file klnote-0.3.0.tar.gz.

File metadata

  • Download URL: klnote-0.3.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for klnote-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6256d41b6061e382f2c3a6378e5a583c1eced6096900e906177c8b7b79642330
MD5 73ae1d4623dff83e82c45cd4ce837ca2
BLAKE2b-256 172eaa7b49bd69ef78bc0de91d02a017d936630ea84f31b927438b89eae0675f

See more details on using hashes here.

File details

Details for the file klnote-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: klnote-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for klnote-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7d0c4209f7cce6529a30f9b3cae59f2b3c376c8bb84fa5cd133ac0785069aad
MD5 4686fb00109cec4b00c933da2c815530
BLAKE2b-256 79bd207896d4a502c8f7ecf3b8d25a207cc2b21ffed7fa0ca43b7e57eedfb7ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page