git-stats-tui 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- git_stats_tui-0.1.0.dist-info/METADATA +227 -0
- git_stats_tui-0.1.0.dist-info/RECORD +14 -0
- git_stats_tui-0.1.0.dist-info/WHEEL +5 -0
- git_stats_tui-0.1.0.dist-info/entry_points.txt +3 -0
- git_stats_tui-0.1.0.dist-info/licenses/LICENSE +21 -0
- git_stats_tui-0.1.0.dist-info/top_level.txt +1 -0
- src/__init__.py +2 -0
- src/app.py +480 -0
- src/git_reader.py +238 -0
- src/gui_launcher.py +189 -0
- src/widgets/__init__.py +1 -0
- src/widgets/heatmap.py +156 -0
- src/widgets/languages.py +105 -0
- src/widgets/timeline.py +160 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: git-stats-tui
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Beautiful terminal UI for local git statistics - contribution heatmap, language breakdown, commit patterns
|
|
5
|
+
Author: shadapang
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/shadapang/git-stats-tui
|
|
8
|
+
Project-URL: Repository, https://github.com/shadapang/git-stats-tui
|
|
9
|
+
Project-URL: Issues, https://github.com/shadapang/git-stats-tui/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/shadapang/git-stats-tui/releases
|
|
11
|
+
Keywords: git,statistics,tui,terminal,contribution,heatmap,visualization,developer-tools
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
21
|
+
Classifier: Topic :: Utilities
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: textual>=3.0
|
|
26
|
+
Requires-Dist: rich>=13.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest; extra == "dev"
|
|
29
|
+
Requires-Dist: ruff; extra == "dev"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# git-stats-tui
|
|
33
|
+
|
|
34
|
+
> Beautiful terminal UI for local git statistics — contribution heatmap, language breakdown, commit patterns
|
|
35
|
+
|
|
36
|
+

|
|
37
|
+

|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
> **About the author**: I'm not a professional programmer — just someone who loves building useful tools with the help of AI (Vibe Coding). This project was created entirely through AI-assisted development. If you're also a beginner curious about coding, this repo is proof that you can ship real software too!
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- **Contribution Heatmap** — GitHub-style 52-week heatmap, right in your terminal
|
|
47
|
+
- **Language Breakdown** — file count by language with colored bar chart
|
|
48
|
+
- **Commit Timeline** — commit patterns by hour of day and day of week
|
|
49
|
+
- **Top Contributors** — author breakdown with share percentages
|
|
50
|
+
- **Recent Commits** — scrollable commit list with insertions/deletions
|
|
51
|
+
- **Overview Dashboard** — all key stats at a glance
|
|
52
|
+
- **Date Range Filter** — press `d` to filter stats to a date range
|
|
53
|
+
- **Repo Switcher** — press `s` to switch to another repo without restarting
|
|
54
|
+
- **Keyboard Navigation** — tab between views, `r` to refresh, `q` to quit
|
|
55
|
+
- **Zero API Calls** — pure local `.git` parsing, works offline, works with any git host
|
|
56
|
+
|
|
57
|
+
## Quick Start
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Install
|
|
61
|
+
pip install git-stats-tui
|
|
62
|
+
|
|
63
|
+
# Run in any git repo
|
|
64
|
+
cd your-project
|
|
65
|
+
git-stats
|
|
66
|
+
|
|
67
|
+
# Or point to a specific repo
|
|
68
|
+
git-stats /path/to/repo
|
|
69
|
+
|
|
70
|
+
# Find all git repos under a directory
|
|
71
|
+
git-stats --find ~/projects
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Screenshots
|
|
75
|
+
|
|
76
|
+

