Metadata-Version: 2.4
Name: gitlab-activity-report
Version: 0.1.3
Summary: Collect GitLab group activity and render static JSON/HTML reports
Author-email: Dan White <dan@whiteaudio.com>
License: MIT License
        
        Copyright (c) 2026 Dan White
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://gitlab.com/wiredlab/gitlab-activity-report
Project-URL: Issues, https://gitlab.com/wiredlab/gitlab-activity-report/-/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31.0
Requires-Dist: requests-cache>=1.2.0
Dynamic: license-file

## gitlab-activity-report

Collects GitLab activity for a parent group (and descendants), outputs a JSON report with both `by_user` and `by_project`, and writes a fully static HTML viewer.

## Install

```bash
pip install .
```

This installs the console executable:

```bash
gitlab-activity-report --help
```

You can also run from source checkout:

```bash
./gitlab-activity-report --help
```

## Usage

```bash
gitlab-activity-report \
  60207604 \
  --start 2026-W05 \
  --end 2026-W06 \
  --output-json report.json \
  --output-html report.html
```

## Authentication

A GitLab access token is required. Provide it either by environment variable or CLI option.

Environment variable:

```bash
export GITLAB_ACCESS_TOKEN="glpat-..."
gitlab-activity-report 60207604 --start 2026-W05 --end 2026-W06
```

CLI option:

```bash
gitlab-activity-report --access-token "glpat-..." 60207604 --start 2026-W05 --end 2026-W06
```

Token requirements:
- Role: `Reporter`
- Scope: `read_api`

## User Mapping File

`gitlab-activity-report` expects a user mapping file at `username_author.json` by default (or provide a path with `--usermap`).

Start from the included example file:

```bash
cp username_author.json.example username_author.json
```

This mapping is used to map git commit author name/email values to GitLab usernames.

## Output shape

`report.json` contains:

- `meta`: report metadata (`generated_at`, `group_id`, date range)
- `by_user`: activity grouped by user, then project
- `by_project`: project-centric activity keyed by namespace path/id

Each project entry includes group context:

- `group.full_path`
- `group.path_from_start` (subgroup tree path relative to selected start group)
- `path_with_namespace` relative to the selected base group path

Each activity includes:

- `actor`
- `activity_heading` (`{actor}: {activity_type} - {body or title}`)
- `activity_type`
- `title`
- timestamps (`created_at`, `updated_at`)
- optional detail payloads from GitLab APIs

`report.html` is standalone and static (no external scripts/styles/requests).

## License

MIT. See `LICENSE`.

## Releasing

Release process and CI publishing details are documented in `RELEASING.md`.
