better-git-of-theseus 0.4.0__py3-none-any.whl → 0.4.2__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.
@@ -0,0 +1,96 @@
1
+ Metadata-Version: 2.4
2
+ Name: better-git-of-theseus
3
+ Version: 0.4.2
4
+ Summary: Plot stats on Git repositories with interactive Plotly charts
5
+ Home-page: https://github.com/onewesong/better-git-of-theseus
6
+ Author: Erik Bernhardsson
7
+ Author-email: mail@erikbern.com
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: gitpython
11
+ Requires-Dist: numpy
12
+ Requires-Dist: tqdm
13
+ Requires-Dist: wcmatch
14
+ Requires-Dist: pygments
15
+ Requires-Dist: plotly
16
+ Requires-Dist: streamlit
17
+ Requires-Dist: python-dateutil
18
+ Requires-Dist: scipy
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: description
22
+ Dynamic: description-content-type
23
+ Dynamic: home-page
24
+ Dynamic: license-file
25
+ Dynamic: requires-dist
26
+ Dynamic: summary
27
+
28
+ <div align="center">
29
+
30
+ # Better Git of Theseus
31
+
32
+ [![pypi badge](https://img.shields.io/pypi/v/better-git-of-theseus.svg?style=flat)](https://pypi.python.org/pypi/better-git-of-theseus)
33
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/better-git-of-theseus)](https://pypi.org/project/better-git-of-theseus/)
34
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/better-git-of-theseus)](https://pypi.org/project/better-git-of-theseus/)
35
+ [![GitHub License](https://img.shields.io/github/license/onewesong/better-git-of-theseus)](https://github.com/onewesong/better-git-of-theseus/blob/master/LICENSE)
36
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/onewesong/better-git-of-theseus)
37
+
38
+ [中文版](README_zh.md)
39
+
40
+ </div>
41
+
42
+ **Better Git of Theseus** is a modern refactor of the original [git-of-theseus](https://github.com/erikbern/git-of-theseus). It provides a fully interactive Web Dashboard powered by **Streamlit** and **Plotly**, making it easier than ever to visualize how your code evolves over time.
43
+
44
+ ![Git of Theseus Dashboard](https://raw.githubusercontent.com/erikbern/git-of-theseus/master/pics/git-git.png) *(Note: Charts are now fully interactive!)*
45
+
46
+ ## Key Enhancements
47
+
48
+ - 🚀 **One-Click Visualization**: New `better-git-of-theseus` command automatically scans your project and launches a Web UI.
49
+ - 📊 **Interactive Charts**: Replaced static Matplotlib plots with Plotly. Support for zooming, panning, and detailed data hovers.
50
+ - 🧠 **In-Memory Processing**: Data flows directly in memory. No more mandatory intermediate `.json` files cluttering your repo.
51
+ - ⚡ **Smart Caching**: Leverages Streamlit's caching to make repeat analysis of large repos nearly instantaneous.
52
+ - 🎨 **Modern UI**: Adjust parameters (Cohort format, ignore rules, normalization, etc.) in real-time via the sidebar.
53
+
54
+ ## Installation
55
+
56
+ Install via pip:
57
+
58
+ ```bash
59
+ pip install better-git-of-theseus
60
+ ```
61
+
62
+ ## Quick Start
63
+
64
+ Run the following in any Git repository:
65
+
66
+ ```bash
67
+ better-git-of-theseus
68
+ ```
69
+
70
+ It will automatically open your browser to the interactive dashboard.
71
+
72
+ ## Feature Highlights
73
+
74
+ ### Cohort Formatting
75
+
76
+ Customize how commits are grouped by year, month, or week (based on Python strftime):
77
+ - `%Y`: Group by **Year** (Default)
78
+ - `%Y-%m`: Group by **Month**
79
+ - `%Y-W%W`: Group by **Week**
80
+
81
+ ### Real-time Parameters
82
+
83
+ Adjust parameters like "Max Series", "Normalization", and "Exponential Fit" directly in the Web UI without re-running any commands.
84
+
85
+ ## FAQ
86
+
87
+ - **Duplicate Authors?** Configure a [.mailmap](https://git-scm.com/docs/gitmailmap) file in your repo root to merge identities.
88
+ - **Performance?** First-time analysis of very large repos (like the Linux Kernel) may take time, but subsequent views are extremely fast due to caching.
89
+
90
+ ## Credits
91
+
92
+ Special thanks to [Erik Bernhardsson](https://github.com/erikbern) for creating the original `git-of-theseus`.
93
+
94
+ ## License
95
+
96
+ MIT
@@ -1,15 +1,15 @@
1
- better_git_of_theseus-0.4.0.dist-info/licenses/LICENSE,sha256=yNNDAWUe1WLKnuUcRp9X95C-yP2lfGl69m97Ftw-DUw,11345
1
+ better_git_of_theseus-0.4.2.dist-info/licenses/LICENSE,sha256=yNNDAWUe1WLKnuUcRp9X95C-yP2lfGl69m97Ftw-DUw,11345
2
2
  git_of_theseus/__init__.py,sha256=LeG5tCOgvZMmKOjmO_HRg54sWF2K3-lTBf8H_vHMFio,273
3
3
  git_of_theseus/analyze.py,sha256=78E1G2FdSS9VZd0jKSnO5gpXwzNCjtzkSAxSzadYM3A,21547
4
- git_of_theseus/app.py,sha256=qbEV6RHIVkAjzlZijjOpxlLalyv0_Ub5Dh8KIZMtshM,5219
4
+ git_of_theseus/app.py,sha256=8aS72pMg4CyEqdYhcsz1QZSxYw8wh_iQLvb-2LOK25A,5192
5
5
  git_of_theseus/cmd.py,sha256=4W8C0tb-9Uejq4WRjGyYKXmZgE4HQBk7KFIKrozY4Og,639
6
6
  git_of_theseus/line_plot.py,sha256=LegoVy0VEFT4sM5fYCES-I_2H9UaerCopDI3J2dyHeU,3117
7
7
  git_of_theseus/plotly_plots.py,sha256=c_9rJo3qlOy-TdHPsvuDH-6hVVO0_xYq-DmOnmgqOCE,7414
8
8
  git_of_theseus/stack_plot.py,sha256=q4-YlW3PyiwbIBFeHBA3dsdR1I_XKUQD74hAuSfhIR4,3150
9
9
  git_of_theseus/survival_plot.py,sha256=NEITAa0pMD9uJVsPd7JA71ucavnG1RxgC-F6Jk-K5bE,4868
10
10
  git_of_theseus/utils.py,sha256=Xw2udch9ixSgFInGhIC4_RJ_9IB3E8MmV1dmznavCWc,1026
11
- better_git_of_theseus-0.4.0.dist-info/METADATA,sha256=3-L_lKf0AqSnwizwWoUGj3reL13vbzP-v4SwUIpDFnU,5391
12
- better_git_of_theseus-0.4.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
13
- better_git_of_theseus-0.4.0.dist-info/entry_points.txt,sha256=F6qG6hzkuqjyrRu2zwzRpjbq77YCAUQu9mjmEzkabqA,323
14
- better_git_of_theseus-0.4.0.dist-info/top_level.txt,sha256=2kpp8WgiBzqVLxua_mBS00Nj4cUORaRbJi121THJ_0o,15
15
- better_git_of_theseus-0.4.0.dist-info/RECORD,,
11
+ better_git_of_theseus-0.4.2.dist-info/METADATA,sha256=ZqXuZz94OODNr50giDYHD5Iihw5D_38undkBRXIeHDI,3633
12
+ better_git_of_theseus-0.4.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
13
+ better_git_of_theseus-0.4.2.dist-info/entry_points.txt,sha256=dEBL6oCDAozY13Y_qxS_6-qkyCA7R2TpjoLH6QJR72g,66
14
+ better_git_of_theseus-0.4.2.dist-info/top_level.txt,sha256=2kpp8WgiBzqVLxua_mBS00Nj4cUORaRbJi121THJ_0o,15
15
+ better_git_of_theseus-0.4.2.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ better-git-of-theseus = git_of_theseus.cmd:main
git_of_theseus/app.py CHANGED
@@ -93,7 +93,7 @@ if st.session_state.analysis_results:
93
93
  data = results.get(data_key)
94
94
  if data:
95
95
  fig = plotly_stack_plot(data, normalize=normalize, max_n=max_n, title=project_name)
96
- st.plotly_chart(fig, use_container_width=True)
96
+ st.plotly_chart(fig, width="stretch")
97
97
  else:
98
98
  st.warning(f"Data for {data_source_label} not found.")
99
99
 
@@ -110,7 +110,7 @@ if st.session_state.analysis_results:
110
110
  data_line = results.get(data_key_line)
111
111
  if data_line:
112
112
  fig = plotly_line_plot(data_line, normalize=normalize_line, max_n=max_n_line, title=project_name)
113
- st.plotly_chart(fig, use_container_width=True)
113
+ st.plotly_chart(fig, width="stretch")
114
114
  else:
115
115
  st.warning(f"Data for {data_source_label_line} not found.")
116
116
 
@@ -125,7 +125,7 @@ if st.session_state.analysis_results:
125
125
  survival_data = results.get("survival")
126
126
  if survival_data:
127
127
  fig = plotly_survival_plot(survival_data, exp_fit=exp_fit, years=years, title=project_name)
128
- st.plotly_chart(fig, use_container_width=True)
128
+ st.plotly_chart(fig, width="stretch")
129
129
  else:
130
130
  st.warning("Survival data not found.")
131
131
 
@@ -1,122 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: better-git-of-theseus
3
- Version: 0.4.0
4
- Summary: Plot stats on Git repositories with interactive Plotly charts
5
- Home-page: https://github.com/onewesong/better-git-of-theseus
6
- Author: Erik Bernhardsson
7
- Author-email: mail@erikbern.com
8
- Description-Content-Type: text/markdown
9
- License-File: LICENSE
10
- Requires-Dist: gitpython
11
- Requires-Dist: numpy
12
- Requires-Dist: tqdm
13
- Requires-Dist: wcmatch
14
- Requires-Dist: pygments
15
- Requires-Dist: plotly
16
- Requires-Dist: streamlit
17
- Requires-Dist: python-dateutil
18
- Requires-Dist: scipy
19
- Dynamic: author
20
- Dynamic: author-email
21
- Dynamic: description
22
- Dynamic: description-content-type
23
- Dynamic: home-page
24
- Dynamic: license-file
25
- Dynamic: requires-dist
26
- Dynamic: summary
27
-
28
- [![pypi badge](https://img.shields.io/pypi/v/git-of-theseus.svg?style=flat)](https://pypi.python.org/pypi/git-of-theseus)
29
-
30
- Some scripts to analyze Git repos. Produces cool looking graphs like this (running it on [git](https://github.com/git/git) itself):
31
-
32
- ![git](https://raw.githubusercontent.com/erikbern/git-of-theseus/master/pics/git-git.png)
33
-
34
- Installing
35
- ----------
36
-
37
- Run `pip install git-of-theseus`
38
-
39
- Running
40
- -------
41
-
42
- First, you need to run `git-of-theseus-analyze <path to repo>` (see `git-of-theseus-analyze --help` for a bunch of config). This will analyze a repository and might take quite some time.
43
-
44
- After that, you can generate plots! Some examples:
45
-
46
- 1. Run `git-of-theseus-stack-plot cohorts.json` will create a stack plot showing the total amount of code broken down into cohorts (what year the code was added)
47
- 1. Run `git-of-theseus-line-plot authors.json --normalize` will show a plot of the % of code contributed by the top 20 authors
48
- 1. Run `git-of-theseus-survival-plot survival.json`
49
-
50
- You can run `--help` to see various options.
51
-
52
- If you want to plot multiple repositories, have to run `git-of-theseus-analyze` separately for each project and store the data in separate directories using the `--outdir` flag. Then you can run `git-of-theseus-survival-plot <foo/survival.json> <bar/survival.json>` (optionally with the `--exp-fit` flag to fit an exponential decay)
53
-
54
- Help
55
- ----
56
-
57
- `AttributeError: Unknown property labels` – upgrade matplotlib if you are seeing this. `pip install matplotlib --upgrade`
58
-
59
- Some pics
60
- ---------
61
-
62
- Survival of a line of code in a set of interesting repos:
63
-
64
- ![git](https://raw.githubusercontent.com/erikbern/git-of-theseus/master/pics/git-projects-survival.png)
65
-
66
- This curve is produced by the `git-of-theseus-survival-plot` script and shows the *percentage of lines in a commit that are still present after x years*. It aggregates it over all commits, no matter what point in time they were made. So for *x=0* it includes all commits, whereas for *x>0* not all commits are counted (because we would have to look into the future for some of them). The survival curves are estimated using [Kaplan-Meier](https://en.wikipedia.org/wiki/Kaplan%E2%80%93Meier_estimator).
67
-
68
- You can also add an exponential fit:
69
-
70
- ![git](https://raw.githubusercontent.com/erikbern/git-of-theseus/master/pics/git-projects-survival-exp-fit.png)
71
-
72
- Linux – stack plot:
73
-
74
- ![git](https://raw.githubusercontent.com/erikbern/git-of-theseus/master/pics/git-linux.png)
75
-
76
- This curve is produced by the `git-of-theseus-stack-plot` script and shows the total number of lines in a repo broken down into cohorts by the year the code was added.
77
-
78
- Node – stack plot:
79
-
80
- ![git](https://raw.githubusercontent.com/erikbern/git-of-theseus/master/pics/git-node.png)
81
-
82
- Rails – stack plot:
83
-
84
- ![git](https://raw.githubusercontent.com/erikbern/git-of-theseus/master/pics/git-rails.png)
85
-
86
- Tensorflow – stack plot:
87
-
88
- ![git](https://raw.githubusercontent.com/erikbern/git-of-theseus/master/pics/git-tensorflow.png)
89
-
90
- Rust – stack plot:
91
-
92
- ![git](https://raw.githubusercontent.com/erikbern/git-of-theseus/master/pics/git-rust.png)
93
-
94
- Plotting other stuff
95
- --------------------
96
-
97
- `git-of-theseus-analyze` will write `exts.json`, `cohorts.json` and `authors.json`. You can run `git-of-theseus-stack-plot authors.json` to plot author statistics as well, or `git-of-theseus-stack-plot exts.json` to plot file extension statistics. For author statistics, you might want to create a [.mailmap](https://git-scm.com/docs/gitmailmap) file in the root directory of the repository to deduplicate authors. If you need to create a .mailmap file the following command can list the distinct author-email combinations in a repository:
98
-
99
- Mac / Linux
100
-
101
- ```shell
102
- git log --pretty=format:"%an %ae" | sort | uniq
103
- ```
104
-
105
- Windows Powershell
106
-
107
- ```powershell
108
- git log --pretty=format:"%an %ae" | Sort-Object | Select-Object -Unique
109
- ```
110
-
111
- For instance, here's the author statistics for [Kubernetes](https://github.com/kubernetes/kubernetes):
112
-
113
- ![git](https://raw.githubusercontent.com/erikbern/git-of-theseus/master/pics/git-kubernetes-authors.png)
114
-
115
- You can also normalize it to 100%. Here's author statistics for Git:
116
-
117
- ![git](https://raw.githubusercontent.com/erikbern/git-of-theseus/master/pics/git-git-authors-normalized.png)
118
-
119
- Other stuff
120
- -----------
121
-
122
- [Markovtsev Vadim](https://twitter.com/tmarkhor) implemented a very similar analysis that claims to be 20%-6x faster than Git of Theseus. It's named [Hercules](https://github.com/src-d/hercules) and there's a great [blog post](https://web.archive.org/web/20180918135417/https://blog.sourced.tech/post/hercules.v4/) about all the complexity going into the analysis of Git history.
@@ -1,6 +0,0 @@
1
- [console_scripts]
2
- git-of-theseus-analyze = git_of_theseus.analyze:analyze_cmdline
3
- git-of-theseus-line-plot = git_of_theseus:line_plot_cmdline
4
- git-of-theseus-stack-plot = git_of_theseus:stack_plot_cmdline
5
- git-of-theseus-survival-plot = git_of_theseus:survival_plot_cmdline
6
- git-of-theseus-visualize = git_of_theseus.cmd:main