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 delete 000001    # 删除股票

# 笔记操作
klnote note add 000001 -s "摘要" -c "内容"   # 添加笔记
klnote note ls 000001       # 列出笔记
klnote note delete 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 delete <identifier>      # 删除股票

输出示例:

 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 delete <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.2.0.tar.gz (12.1 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.2.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for klnote-0.2.0.tar.gz
Algorithm Hash digest
SHA256 31c2c89f6dded9fc390a94b26c44ca2f4ff6f823072955f6d807564bb9ed5965
MD5 5b74564f8eefa0441a43c51c111ae51a
BLAKE2b-256 884d52a5abab3b05b068229dacb65fee8b30bde39aebc68b30d1dd758c5962d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: klnote-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f613e8fab90c0aa81aab19cd2dc2d56cc746a6053b5a763fa4045cebcbe0c2c9
MD5 248fd04809d19d0e4074649413882670
BLAKE2b-256 9cc4b23388d2791ffd5461cb9769cd94cf23b9d2ccacf7e703fe577260276748

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