|
|
77
|
+
|
|
78
|
+
## Key Bindings
|
|
79
|
+
|
|
80
|
+
| Key | Action |
|
|
81
|
+
|-----|--------|
|
|
82
|
+
| `Tab` / `Shift+Tab` | Switch between tabs |
|
|
83
|
+
| `r` | Refresh stats |
|
|
84
|
+
| `f` | Find repos under current directory |
|
|
85
|
+
| `d` | Toggle date range filter (e.g. `2025-01-01 ~ 2025-12-31`) |
|
|
86
|
+
| `s` | Switch to another repo (path or `#N` for discovered repo) |
|
|
87
|
+
| `q` | Quit |
|
|
88
|
+
|
|
89
|
+
## Tabs
|
|
90
|
+
|
|
91
|
+
| Tab | Content |
|
|
92
|
+
|-----|---------|
|
|
93
|
+
| **Heatmap** | 52-week contribution graph + current streak |
|
|
94
|
+
| **Languages** | File count by language with bar chart |
|
|
95
|
+
| **Timeline** | Commits by hour, by weekday, top authors |
|
|
96
|
+
| **Commits** | Recent commits with date, author, message, +/- lines |
|
|
97
|
+
| **Overview** | Summary: total commits, authors, branches, peak hour, weekend ratio |
|
|
98
|
+
|
|
99
|
+
## How It Works
|
|
100
|
+
|
|
101
|
+
1. Reads `git log` with `--numstat` for commit history + file changes
|
|
102
|
+
2. Reads `git ls-files` for language breakdown by file extension
|
|
103
|
+
3. Aggregates into daily/hourly/weekly/author buckets
|
|
104
|
+
4. Renders with [Textual](https://textual.textualize.io/) TUI + [Rich](https://rich.readthedocs.io/)
|
|
105
|
+
|
|
106
|
+
No external API, no network, no token — pure local git.
|
|
107
|
+
|
|
108
|
+
## Development
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Clone
|
|
112
|
+
git clone https://github.com/shadapang/git-stats-tui.git
|
|
113
|
+
cd git-stats-tui
|
|
114
|
+
|
|
115
|
+
# Install dev dependencies
|
|
116
|
+
pip install -e ".[dev]"
|
|
117
|
+
|
|
118
|
+
# Run
|
|
119
|
+
python -m src.app
|
|
120
|
+
|
|
121
|
+
# Lint
|
|
122
|
+
ruff check src/
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## License
|
|
126
|
+
|
|
127
|
+
MIT
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
# git-stats-tui (中文说明)
|
|
132
|
+
|
|
133
|
+
> 在终端里看你的 Git 统计数据 —— 贡献热力图、语言占比、提交规律,一个命令搞定
|
|
134
|
+
|
|
135
|
+
> **关于作者**:我不是专业程序员,只是一个喜欢用 AI 辅助做工具的爱好者(Vibe Coding)。这个项目完全由 AI 辅助开发完成。如果你也是编程小白,这个仓库就是证明——你也能做出真正能用的软件!
|
|
136
|
+
|
|
137
|
+
## 功能一览
|
|
138
|
+
|
|
139
|
+
- **贡献热力图** —— 和 GitHub 一样的 52 周热力图,直接在终端里显示
|
|
140
|
+
- **语言占比** —— 按文件类型统计,彩色柱状图展示
|
|
141
|
+
- **提交时间线** —— 按小时、按星期几统计提交规律
|
|
142
|
+
- **贡献者排行** —— 谁提交最多,占比多少
|
|
143
|
+
- **最近提交** —— 可滚动的提交列表,显示增删行数
|
|
144
|
+
- **总览仪表盘** —— 所有关键数据一目了然
|
|
145
|
+
- **日期范围筛选** —— 按 `d` 键输入日期范围,只看某段时间的统计
|
|
146
|
+
- **仓库切换** —— 按 `s` 键切换到另一个仓库,不用退出重启
|
|
147
|
+
- **键盘操作** —— Tab 切换页面,`r` 刷新,`q` 退出
|
|
148
|
+
- **纯本地运行** —— 不调任何 API,不联网,不传数据,只读你本地的 `.git` 目录
|
|
149
|
+
|
|
150
|
+
## 快速上手
|
|
151
|
+
|
|
152
|
+
### 前提条件
|
|
153
|
+
|
|
154
|
+
- Python 3.10 或以上
|
|
155
|
+
- 你的项目已经用 git 管理(有 `.git` 目录)
|
|
156
|
+
|
|
157
|
+
### 安装和运行
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# 安装
|
|
161
|
+
pip install git-stats-tui
|
|
162
|
+
|
|
163
|
+
# 在任意 git 仓库中运行
|
|
164
|
+
cd your-project
|
|
165
|
+
git-stats
|
|
166
|
+
|
|
167
|
+
# 或指定仓库路径
|
|
168
|
+
git-stats /path/to/your/project
|
|
169
|
+
|
|
170
|
+
# 查找某个目录下所有 git 仓库
|
|
171
|
+
git-stats --find ~/projects
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
<details>
|
|
175
|
+
<summary>没有 pip?用源码安装</summary>
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
git clone https://github.com/shadapang/git-stats-tui.git
|
|
179
|
+
cd git-stats-tui
|
|
180
|
+
pip install -e .
|
|
181
|
+
python -m src.app
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
</details>
|
|
185
|
+
|
|
186
|
+
## 键盘快捷键
|
|
187
|
+
|
|
188
|
+
| 按键 | 功能 |
|
|
189
|
+
|------|------|
|
|
190
|
+
| `Tab` / `Shift+Tab` | 切换页面 |
|
|
191
|
+
| `r` | 刷新数据 |
|
|
192
|
+
| `f` | 查找当前目录下的 git 仓库 |
|
|
193
|
+
| `d` | 日期范围筛选(输入如 `2025-01-01 ~ 2025-12-31`) |
|
|
194
|
+
| `s` | 切换到其他仓库(输入路径或 `#1` 选已发现的仓库) |
|
|
195
|
+
| `q` | 退出 |
|
|
196
|
+
|
|
197
|
+
## 页面说明
|
|
198
|
+
|
|
199
|
+
| 页面 | 内容 |
|
|
200
|
+
|------|------|
|
|
201
|
+
| **Heatmap(热力图)** | 52 周贡献图 + 当前连续提交天数 |
|
|
202
|
+
| **Languages(语言)** | 按文件类型统计,柱状图展示 |
|
|
203
|
+
| **Timeline(时间线)** | 按小时、按星期几的提交分布 + 贡献者排行 |
|
|
204
|
+
| **Commits(提交记录)** | 最近的提交列表,含日期、作者、增删行数 |
|
|
205
|
+
| **Overview(总览)** | 汇总:总提交数、作者数、分支数、高峰时段、周末/工作日比 |
|
|
206
|
+
|
|
207
|
+
## 工作原理
|
|
208
|
+
|
|
209
|
+
1. 读取 `git log` 获取提交历史和文件变更
|
|
210
|
+
2. 读取 `git ls-files` 获取文件列表,按扩展名识别语言
|
|
211
|
+
3. 按日/时/周/作者聚合统计
|
|
212
|
+
4. 用 [Textual](https://textual.textualize.io/) 渲染终端界面,[Rich](https://rich.readthedocs.io/) 渲染图表
|
|
213
|
+
|
|
214
|
+
**全程不联网、不调 API、不需要 Token** —— 只读你本地的 git 数据。
|
|
215
|
+
|
|
216
|
+
## 给编程小白的说明
|
|
217
|
+
|
|
218
|
+
如果你和我一样不是专业程序员,这里是一些可能有用的提示:
|
|
219
|
+
|
|
220
|
+
1. **什么是终端/TUI?** 就是那个黑底白字的命令行窗口。TUI = Text User Interface,在终端里画的界面。
|
|
221
|
+
2. **什么是 git?** 一个代码版本管理工具。如果你在 GitHub 上有项目,你本地就有 `.git` 目录,这个工具就能读它。
|
|
222
|
+
3. **怎么运行?** 打开终端(Windows 按 Win+R 输入 cmd),按上面的"快速上手"步骤操作就行。
|
|
223
|
+
4. **出错了怎么办?** 确保你在 git 仓库目录下运行,或者用 `python -m src.app /你的项目路径` 指定路径。
|
|
224
|
+
|
|
225
|
+
## 许可证
|
|
226
|
+
|
|
227
|
+
MIT(随便用,随便改,注明出处就行)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
git_stats_tui-0.1.0.dist-info/licenses/LICENSE,sha256=Dw8aQZr52ApI1ihoGNCj_uKHZxfOb3lBnk5i-0oMYlY,1090
|
|
2
|
+
src/__init__.py,sha256=WZA6Cg-JF4vy7Z99zn5gj2aN0OFraMH0GfCiHQTu2yc,93
|
|
3
|
+
src/app.py,sha256=73Mzs3AMew2rtOMyjEpgxs_kDtJliS5pRIJZACGGtls,18929
|
|
4
|
+
src/git_reader.py,sha256=QcZF1DWFma-FCJwtZS1xN58Ta_fH8_Cu2gBKjWJkoAU,7666
|
|
5
|
+
src/gui_launcher.py,sha256=ozrLyixSeq0eD3rxqv2ZIy3TJ9w7PoapmMEQBksIvec,5491
|
|
6
|
+
src/widgets/__init__.py,sha256=3kJhRU2-MDgblltB0sLYzegLwrZJYH-eP-vK-9TCFPw,24
|
|
7
|
+
src/widgets/heatmap.py,sha256=F-2Z7Fct73TD2usWnmeRNaQU-yWJnWunLnuLwt-JcbA,4955
|
|
8
|
+
src/widgets/languages.py,sha256=JNFewjie3V7M8wdp7UHJjCyVPH0YhLxQqk8jvr2kjW8,3160
|
|
9
|
+
src/widgets/timeline.py,sha256=VoBYLbxf4iYmv5sDOyhTg7VT9BKhjs15-eh9oEwXA7Q,5265
|
|
10
|
+
git_stats_tui-0.1.0.dist-info/METADATA,sha256=S7wUDH1jHI6AkCc7TZPZoLSTkw4GtAnWCsV6oHFwVEs,8250
|
|
11
|
+
git_stats_tui-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
12
|
+
git_stats_tui-0.1.0.dist-info/entry_points.txt,sha256=e77w38EB8jWWEUuNMuGkvi5HVryaxFUZ9_0oo6n-3Qw,85
|
|
13
|
+
git_stats_tui-0.1.0.dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4
|
|
14
|
+
git_stats_tui-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dev Engineer
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
src
|
src/__init__.py
ADDED