Metadata-Version: 2.4
Name: nwcommitaverages
Version: 2.0.1
Summary: A library designed to calculate the average time between Git commits.
Home-page: https://github.com/numbworks/nwcommitaverages
Author: numbworks
License: MIT
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: tabulate>=0.9.0
Requires-Dist: pyyaml>=6.0.3
Dynamic: author
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# nwcommitaverages

## Introduction

This packages consists of the following modules:

- `nwcommitaverages` is an application designed to calculate the average time between Git commits.
- `nwcommitaveragescli` is a command-line application built on the top of `nwcommitaverages`.

## Pre-Requisites

In order to work, this library requires to be run against a local Git repository and that Git itself is installed on the machine.

## Getting Started

I'll use Debian as operating system, but the concept is similar for Windows or Mac.

Procedure:

1. Install `pip` and `venv`:

```sh
sudo apt install python3-pip python3.12-venv
```

2. Create a virtual environment:

```sh
python3 -m venv /tmp/nwcommitaverages
source /tmp/nwcommitaverages/bin/activate
```

3. Download and install the package:

```sh
pip install nwcommitaverages
```

4. Enter in the interactive Python environment:

```sh
python3
```
```
Python 3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
```

5. Try out if the library works:

```python
from nwcommitaverages import CommitAverageCalculator

ca_calculator : CommitAverageCalculator = CommitAverageCalculator()
```

6. Exit from the interactive Python environment:

```python
exit()
```

7. Try out if the CLI application works:

```sh
nwcommitaveragescli
```

8. Deactivate and delete the virtual environment:

```sh
deactivate
rm -rf /tmp/nwcommitaverages
```

9. Done!

## Examples

To run it against the current folder (we assume it contains a `git` repository and that `git` itself is installed):

```sh
nwcommitaveragescli
```

```
*****************************************************************
'##::: ##:'##:::::'##::'######:::::'###::::'##::::'##::'######:::
 ###:: ##: ##:'##: ##:'##... ##:::'## ##::: ##:::: ##:'##... ##::
 ####: ##: ##: ##: ##: ##:::..:::'##:. ##:: ##:::: ##: ##:::..:::
 ## ## ##: ##: ##: ##: ##:::::::'##:::. ##: ##:::: ##: ##::'####:
 ##. ####: ##: ##: ##: ##::::::: #########:. ##:: ##:: ##::: ##::
 ##:. ###: ##: ##: ##: ##::: ##: ##.... ##::. ## ##::: ##::: ##::
 ##::. ##:. ###. ###::. ######:: ##:::: ##:::. ###::::. ######:::
..::::..:::...::...::::......:::..:::::..:::::...::::::......::::
**********************************************Version: 2.0.1*****

Folder:'/home'

+-------------+--------+-----------+---------------+------------+
| YearMonth   | Days   | Commits   | DailyAvgMin   | RefNames   |
+=============+========+===========+===============+============+
| 2025-05     | 2      | 29        | 16.71         |            |
+-------------+--------+-----------+---------------+------------+
| 2026-03     | 2      | 26        | 16.43         |            |
+-------------+--------+-----------+---------------+------------+
| 2026-04     | 1      | 4         | 73.76         |            |
+-------------+--------+-----------+---------------+------------+
```

To run it against another folder (which doesn't contain a `git` repository):

```sh
nwcommitaveragescli --folder_path /home/test
```

```
*****************************************************************
'##::: ##:'##:::::'##::'######:::::'###::::'##::::'##::'######:::
 ###:: ##: ##:'##: ##:'##... ##:::'## ##::: ##:::: ##:'##... ##::
 ####: ##: ##: ##: ##: ##:::..:::'##:. ##:: ##:::: ##: ##:::..:::
 ## ## ##: ##: ##: ##: ##:::::::'##:::. ##: ##:::: ##: ##::'####:
 ##. ####: ##: ##: ##: ##::::::: #########:. ##:: ##:: ##::: ##::
 ##:. ###: ##: ##: ##: ##::: ##: ##.... ##::. ## ##::: ##::: ##::
 ##::. ##:. ###. ###::. ######:: ##:::: ##:::. ###::::. ######:::
..::::..:::...::...::::......:::..:::::..:::::...::::::......::::
**********************************************Version: 2.0.1*****

Folder:'/home/test'

Command '['git', '-C', '/home/test', 'log', '--pretty=format:%cs;%ct;%D', '--reverse']' returned non-zero exit status 128.
```

## Links

- Source: https://github.com/numbworks/nwcommitaverages
- License: https://github.com/numbworks/nwcommitaverages/blob/master/LICENSE

## Total Downloads (PyPi)

[![PyPI Downloads](https://static.pepy.tech/personalized-badge/nwcommitaverages?period=total&units=NONE&left_color=BLACK&right_color=BLUE&left_text=TOTAL+DOWNLOADS)](https://pepy.tech/projects/nwcommitaverages)
