No description
Find a file
Lumorian 0c89f34db3 Merge origin/master into refactored master
The upstream repeat_type work (weekly/monthly repeats, legacy yearly
migration, wider input box) is already integrated and covered by
tests/, so the merge resolves to the refactored implementation.
Upstream test_daysmatter.py targeted the pre-refactor API; its cases
were ported into tests/test_models.py and tests/test_storage.py.
2026-10-09 02:24:03 +08:00
docs/superpowers fix: harden storage/i18n and close review test gaps 2026-10-09 02:14:39 +08:00
tests feat: support weekly/monthly repeat (repeat_type) in refactor 2026-10-09 02:22:56 +08:00
.gitignore refactor: restructure into layered modules and add test suite 2026-10-09 02:01:46 +08:00
daysmatter.py feat: support weekly/monthly repeat (repeat_type) in refactor 2026-10-09 02:22:56 +08:00
LICENSE LICENSE 2026-04-01 19:03:31 +08:00
pyproject.toml refactor: restructure into layered modules and add test suite 2026-10-09 02:01:46 +08:00
README.md refactor: restructure into layered modules and add test suite 2026-10-09 02:01:46 +08:00
screenshot_1.png ss_1 2026-04-01 20:05:27 +08:00
screenshot_2.png ss_2 2026-04-01 20:06:05 +08:00

daysmatter

终端交互式纪念日倒计时工具 | 纯 Python 实现的轻量 CUI 倒计时管理器


项目简介

本项目所有代码均为 AI 生成

daysmatter 是一款纯 Python 编写、基于 curses 的交互式终端倒计时工具,无需图形界面,即可在终端中优雅管理生日、纪念日、节日等重要日期。 工具自动计算倒计时/已过天数,支持年度重复事件、彩色高亮、可视化进度条、全屏展示模式,完美适配中文宽字符,数据本地存储无联网,轻量开箱即用。

核心特性

  • 交互式终端 UI:基于 curses 实现图形化操作,上下键选择,操作极简
  • 全屏展示模式:支持常驻终端/桌面展示
  • 中文完美适配:自动计算宽字符宽度,无排版错乱
  • 本地安全存储:数据保存在本地 JSON 文件,无隐私泄露
  • 零第三方依赖:仅使用 Python 标准库,全平台兼容
  • 完整测试:纯 unittest 测试套件,覆盖数据、布局与渲染

界面预览

main full

环境要求

  • Python 3.7 及以上版本(使用了 dataclasses)
  • 系统自带 curses 库(GNU/Linux 默认包含)

快速使用

方式一:单文件直接运行(推荐)

wget https://codeberg.org/Lumorian/daysmatter/raw/branch/main/daysmatter.py
python3 daysmatter.py

方式二:作为包安装

pip install .
daysmatter          # 或 python3 -m daysmatter

全屏展示模式

适合终端常驻、桌面展示:

python3 daysmatter.py -F
# 或
daysmatter --fullscreen

快捷键说明

主界面

  • ↑ / ↓:选择事件
  • A:添加新事件
  • E:编辑选中事件
  • D:删除选中事件
  • F:切换到全屏展示模式
  • L:切换中英文语言
  • Q:退出程序

全屏展示模式

  • Q:返回主界面/退出

数据存储

所有事件数据本地存储,无任何网络请求:

  • 存储路径:~/.config/daysmatter/events.json
  • 设置路径:~/.config/daysmatter/settings.json
  • 可通过环境变量 DAYSMATTER_CONFIG_DIR 覆盖配置目录

事件文件损坏时会自动备份为 events.json.bak;单个条目损坏时会被跳过,不影响其余数据。

开发

运行测试

python3 -m unittest discover -s tests -v

项目结构

daysmatter.py     # 单文件应用(CLI + 数据模型 + curses 界面)
tests/            # unittest 测试套件
  test_models.py      # 日期计算与序列化
  test_display.py     # 宽度、进度条、颜色
  test_i18n.py        # 多语言
  test_storage.py     # 读写与容错
  test_layout.py      # 行格式化与排序
  test_screens.py     # 渲染布局(伪 curses 屏幕)
pyproject.toml    # 打包与命令行入口

支持平台

  • GNU/Linux

许可协议

本项目基于 GPL-3.0-or-later 许可发布。