gitflow-analytics 1.0.0__py3-none-any.whl → 1.0.1__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,463 @@
1
+ Metadata-Version: 2.4
2
+ Name: gitflow-analytics
3
+ Version: 1.0.1
4
+ Summary: Analyze Git repositories for developer productivity insights
5
+ Author-email: Bob Matyas <bobmatnyc@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/bobmatnyc/gitflow-analytics
8
+ Project-URL: Documentation, https://github.com/bobmatnyc/gitflow-analytics/blob/main/README.md
9
+ Project-URL: Repository, https://github.com/bobmatnyc/gitflow-analytics
10
+ Project-URL: Issues, https://github.com/bobmatnyc/gitflow-analytics/issues
11
+ Keywords: git,analytics,productivity,metrics,development
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Software Development :: Version Control :: Git
21
+ Classifier: Topic :: Software Development :: Quality Assurance
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: click>=8.1
26
+ Requires-Dist: gitpython>=3.1
27
+ Requires-Dist: tqdm>=4.65
28
+ Requires-Dist: sqlalchemy>=2.0
29
+ Requires-Dist: pandas>=2.0
30
+ Requires-Dist: pyyaml>=6.0
31
+ Requires-Dist: python-dateutil>=2.8
32
+ Requires-Dist: python-dotenv>=1.0
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=7.0; extra == "dev"
35
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
36
+ Requires-Dist: pytest-mock>=3.0; extra == "dev"
37
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
38
+ Requires-Dist: mypy>=1.0; extra == "dev"
39
+ Requires-Dist: black>=23.0; extra == "dev"
40
+ Provides-Extra: github
41
+ Requires-Dist: pygithub>=1.58; extra == "github"
42
+ Provides-Extra: all
43
+ Requires-Dist: gitflow-analytics[github]; extra == "all"
44
+ Dynamic: license-file
45
+
46
+ # GitFlow Analytics
47
+
48
+ A Python package for analyzing Git repositories to generate comprehensive developer productivity reports. It extracts data directly from Git history and GitHub APIs, providing weekly summaries, productivity insights, and gap analysis.
49
+
50
+ ## Features
51
+
52
+ - 🚀 **Multi-repository analysis** with project grouping
53
+ - 🏢 **Organization-based repository discovery** from GitHub
54
+ - 👥 **Developer identity resolution** and normalization
55
+ - 📊 **Work volume analysis** (absolute vs relative effort)
56
+ - 🎯 **Story point extraction** from commit messages and PR descriptions
57
+ - 🎫 **Multi-platform ticket tracking** (JIRA, GitHub Issues, ClickUp, Linear)
58
+ - 📈 **Weekly CSV reports** with productivity metrics
59
+ - 🔒 **Data anonymization** for external sharing
60
+ - ⚡ **Smart caching** for fast repeated analyses
61
+ - 🔄 **Batch processing** for large repositories
62
+
63
+ ## Quick Start
64
+
65
+ ### Installation
66
+
67
+ ```bash
68
+ pip install gitflow-analytics
69
+ ```
70
+
71
+ ### Basic Usage
72
+
73
+ 1. Create a configuration file (`config.yaml`):
74
+
75
+ **Option A: Organization-based (Automatic Repository Discovery)**
76
+ ```yaml
77
+ version: "1.0"
78
+
79
+ github:
80
+ token: "${GITHUB_TOKEN}"
81
+ organization: "myorg" # Automatically discovers all repositories
82
+
83
+ analysis:
84
+ story_point_patterns:
85
+ - "(?:story\\s*points?|sp|pts?)\\s*[:=]\\s*(\\d+)"
86
+ - "\\[(\\d+)\\s*(?:sp|pts?)\\]"
87
+ ```
88
+
89
+ **Option B: Repository-based (Manual Configuration)**
90
+ ```yaml
91
+ version: "1.0"
92
+
93
+ github:
94
+ token: "${GITHUB_TOKEN}"
95
+ owner: "${GITHUB_OWNER}"
96
+
97
+ repositories:
98
+ - name: "frontend"
99
+ path: "~/repos/frontend"
100
+ github_repo: "myorg/frontend"
101
+ project_key: "FRONTEND"
102
+
103
+ - name: "backend"
104
+ path: "~/repos/backend"
105
+ github_repo: "myorg/backend"
106
+ project_key: "BACKEND"
107
+
108
+ analysis:
109
+ story_point_patterns:
110
+ - "(?:story\\s*points?|sp|pts?)\\s*[:=]\\s*(\\d+)"
111
+ - "\\[(\\d+)\\s*(?:sp|pts?)\\]"
112
+ ```
113
+
114
+ 2. Create a `.env` file in the same directory as your `config.yaml`:
115
+
116
+ ```bash
117
+ # .env
118
+ GITHUB_TOKEN=ghp_your_github_token_here
119
+ GITHUB_OWNER=your_github_org # Only for repository-based setup
120
+ ```
121
+
122
+ 3. Run the analysis:
123
+
124
+ ```bash
125
+ gitflow-analytics analyze -c config.yaml
126
+ ```
127
+
128
+ ## Configuration Options
129
+
130
+ ### Environment Variables and Credentials
131
+
132
+ GitFlow Analytics automatically loads environment variables from a `.env` file in the same directory as your configuration YAML. This is the recommended approach for managing credentials securely.
133
+
134
+ #### Step 1: Create a `.env` file
135
+
136
+ Create a `.env` file next to your configuration YAML:
137
+
138
+ ```bash
139
+ # .env file (same directory as your config.yaml)
140
+ # GitHub credentials (required)
141
+ GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
142
+ GITHUB_OWNER=myorg # Optional: default owner for repositories
143
+
144
+ # JIRA credentials (optional - only if using JIRA integration)
145
+ JIRA_ACCESS_USER=your.email@company.com
146
+ JIRA_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxx
147
+
148
+ # Other optional tokens
149
+ CLICKUP_TOKEN=pk_xxxxxxxxxxxx
150
+ LINEAR_TOKEN=lin_api_xxxxxxxxxxxx
151
+ ```
152
+
153
+ #### Step 2: Reference in YAML configuration
154
+
155
+ Use `${VARIABLE_NAME}` syntax in your YAML to reference environment variables:
156
+
157
+ ```yaml
158
+ # config.yaml
159
+ version: "1.0"
160
+
161
+ github:
162
+ token: "${GITHUB_TOKEN}" # Required
163
+ owner: "${GITHUB_OWNER}" # Optional
164
+ organization: "${GITHUB_ORG}" # Optional (for org-based discovery)
165
+
166
+ # Optional: JIRA integration
167
+ jira:
168
+ access_user: "${JIRA_ACCESS_USER}"
169
+ access_token: "${JIRA_ACCESS_TOKEN}"
170
+ base_url: "https://yourcompany.atlassian.net"
171
+
172
+ # Optional: Configure which JIRA fields contain story points
173
+ jira_integration:
174
+ story_point_fields:
175
+ - "Story Points"
176
+ - "customfield_10016" # Your custom field ID
177
+ ```
178
+
179
+ #### Important Notes:
180
+
181
+ - **Never commit `.env` files** to version control (add to `.gitignore`)
182
+ - If credentials are not found in the `.env` file, the tool will exit with an informative error
183
+ - The `.env` file must be in the same directory as your YAML configuration
184
+ - All configured services must have corresponding environment variables set
185
+
186
+ ### Organization vs Repository-based Setup
187
+
188
+ GitFlow Analytics supports two main configuration approaches:
189
+
190
+ #### Organization-based Configuration (Recommended)
191
+
192
+ Automatically discovers all non-archived repositories from a GitHub organization:
193
+
194
+ ```yaml
195
+ version: "1.0"
196
+
197
+ github:
198
+ token: "${GITHUB_TOKEN}"
199
+ organization: "myorg" # Your GitHub organization name
200
+
201
+ # Optional: Customize analysis settings
202
+ analysis:
203
+ story_point_patterns:
204
+ - "(?:story\\s*points?|sp|pts?)\\s*[:=]\\s*(\\d+)"
205
+
206
+ exclude:
207
+ authors:
208
+ - "dependabot[bot]"
209
+ - "github-actions[bot]"
210
+ ```
211
+
212
+ **Benefits:**
213
+ - Automatically discovers new repositories as they're added to the organization
214
+ - No need to manually configure each repository
215
+ - Simplified configuration management
216
+ - Perfect for teams with many repositories
217
+
218
+ **Requirements:**
219
+ - Your GitHub token must have organization read access
220
+ - Repositories will be automatically cloned to local directories if they don't exist
221
+
222
+ #### Repository-based Configuration
223
+
224
+ Manually specify each repository to analyze:
225
+
226
+ ```yaml
227
+ version: "1.0"
228
+
229
+ github:
230
+ token: "${GITHUB_TOKEN}"
231
+ owner: "${GITHUB_OWNER}" # Default owner for repositories
232
+
233
+ repositories:
234
+ - name: "frontend"
235
+ path: "~/repos/frontend"
236
+ github_repo: "myorg/frontend"
237
+ project_key: "FRONTEND"
238
+
239
+ - name: "backend"
240
+ path: "~/repos/backend"
241
+ github_repo: "myorg/backend"
242
+ project_key: "BACKEND"
243
+
244
+ analysis:
245
+ story_point_patterns:
246
+ - "(?:story\\s*points?|sp|pts?)\\s*[:=]\\s*(\\d+)"
247
+ ```
248
+
249
+ **Benefits:**
250
+ - Fine-grained control over which repositories to analyze
251
+ - Custom project keys and local paths
252
+ - Works with mixed-ownership repositories
253
+ - Compatible with existing configurations
254
+
255
+ ### Directory Defaults
256
+
257
+ GitFlow Analytics now defaults cache and report directories to be relative to the configuration file location:
258
+
259
+ - **Reports**: Default to same directory as config file (unless overridden with `--output`)
260
+ - **Cache**: Default to `.gitflow-cache/` in config file directory
261
+ - **Backward compatibility**: Absolute paths in configuration continue to work as before
262
+
263
+ Example directory structure:
264
+ ```
265
+ /project/
266
+ ├── config.yaml # Configuration file
267
+ ├── weekly_metrics.csv # Reports generated here by default
268
+ ├── summary.csv
269
+ └── .gitflow-cache/ # Cache directory
270
+ ├── gitflow_cache.db
271
+ └── identities.db
272
+ ```
273
+
274
+ ## Command Line Interface
275
+
276
+ ### Main Commands
277
+
278
+ ```bash
279
+ # Analyze repositories
280
+ gitflow-analytics analyze -c config.yaml --weeks 12 --output ./reports
281
+
282
+ # Show cache statistics
283
+ gitflow-analytics cache-stats -c config.yaml
284
+
285
+ # List known developers
286
+ gitflow-analytics list-developers -c config.yaml
287
+
288
+ # Merge developer identities
289
+ gitflow-analytics merge-identity -c config.yaml dev1_id dev2_id
290
+
291
+ # Discover JIRA story point fields
292
+ gitflow-analytics discover-jira-fields -c config.yaml
293
+ ```
294
+
295
+ ### Options
296
+
297
+ - `--weeks, -w`: Number of weeks to analyze (default: 12)
298
+ - `--output, -o`: Output directory for reports (default: ./reports)
299
+ - `--anonymize`: Anonymize developer information
300
+ - `--no-cache`: Disable caching for fresh analysis
301
+ - `--clear-cache`: Clear cache before analysis
302
+ - `--validate-only`: Validate configuration without running
303
+
304
+ ## Complete Configuration Example
305
+
306
+ Here's a complete example showing `.env` file and corresponding YAML configuration:
307
+
308
+ ### `.env` file
309
+ ```bash
310
+ # GitHub Configuration
311
+ GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
312
+ GITHUB_ORG=EWTN-Global
313
+
314
+ # JIRA Configuration
315
+ JIRA_ACCESS_USER=developer@ewtn.com
316
+ JIRA_ACCESS_TOKEN=ATATT3xxxxxxxxxxx
317
+
318
+ # Optional: Other integrations
319
+ # CLICKUP_TOKEN=pk_xxxxxxxxxxxx
320
+ # LINEAR_TOKEN=lin_api_xxxxxxxxxxxx
321
+ ```
322
+
323
+ ### `config.yaml` file
324
+ ```yaml
325
+ version: "1.0"
326
+
327
+ # GitHub configuration with organization discovery
328
+ github:
329
+ token: "${GITHUB_TOKEN}"
330
+ organization: "${GITHUB_ORG}"
331
+
332
+ # JIRA integration for story points
333
+ jira:
334
+ access_user: "${JIRA_ACCESS_USER}"
335
+ access_token: "${JIRA_ACCESS_TOKEN}"
336
+ base_url: "https://ewtn.atlassian.net"
337
+
338
+ jira_integration:
339
+ enabled: true
340
+ fetch_story_points: true
341
+ story_point_fields:
342
+ - "Story point estimate" # Your field name
343
+ - "customfield_10016" # Fallback field ID
344
+
345
+ # Analysis configuration
346
+ analysis:
347
+ # Only track JIRA tickets (ignore GitHub issues, etc.)
348
+ ticket_platforms:
349
+ - jira
350
+
351
+ # Exclude bot commits and boilerplate files
352
+ exclude:
353
+ authors:
354
+ - "dependabot[bot]"
355
+ - "renovate[bot]"
356
+ paths:
357
+ - "**/node_modules/**"
358
+ - "**/*.min.js"
359
+ - "**/package-lock.json"
360
+
361
+ # Developer identity consolidation
362
+ identity:
363
+ similarity_threshold: 0.85
364
+ manual_mappings:
365
+ - primary_email: "john.doe@company.com"
366
+ aliases:
367
+ - "jdoe@oldcompany.com"
368
+ - "john@personal.com"
369
+
370
+ # Output configuration
371
+ output:
372
+ directory: "./reports"
373
+ formats:
374
+ - csv
375
+ - markdown
376
+ ```
377
+
378
+ ## Output Reports
379
+
380
+ The tool generates three CSV reports:
381
+
382
+ 1. **Weekly Metrics** (`weekly_metrics_YYYYMMDD.csv`)
383
+ - Week-by-week developer productivity
384
+ - Story points, commits, lines changed
385
+ - Ticket coverage percentages
386
+ - Per-project breakdown
387
+
388
+ 2. **Summary Statistics** (`summary_YYYYMMDD.csv`)
389
+ - Overall project statistics
390
+ - Platform-specific ticket counts
391
+ - Top contributors
392
+
393
+ 3. **Developer Report** (`developers_YYYYMMDD.csv`)
394
+ - Complete developer profiles
395
+ - Total contributions
396
+ - Identity aliases
397
+
398
+ ## Story Point Patterns
399
+
400
+ Configure custom regex patterns to match your team's story point format:
401
+
402
+ ```yaml
403
+ story_point_patterns:
404
+ - "SP: (\\d+)" # SP: 5
405
+ - "\\[([0-9]+) pts\\]" # [3 pts]
406
+ - "estimate: (\\d+)" # estimate: 8
407
+ ```
408
+
409
+ ## Ticket Platform Support
410
+
411
+ Automatically detects and tracks tickets from:
412
+ - **JIRA**: `PROJ-123`
413
+ - **GitHub**: `#123`, `GH-123`
414
+ - **ClickUp**: `CU-abc123`
415
+ - **Linear**: `ENG-123`
416
+
417
+ ### JIRA Integration
418
+
419
+ GitFlow Analytics can fetch story points directly from JIRA tickets. Configure your JIRA instance:
420
+
421
+ ```yaml
422
+ jira:
423
+ access_user: "${JIRA_ACCESS_USER}"
424
+ access_token: "${JIRA_ACCESS_TOKEN}"
425
+ base_url: "https://your-company.atlassian.net"
426
+
427
+ jira_integration:
428
+ enabled: true
429
+ story_point_fields:
430
+ - "Story point estimate" # Your custom field name
431
+ - "customfield_10016" # Or use field ID
432
+ ```
433
+
434
+ To discover your JIRA story point fields:
435
+ ```bash
436
+ gitflow-analytics discover-jira-fields -c config.yaml
437
+ ```
438
+
439
+ ## Caching
440
+
441
+ The tool uses SQLite for intelligent caching:
442
+ - Commit analysis results
443
+ - Developer identity mappings
444
+ - Pull request data
445
+
446
+ Cache is automatically managed with configurable TTL.
447
+
448
+ ## Developer Identity Resolution
449
+
450
+ Intelligently merges developer identities across:
451
+ - Different email addresses
452
+ - Name variations
453
+ - GitHub usernames
454
+
455
+ Manual overrides supported in configuration.
456
+
457
+ ## Contributing
458
+
459
+ Contributions are welcome! Please feel free to submit a Pull Request.
460
+
461
+ ## License
462
+
463
+ This project is licensed under the MIT License - see the LICENSE file for details.
@@ -0,0 +1,31 @@
1
+ gitflow_analytics/__init__.py,sha256=9g64-8GIadOL3mCDsxHPMIlUhztZAx_nUISQtRotsuY,682
2
+ gitflow_analytics/_version.py,sha256=d6tbYJNPyd-1yr5YWMYdu12zn6-tSRgYnpW5-dGvQWA,136
3
+ gitflow_analytics/cli.py,sha256=1zC5kOSFKtgGHaew6JOjezRUXh3FrVmZEYE2mu5h0QY,21103
4
+ gitflow_analytics/config.py,sha256=xQpsQTKtTU5L3k44YG3grtXl-b4miL9l5GcPV0w5Vkc,15896
5
+ gitflow_analytics/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ gitflow_analytics/core/analyzer.py,sha256=7DRofL9aRdafuRaTxKne0h42QAhdDn245-cIhkDyNaQ,10379
7
+ gitflow_analytics/core/branch_mapper.py,sha256=p1MzezL2aMjhVX0672aC9Zc_1QPVnKmw1EEn4CSZTCc,7603
8
+ gitflow_analytics/core/cache.py,sha256=nAWdkT210mrsMrpC50pCYXJ5e7mi5YzgrgB5Bd0UXOo,11641
9
+ gitflow_analytics/core/identity.py,sha256=FXD5aeMbf1yyFwDKQqu943kHIMRLbb7lclw1m421qF4,17046
10
+ gitflow_analytics/extractors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
+ gitflow_analytics/extractors/base.py,sha256=EIs8udjsJOMJMuqo6GJD9m-LQ-bmXuD8Ofdxr9KHYzQ,1208
12
+ gitflow_analytics/extractors/story_points.py,sha256=2NUViohigV5QHMw5U_NMwEuNd4pFLVuFYphM7ZliZ-Y,5038
13
+ gitflow_analytics/extractors/tickets.py,sha256=pjexGozeZlxy0oG6D-qxtkWrQiWbdU2PU3CmdJxIZfY,6655
14
+ gitflow_analytics/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ gitflow_analytics/integrations/github_integration.py,sha256=snRjPKZXBP0XK_vProHJeqRWDAxAVbuGEbRf1yWsZew,6719
16
+ gitflow_analytics/integrations/jira_integration.py,sha256=UE8UmMt90Py2PZTldAjLhBYHhFF81F5gwAuvjtHAI18,10549
17
+ gitflow_analytics/integrations/orchestrator.py,sha256=72l6mt2MGk5eJBO1GuwUEMg_K16SeK8fzp1TNlm8wbQ,5688
18
+ gitflow_analytics/metrics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
+ gitflow_analytics/metrics/dora.py,sha256=hn99XATw-lWr8RdQQb5u7XwT-tAZs0CC5Qbj0xOHkWw,12709
20
+ gitflow_analytics/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
+ gitflow_analytics/models/database.py,sha256=y93oyZHe1EyYX9YYgI2jDnuXtBG4_BsvJx7ei9mRgl0,5521
22
+ gitflow_analytics/reports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ gitflow_analytics/reports/analytics_writer.py,sha256=FoXLcdS11q6DekB2QfR-1J30gUQkARfiR-hyWZZO5hw,19496
24
+ gitflow_analytics/reports/csv_writer.py,sha256=SgQLa9mNc-pLhLwy1hhttMjKPTXcRYvOaUwvUD1WI84,13021
25
+ gitflow_analytics/reports/narrative_writer.py,sha256=GKBdbFL6_Qwfi8xXsD5C_inFf12h4_gy-9QasanTv1Q,12879
26
+ gitflow_analytics-1.0.1.dist-info/licenses/LICENSE,sha256=xwvSwY1GYXpRpmbnFvvnbmMwpobnrdN9T821sGvjOY0,1066
27
+ gitflow_analytics-1.0.1.dist-info/METADATA,sha256=yy2hzjV1Y1DdhXUn7MuOdnyjVxYIZ5u306ux_VZYKFk,12677
28
+ gitflow_analytics-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
+ gitflow_analytics-1.0.1.dist-info/entry_points.txt,sha256=a3y8HnfLOvK1QVOgAkDY6VQXXm3o9ZSQRZrpiaS3hEM,65
30
+ gitflow_analytics-1.0.1.dist-info/top_level.txt,sha256=CQyxZXjKvpSB1kgqqtuE0PCRqfRsXZJL8JrYpJKtkrk,18
31
+ gitflow_analytics-1.0.1.dist-info/RECORD,,
@@ -1,201 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: gitflow-analytics
3
- Version: 1.0.0
4
- Summary: Analyze Git repositories for developer productivity insights
5
- Author-email: Bob Matyas <bobmatnyc@gmail.com>
6
- License: MIT
7
- Project-URL: Homepage, https://github.com/bobmatnyc/gitflow-analytics
8
- Project-URL: Documentation, https://github.com/bobmatnyc/gitflow-analytics/blob/main/README.md
9
- Project-URL: Repository, https://github.com/bobmatnyc/gitflow-analytics
10
- Project-URL: Issues, https://github.com/bobmatnyc/gitflow-analytics/issues
11
- Keywords: git,analytics,productivity,metrics,development
12
- Classifier: Development Status :: 5 - Production/Stable
13
- Classifier: Intended Audience :: Developers
14
- Classifier: License :: OSI Approved :: MIT License
15
- Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
20
- Classifier: Programming Language :: Python :: 3.12
21
- Classifier: Topic :: Software Development :: Version Control :: Git
22
- Classifier: Topic :: Software Development :: Quality Assurance
23
- Requires-Python: >=3.8
24
- Description-Content-Type: text/markdown
25
- License-File: LICENSE
26
- Requires-Dist: click>=8.1
27
- Requires-Dist: gitpython>=3.1
28
- Requires-Dist: tqdm>=4.65
29
- Requires-Dist: sqlalchemy>=2.0
30
- Requires-Dist: pandas>=2.0
31
- Requires-Dist: pyyaml>=6.0
32
- Requires-Dist: python-dateutil>=2.8
33
- Provides-Extra: dev
34
- Requires-Dist: pytest>=7.0; extra == "dev"
35
- Requires-Dist: pytest-cov>=4.0; extra == "dev"
36
- Requires-Dist: pytest-mock>=3.0; extra == "dev"
37
- Requires-Dist: ruff>=0.1.0; extra == "dev"
38
- Requires-Dist: mypy>=1.0; extra == "dev"
39
- Requires-Dist: black>=23.0; extra == "dev"
40
- Provides-Extra: github
41
- Requires-Dist: pygithub>=1.58; extra == "github"
42
- Provides-Extra: all
43
- Requires-Dist: gitflow-analytics[github]; extra == "all"
44
- Dynamic: license-file
45
-
46
- # GitFlow Analytics
47
-
48
- A Python package for analyzing Git repositories to generate comprehensive developer productivity reports. It extracts data directly from Git history and GitHub APIs, providing weekly summaries, productivity insights, and gap analysis.
49
-
50
- ## Features
51
-
52
- - 🚀 **Multi-repository analysis** with project grouping
53
- - 👥 **Developer identity resolution** and normalization
54
- - 📊 **Work volume analysis** (absolute vs relative effort)
55
- - 🎯 **Story point extraction** from commit messages and PR descriptions
56
- - 🎫 **Multi-platform ticket tracking** (JIRA, GitHub Issues, ClickUp, Linear)
57
- - 📈 **Weekly CSV reports** with productivity metrics
58
- - 🔒 **Data anonymization** for external sharing
59
- - ⚡ **Smart caching** for fast repeated analyses
60
- - 🔄 **Batch processing** for large repositories
61
-
62
- ## Quick Start
63
-
64
- ### Installation
65
-
66
- ```bash
67
- pip install gitflow-analytics
68
- ```
69
-
70
- ### Basic Usage
71
-
72
- 1. Create a configuration file (`config.yaml`):
73
-
74
- ```yaml
75
- version: "1.0"
76
-
77
- github:
78
- token: "${GITHUB_TOKEN}"
79
- owner: "${GITHUB_OWNER}"
80
-
81
- repositories:
82
- - name: "frontend"
83
- path: "~/repos/frontend"
84
- github_repo: "myorg/frontend"
85
- project_key: "FRONTEND"
86
-
87
- - name: "backend"
88
- path: "~/repos/backend"
89
- github_repo: "myorg/backend"
90
- project_key: "BACKEND"
91
-
92
- analysis:
93
- story_point_patterns:
94
- - "(?:story\\s*points?|sp|pts?)\\s*[:=]\\s*(\\d+)"
95
- - "\\[(\\d+)\\s*(?:sp|pts?)\\]"
96
- ```
97
-
98
- 2. Set environment variables:
99
-
100
- ```bash
101
- export GITHUB_TOKEN=your_github_token
102
- export GITHUB_OWNER=your_github_org
103
- ```
104
-
105
- 3. Run the analysis:
106
-
107
- ```bash
108
- gitflow-analytics analyze -c config.yaml
109
- ```
110
-
111
- ## Command Line Interface
112
-
113
- ### Main Commands
114
-
115
- ```bash
116
- # Analyze repositories
117
- gitflow-analytics analyze -c config.yaml --weeks 12 --output ./reports
118
-
119
- # Show cache statistics
120
- gitflow-analytics cache-stats -c config.yaml
121
-
122
- # List known developers
123
- gitflow-analytics list-developers -c config.yaml
124
-
125
- # Merge developer identities
126
- gitflow-analytics merge-identity -c config.yaml dev1_id dev2_id
127
- ```
128
-
129
- ### Options
130
-
131
- - `--weeks, -w`: Number of weeks to analyze (default: 12)
132
- - `--output, -o`: Output directory for reports (default: ./reports)
133
- - `--anonymize`: Anonymize developer information
134
- - `--no-cache`: Disable caching for fresh analysis
135
- - `--clear-cache`: Clear cache before analysis
136
- - `--validate-only`: Validate configuration without running
137
-
138
- ## Output Reports
139
-
140
- The tool generates three CSV reports:
141
-
142
- 1. **Weekly Metrics** (`weekly_metrics_YYYYMMDD.csv`)
143
- - Week-by-week developer productivity
144
- - Story points, commits, lines changed
145
- - Ticket coverage percentages
146
- - Per-project breakdown
147
-
148
- 2. **Summary Statistics** (`summary_YYYYMMDD.csv`)
149
- - Overall project statistics
150
- - Platform-specific ticket counts
151
- - Top contributors
152
-
153
- 3. **Developer Report** (`developers_YYYYMMDD.csv`)
154
- - Complete developer profiles
155
- - Total contributions
156
- - Identity aliases
157
-
158
- ## Story Point Patterns
159
-
160
- Configure custom regex patterns to match your team's story point format:
161
-
162
- ```yaml
163
- story_point_patterns:
164
- - "SP: (\\d+)" # SP: 5
165
- - "\\[([0-9]+) pts\\]" # [3 pts]
166
- - "estimate: (\\d+)" # estimate: 8
167
- ```
168
-
169
- ## Ticket Platform Support
170
-
171
- Automatically detects and tracks tickets from:
172
- - **JIRA**: `PROJ-123`
173
- - **GitHub**: `#123`, `GH-123`
174
- - **ClickUp**: `CU-abc123`
175
- - **Linear**: `ENG-123`
176
-
177
- ## Caching
178
-
179
- The tool uses SQLite for intelligent caching:
180
- - Commit analysis results
181
- - Developer identity mappings
182
- - Pull request data
183
-
184
- Cache is automatically managed with configurable TTL.
185
-
186
- ## Developer Identity Resolution
187
-
188
- Intelligently merges developer identities across:
189
- - Different email addresses
190
- - Name variations
191
- - GitHub usernames
192
-
193
- Manual overrides supported in configuration.
194
-
195
- ## Contributing
196
-
197
- Contributions are welcome! Please feel free to submit a Pull Request.
198
-
199
- ## License
200
-
201
- This project is licensed under the MIT License - see the LICENSE file for details.