feat: initial project structure
- GitLabClient: REST Events API z paginacją, pobieranie członków grupy - Aggregator: zliczanie commitów, MR, komentarzy per użytkownik - Exporter: generowanie pliku Excel (openpyxl) ze stylami - main.py: CLI (click) + .env support - README, .env.example, requirements.txt, .gitignore
This commit is contained in:
57
README.md
Normal file
57
README.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# gitlab-contribution
|
||||
|
||||
Narzędzie do eksportu statystyk aktywności użytkowników z GitLab do pliku Excel.
|
||||
|
||||
## Co robi
|
||||
|
||||
- Pobiera dane z GitLab GraphQL API (Events) dla zadanej grupy i zakresu dat
|
||||
- Agreguje: contributions, commity, merge requesty, komentarze
|
||||
- Generuje plik `.xlsx` z podsumowaniem per użytkownik
|
||||
|
||||
## Wymagania
|
||||
|
||||
```
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## Konfiguracja
|
||||
|
||||
Skopiuj `.env.example` do `.env` i uzupełnij:
|
||||
|
||||
```env
|
||||
GITLAB_URL=https://gitlab.com
|
||||
GITLAB_TOKEN=your_personal_access_token
|
||||
GITLAB_GROUP=your-group-path
|
||||
DATE_FROM=2024-01-01
|
||||
DATE_TO=2024-12-31
|
||||
OUTPUT_FILE=raport.xlsx
|
||||
```
|
||||
|
||||
## Użycie
|
||||
|
||||
```bash
|
||||
python main.py
|
||||
```
|
||||
|
||||
Lub z parametrami CLI:
|
||||
|
||||
```bash
|
||||
python main.py --group my-group --from 2024-01-01 --to 2024-12-31 --output raport.xlsx
|
||||
```
|
||||
|
||||
## Struktura pliku Excel
|
||||
|
||||
| Użytkownik | Username | Contributions | Commity | Merge Requesty | Komentarze |
|
||||
|------------|----------|---------------|---------|----------------|------------|
|
||||
| Jan Kowalski | jkowalski | 142 | 89 | 23 | 30 |
|
||||
|
||||
## Jak działa
|
||||
|
||||
1. `gitlab_client.py` — klient GraphQL, pobiera events z GitLab API
|
||||
2. `aggregator.py` — agreguje dane per użytkownik
|
||||
3. `exporter.py` — generuje plik Excel (openpyxl)
|
||||
4. `main.py` — punkt wejścia, CLI
|
||||
|
||||
## Limity GitLab API
|
||||
|
||||
GitLab Events API zwraca max 100 eventów na stronę. Klient automatycznie obsługuje paginację.
|
||||
Reference in New Issue
Block a user