github-pages-auditor 1.2.0__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,520 @@
1
+ Metadata-Version: 2.4
2
+ Name: github-pages-auditor
3
+ Version: 1.2.0
4
+ Summary: Audit every public repo of a GitHub user in one command: Pages health, releases and quality checks. JSON/Markdown output and CI exit codes. Works with or without a token.
5
+ Keywords: github,github-pages,auditor,cli,ci,json,repository-health,portfolio
6
+ Author: Alberto Ortiz
7
+ Author-email: Alberto Ortiz <albertoortixsanchez@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Software Development :: Quality Assurance
19
+ Classifier: Topic :: Utilities
20
+ Requires-Dist: python-dotenv>=1.0.0
21
+ Requires-Dist: requests>=2.31.0
22
+ Requires-Dist: rich>=15.0.0
23
+ Maintainer: Alberto Ortiz
24
+ Requires-Python: >=3.10
25
+ Project-URL: Homepage, https://github.com/alberto2005-coder/github-pages-auditor
26
+ Project-URL: Repository, https://github.com/alberto2005-coder/github-pages-auditor
27
+ Project-URL: Issues, https://github.com/alberto2005-coder/github-pages-auditor/issues
28
+ Project-URL: Author, https://github.com/alberto2005-coder/
29
+ Project-URL: Website, https://albertoortiz.is-a.dev/
30
+ Description-Content-Type: text/markdown
31
+
32
+ # GitHub Profile & Pages Auditor
33
+
34
+ [Español](#español) | [English](#english)
35
+
36
+ > Desarrollado por / Developed by **[Alberto Ortiz](https://github.com/alberto2005-coder/)** · 🌐 [albertoortiz.is-a.dev](https://albertoortiz.is-a.dev/)
37
+
38
+ ---
39
+
40
+ <a name="español"></a>
41
+ # Español
42
+
43
+ Herramienta de línea de comandos en Python para auditar los repositorios públicos de un usuario de GitHub: mapea los enlaces de **GitHub Pages** (incluido un dominio personalizado), detecta **releases** y evalúa la calidad del repositorio (README, licencia, `.gitignore` y descripción).
44
+
45
+ Se controla **solo con parámetros de consola**: no necesita archivo `.env`. El **token de la API es opcional**: con token usa la API oficial de GitHub; sin token usa un modo web público de "mejor esfuerzo".
46
+
47
+ ## Índice
48
+
49
+ 1. [Características](#características-es)
50
+ 2. [Modos de funcionamiento: con y sin API](#modos-es)
51
+ 3. [Requisitos previos](#requisitos-previos-es)
52
+ 4. [Instalación](#instalación-es)
53
+ 5. [Uso por línea de comandos](#uso-es)
54
+ 6. [Jerarquía de configuración](#configuración-es)
55
+ 7. [Códigos de salida](#salida-es)
56
+ 8. [Formatos de salida e integración en CI](#formatos-es)
57
+ 9. [Pruebas automatizadas](#pruebas-es)
58
+ 10. [Estructura del proyecto](#estructura-es)
59
+ 11. [Seguridad](#seguridad-es)
60
+ 12. [Autor](#autor-es)
61
+ 13. [Licencia](#licencia-es)
62
+
63
+ ---
64
+
65
+ <a name="características-es"></a>
66
+ ## Características
67
+
68
+ - **Mapeo de GitHub Pages:** raíz (`<usuario>.github.io`) o subruta por repositorio, verificando que la URL responde de verdad.
69
+ - **Releases:** detectadas mediante el feed Atom público, sin consumir cuota de la API.
70
+ - **Auditoría de calidad:** sin README, sin licencia, sin `.gitignore` y sin descripción (About).
71
+ - **Clasificación:** forks y repositorios archivados.
72
+ - **Rendimiento:** todo el análisis se hace en paralelo (`ThreadPoolExecutor`) con reintentos y timeout.
73
+ - **Informe determinista:** los repositorios salen siempre en el mismo orden; un fallo de red en un repo no tumba el resto (se lista aparte).
74
+ - **Créditos del autor** en `--help`, `--version`, la consola y el informe.
75
+
76
+ <a name="modos-es"></a>
77
+ ## Modos de funcionamiento: con y sin API
78
+
79
+ | | Con token (`-k` / `GITHUB_TOKEN`) | Sin token |
80
+ | :--- | :--- | :--- |
81
+ | Fuente de datos | API REST oficial (5.000 peticiones/hora) | Páginas públicas de GitHub (HTML, `raw`, Atom) |
82
+ | Fiabilidad | **Alta** | De mejor esfuerzo: depende del marcado público de GitHub |
83
+ | Límite | 5.000/h | Puede recibir `429` si se abusa |
84
+ | Se activa | Automáticamente si hay token | Si no hay token, o con `--no-api` |
85
+
86
+ El token **solo se envía a `api.github.com`**.
87
+
88
+ **URL de las Pages:** con API se usa la URL real que GitHub tiene configurada (incluido tu dominio personalizado). Sin API, si no indicas `-w`, se prueba `https://<usuario>.github.io/...` y, si GitHub redirige a tu dominio personalizado, se detecta y se muestra ese dominio. Con `-w` se comprueba directamente ese dominio.
89
+
90
+ <a name="requisitos-previos-es"></a>
91
+ ## Requisitos previos
92
+
93
+ - **Python** 3.10 o superior.
94
+ - **Gestor de paquetes:** [`uv`](https://docs.astral.sh/uv/) (recomendado) o `pip`.
95
+
96
+ <a name="instalación-es"></a>
97
+ ## Instalación
98
+
99
+ - **Sin instalar nada (recomendado), con [`uv`](https://docs.astral.sh/uv/):**
100
+ ```bash
101
+ uvx github-pages-auditor -u tu_usuario
102
+ ```
103
+ - **Instalarlo como comando:** `uv tool install github-pages-auditor` o `pip install github-pages-auditor`.
104
+
105
+ El comando antiguo `ver-github-pages` sigue funcionando como alias.
106
+
107
+ Para desarrollar desde el código fuente:
108
+
109
+ ```bash
110
+ git clone https://github.com/alberto2005-coder/github-pages-auditor.git
111
+ cd github-pages-auditor
112
+ ```
113
+
114
+ - **Con `uv` (recomendado):**
115
+ ```bash
116
+ uv sync
117
+ ```
118
+ - **Con `pip`:**
119
+ ```bash
120
+ pip install -e .
121
+ ```
122
+
123
+ <a name="uso-es"></a>
124
+ ## Uso por línea de comandos
125
+
126
+ ```text
127
+ github-pages-auditor -u USUARIO [-w DOMINIO] [-k TOKEN] [-o ARCHIVO] [opciones]
128
+ ```
129
+
130
+ **Ejemplos**
131
+
132
+ ```bash
133
+ # 1. Básico, sin token ni .env (modo web)
134
+ uv run github-pages-auditor -u alberto2005-coder
135
+
136
+ # 2. Con dominio personalizado y token (modo API)
137
+ uv run github-pages-auditor -u alberto2005-coder -w https://albertoortiz.is-a.dev -k ghp_tu_token
138
+
139
+ # 3. Forzar modo web aunque haya token y cambiar el archivo de salida
140
+ uv run github-pages-auditor -u alberto2005-coder -k ghp_tu_token --no-api -o mi_reporte.txt
141
+
142
+ # 4. Token por variable de entorno (más seguro: no queda en el historial del shell)
143
+ GITHUB_TOKEN=ghp_tu_token uv run github-pages-auditor -u alberto2005-coder
144
+
145
+ # 5. También funciona como módulo
146
+ python -m github_pages_auditor -u alberto2005-coder
147
+ ```
148
+
149
+ **Opciones**
150
+
151
+ | Parámetro | Alternativas | Descripción | Obligatorio |
152
+ | :--- | :--- | :--- | :--- |
153
+ | `-u` | `--usuario`, `--user` | Usuario de GitHub | **Sí** (o `USUARIO_GITHUB`) |
154
+ | `-w` | `--web`, `--dominio` | Dominio base de las Pages | No (def. `https://<usuario>.github.io`) |
155
+ | `-k` | `--key`, `--token` | Personal Access Token (activa la API) | No |
156
+ | `-o` | `--output` | Archivo del informe; `-` = salida estándar | No (def. `paginas_github.<formato>`) |
157
+ | `-f` | `--format` | `txt`, `json` o `md` | No (def. `txt`) |
158
+ | `--fail-on` | | Reglas que provocan código de salida 1 (o `any`) | No |
159
+ | `--exclude-forks` | | Ignora los forks | No |
160
+ | `--exclude-archived` | | Ignora los repositorios archivados | No |
161
+ | `--inject` | | Actualiza la tabla de demos dentro de un archivo (README) | No |
162
+ | `-q` | `--quiet` | Sin tablas ni progreso | No |
163
+ | `--workers` | | Hilos en paralelo | No (def. `15`) |
164
+ | `--timeout` | | Timeout por petición, en segundos | No (def. `10`) |
165
+ | `--no-api` | | Fuerza el modo web aunque haya token | No |
166
+ | `--no-color` | | Consola sin colores | No |
167
+ | `--no-env` | | No leer el archivo `.env` | No |
168
+ | `-V` | `--version` | Versión y créditos | No |
169
+ | `-h` | `--help` | Ayuda y créditos | No |
170
+
171
+ <a name="configuración-es"></a>
172
+ ## Jerarquía de configuración
173
+
174
+ 1. **Parámetros de consola** (`-u`, `-w`, `-k`, `-o`…).
175
+ 2. **Variables de entorno**, incluidas las de un archivo `.env` **opcional** en el directorio actual: `USUARIO_GITHUB`, `DOMINIO_WEB`, `GITHUB_TOKEN`, `ARCHIVO_SALIDA`. Un valor vacío se trata como no definido.
176
+ 3. **Valores por defecto.**
177
+
178
+ Hay una plantilla en [`.env.example`](https://github.com/alberto2005-coder/github-pages-auditor/blob/master/.env.example).
179
+
180
+ <a name="salida-es"></a>
181
+ ## Códigos de salida
182
+
183
+ | Código | Significado |
184
+ | :---: | :--- |
185
+ | `0` | Auditoría correcta e informe escrito |
186
+ | `1` | Una regla de `--fail-on` encontró hallazgos (el informe sí se escribe) |
187
+ | `2` | Error: parámetros inválidos, usuario inexistente, token rechazado, límite de tasa, red o escritura |
188
+ | `3` | No hay repositorios que analizar (no se escribe informe) |
189
+ | `130` | Cancelado con Ctrl+C |
190
+
191
+ <a name="formatos-es"></a>
192
+ ## Formatos de salida e integración en CI
193
+
194
+ `-f/--format` elige el formato del informe: `txt` (por defecto), `json` o `md`. Con `-o -` el informe va a la salida estándar y la interfaz a stderr, así que se puede encadenar con otras herramientas:
195
+
196
+ ```bash
197
+ uvx github-pages-auditor -u alberto2005-coder -f json -o - -q | jq '.summary'
198
+ ```
199
+
200
+ **JSON** (`schema_version: 1`): `tool`, `generated_at`, `user`, `mode` (`api`/`web`), `summary` (contadores), `findings` (una lista por regla, vacía si no hay hallazgos), `fail_on` (reglas pedidas y disparadas) y `repos` (un objeto por repositorio, con `pages.status`, `pages.problems`, `pages.warnings`, `pages.title`, etc.).
201
+
202
+ **Markdown** (`-f md`): tabla de tus demos en vivo, ordenada y sin forks, entre los marcadores `<!-- github-pages-auditor:start -->` y `<!-- github-pages-auditor:end -->`. Con `--inject README.md` se actualiza **dentro de ese archivo**, entre esos marcadores (si no existen, falla sin tocar nada).
203
+
204
+ **Reglas de `--fail-on`:** `missing-readme`, `missing-license`, `missing-gitignore`, `missing-description`, `broken-pages`, `analysis-errors` o `any`. Ejemplo: `--fail-on missing-license,broken-pages`.
205
+
206
+ **Salud de Pages.** Para cada sitio se comprueba, además del código 200: errores TLS, timeouts, redirecciones a otro dominio o en bucle, página vacía o sin HTML, y lentitud (aviso). Con **token** se sabe qué repos tienen Pages activadas, así que un 404, un build fallido (`errored`) o cualquier fallo cuenta como **Pages rotas**. Sin token no se puede saber si un repo *debería* tener Pages, por lo que un fallo solo significa "no hay Pages".
207
+
208
+ **Ejemplo de CI (GitHub Actions):**
209
+
210
+ ```yaml
211
+ - run: uvx github-pages-auditor -u ${{ github.repository_owner }} -k ${{ secrets.GITHUB_TOKEN }} -f json -o report.json --fail-on missing-license,broken-pages
212
+ ```
213
+
214
+ <a name="pruebas-es"></a>
215
+ ## Pruebas automatizadas
216
+
217
+ Los tests usan una sesión HTTP falsa: no tocan la red ni consumen cuota de GitHub.
218
+
219
+ ```bash
220
+ uv run pytest # o: pip install -r requirements-dev.txt && pytest
221
+ ```
222
+
223
+ Cubren configuración y prioridades, cliente HTTP, ambos proveedores (API y web), orquestación en paralelo, informe, CLI, códigos de salida y créditos. La integración continua (GitHub Actions) los ejecuta en Linux, macOS y Windows con Python 3.10 y 3.13.
224
+
225
+ <a name="estructura-es"></a>
226
+ ## Estructura del proyecto
227
+
228
+ ```text
229
+ github-pages-auditor/
230
+ ├── .github/workflows/test.yml # Integración continua
231
+ ├── .github/workflows/publish.yml # Publicación en PyPI
232
+ ├── .env.example # Plantilla opcional de variables
233
+ ├── .gitignore
234
+ ├── CHANGELOG.md # Historial de versiones
235
+ ├── LICENSE
236
+ ├── README.md
237
+ ├── pyproject.toml
238
+ ├── requirements.txt # Dependencias para pip
239
+ ├── requirements-dev.txt # + pytest
240
+ ├── uv.lock
241
+ ├── src/github_pages_auditor/
242
+ │ ├── __init__.py # Versión y créditos del autor
243
+ │ ├── __main__.py # python -m github_pages_auditor
244
+ │ ├── main.py # Punto de entrada de la CLI
245
+ │ ├── config.py # Argumentos y entorno
246
+ │ ├── audit.py # Orquestación en paralelo
247
+ │ ├── github_api.py # Proveedor: API oficial (con token)
248
+ │ ├── github_web.py # Proveedor: web pública (sin token)
249
+ │ ├── http.py # Sesión con reintentos y timeout
250
+ │ ├── pages.py # URLs de GitHub Pages
251
+ │ ├── pages_health.py # Salud de Pages (404, TLS, redirecciones...)
252
+ │ ├── rules.py # Reglas de --fail-on
253
+ │ ├── formatters.py # Salidas JSON y Markdown
254
+ │ ├── models.py # Estructuras de datos
255
+ │ ├── errors.py # Excepciones propias
256
+ │ └── report.py # Consola (Rich) e informe .txt
257
+ └── tests/ # Suite de pytest
258
+ ```
259
+
260
+ <a name="seguridad-es"></a>
261
+ ## Seguridad
262
+
263
+ - El token se envía **únicamente** a `api.github.com`, nunca a `github.com`, `raw.githubusercontent.com` ni a tu dominio.
264
+ - Un parámetro `-k` queda en el historial del shell: es preferible la variable `GITHUB_TOKEN`.
265
+ - No subas tu `.env` a git (ya está en `.gitignore`). Para esta herramienta basta un token sin permisos especiales (repos públicos).
266
+
267
+ <a name="autor-es"></a>
268
+ ## Autor
269
+
270
+ Desarrollado por **Alberto Ortiz**.
271
+
272
+ - GitHub: <https://github.com/alberto2005-coder/>
273
+ - Web personal: <https://albertoortiz.is-a.dev/>
274
+
275
+ <a name="licencia-es"></a>
276
+ ## Licencia
277
+
278
+ Distribuido bajo la Licencia MIT. Consulta [LICENSE](https://github.com/alberto2005-coder/github-pages-auditor/blob/master/LICENSE).
279
+
280
+ ---
281
+
282
+ <a name="english"></a>
283
+ # English
284
+
285
+ Python command-line tool that audits a GitHub user's public repositories: it maps **GitHub Pages** links (including a custom domain), detects **releases**, and checks repository quality (README, license, `.gitignore` and description).
286
+
287
+ It is driven **entirely by command-line parameters**: no `.env` file needed. The **API token is optional**: with a token it uses the official GitHub API; without one it falls back to a best-effort public web mode.
288
+
289
+ ## Table of Contents
290
+
291
+ 1. [Features](#features-en)
292
+ 2. [Operating modes: with and without API](#modes-en)
293
+ 3. [Prerequisites](#prerequisites-en)
294
+ 4. [Installation](#installation-en)
295
+ 5. [Command-line usage](#usage-en)
296
+ 6. [Configuration precedence](#configuration-en)
297
+ 7. [Exit codes](#exit-en)
298
+ 8. [Output formats and CI integration](#formats-en)
299
+ 9. [Automated tests](#tests-en)
300
+ 10. [Project structure](#structure-en)
301
+ 11. [Security](#security-en)
302
+ 12. [Author](#author-en)
303
+ 13. [License](#license-en)
304
+
305
+ ---
306
+
307
+ <a name="features-en"></a>
308
+ ## Features
309
+
310
+ - **GitHub Pages mapping:** root (`<user>.github.io`) or per-repository subpath, verifying that the URL really responds.
311
+ - **Releases:** detected through the public Atom feed, without using API quota.
312
+ - **Quality audit:** missing README, license, `.gitignore` and description (About).
313
+ - **Classification:** forks and archived repositories.
314
+ - **Performance:** all checks run in parallel (`ThreadPoolExecutor`) with retries and timeouts.
315
+ - **Deterministic report:** repositories always appear in the same order; a network failure on one repo does not abort the rest (it is listed separately).
316
+ - **Author credits** in `--help`, `--version`, the console and the report.
317
+
318
+ <a name="modes-en"></a>
319
+ ## Operating modes: with and without API
320
+
321
+ | | With token (`-k` / `GITHUB_TOKEN`) | Without token |
322
+ | :--- | :--- | :--- |
323
+ | Data source | Official REST API (5,000 requests/hour) | Public GitHub pages (HTML, `raw`, Atom) |
324
+ | Reliability | **High** | Best effort: depends on GitHub's public markup |
325
+ | Limit | 5,000/h | May receive `429` if abused |
326
+ | Enabled | Automatically when a token is present | When no token is given, or with `--no-api` |
327
+
328
+ The token is **only ever sent to `api.github.com`**.
329
+
330
+ **Pages URL:** with the API, the real URL configured on GitHub is used (including your custom domain). Without the API and without `-w`, `https://<user>.github.io/...` is tried and, if GitHub redirects to your custom domain, that domain is detected and shown. With `-w`, that domain is checked directly.
331
+
332
+ <a name="prerequisites-en"></a>
333
+ ## Prerequisites
334
+
335
+ - **Python** 3.10 or higher.
336
+ - **Package manager:** [`uv`](https://docs.astral.sh/uv/) (recommended) or `pip`.
337
+
338
+ <a name="installation-en"></a>
339
+ ## Installation
340
+
341
+ - **Without installing anything (recommended), with [`uv`](https://docs.astral.sh/uv/):**
342
+ ```bash
343
+ uvx github-pages-auditor -u your_user
344
+ ```
345
+ - **Install it as a command:** `uv tool install github-pages-auditor` or `pip install github-pages-auditor`.
346
+
347
+ The old `ver-github-pages` command keeps working as an alias.
348
+
349
+ To work from source:
350
+
351
+ ```bash
352
+ git clone https://github.com/alberto2005-coder/github-pages-auditor.git
353
+ cd github-pages-auditor
354
+ ```
355
+
356
+ - **Using `uv` (recommended):**
357
+ ```bash
358
+ uv sync
359
+ ```
360
+ - **Using `pip`:**
361
+ ```bash
362
+ pip install -e .
363
+ ```
364
+
365
+ <a name="usage-en"></a>
366
+ ## Command-line usage
367
+
368
+ ```text
369
+ github-pages-auditor -u USER [-w DOMAIN] [-k TOKEN] [-o FILE] [options]
370
+ ```
371
+
372
+ **Examples**
373
+
374
+ ```bash
375
+ # 1. Basic, no token and no .env (web mode)
376
+ uv run github-pages-auditor -u alberto2005-coder
377
+
378
+ # 2. Custom domain and token (API mode)
379
+ uv run github-pages-auditor -u alberto2005-coder -w https://albertoortiz.is-a.dev -k ghp_your_token
380
+
381
+ # 3. Force web mode even with a token, and change the output file
382
+ uv run github-pages-auditor -u alberto2005-coder -k ghp_your_token --no-api -o my_report.txt
383
+
384
+ # 4. Token from an environment variable (safer: not stored in shell history)
385
+ GITHUB_TOKEN=ghp_your_token uv run github-pages-auditor -u alberto2005-coder
386
+
387
+ # 5. Also works as a module
388
+ python -m github_pages_auditor -u alberto2005-coder
389
+ ```
390
+
391
+ **Options**
392
+
393
+ | Flag | Aliases | Description | Required |
394
+ | :--- | :--- | :--- | :--- |
395
+ | `-u` | `--usuario`, `--user` | GitHub username | **Yes** (or `USUARIO_GITHUB`) |
396
+ | `-w` | `--web`, `--dominio` | Base domain of the Pages site | No (default `https://<user>.github.io`) |
397
+ | `-k` | `--key`, `--token` | Personal Access Token (enables the API) | No |
398
+ | `-o` | `--output` | Report file; `-` = standard output | No (default `paginas_github.<format>`) |
399
+ | `-f` | `--format` | `txt`, `json` or `md` | No (default `txt`) |
400
+ | `--fail-on` | | Rules that cause exit code 1 (or `any`) | No |
401
+ | `--exclude-forks` | | Ignore forks | No |
402
+ | `--exclude-archived` | | Ignore archived repositories | No |
403
+ | `--inject` | | Update the demos table inside a file (README) | No |
404
+ | `-q` | `--quiet` | No tables or progress | No |
405
+ | `--workers` | | Parallel threads | No (default `15`) |
406
+ | `--timeout` | | Per-request timeout, in seconds | No (default `10`) |
407
+ | `--no-api` | | Force web mode even with a token | No |
408
+ | `--no-color` | | Colorless console output | No |
409
+ | `--no-env` | | Do not read the `.env` file | No |
410
+ | `-V` | `--version` | Version and credits | No |
411
+ | `-h` | `--help` | Help and credits | No |
412
+
413
+ <a name="configuration-en"></a>
414
+ ## Configuration precedence
415
+
416
+ 1. **Command-line parameters** (`-u`, `-w`, `-k`, `-o`…).
417
+ 2. **Environment variables**, including those from an **optional** `.env` file in the current directory: `USUARIO_GITHUB`, `DOMINIO_WEB`, `GITHUB_TOKEN`, `ARCHIVO_SALIDA`. An empty value counts as unset.
418
+ 3. **Built-in defaults.**
419
+
420
+ A template is provided in [`.env.example`](https://github.com/alberto2005-coder/github-pages-auditor/blob/master/.env.example).
421
+
422
+ <a name="exit-en"></a>
423
+ ## Exit codes
424
+
425
+ | Code | Meaning |
426
+ | :---: | :--- |
427
+ | `0` | Audit succeeded and report written |
428
+ | `1` | A `--fail-on` rule found issues (the report is still written) |
429
+ | `2` | Error: invalid parameters, unknown user, rejected token, rate limit, network or write failure |
430
+ | `3` | No repositories to analyze (no report is written) |
431
+ | `130` | Cancelled with Ctrl+C |
432
+
433
+ <a name="formats-en"></a>
434
+ ## Output formats and CI integration
435
+
436
+ `-f/--format` selects the report format: `txt` (default), `json` or `md`. With `-o -` the report goes to standard output and the UI to stderr, so it can be piped:
437
+
438
+ ```bash
439
+ uvx github-pages-auditor -u alberto2005-coder -f json -o - -q | jq '.summary'
440
+ ```
441
+
442
+ **JSON** (`schema_version: 1`): `tool`, `generated_at`, `user`, `mode` (`api`/`web`), `summary` (counters), `findings` (one list per rule, empty when clean), `fail_on` (requested and triggered rules) and `repos` (one object per repository, with `pages.status`, `pages.problems`, `pages.warnings`, `pages.title`, etc.).
443
+
444
+ **Markdown** (`-f md`): a sorted table of your live demos, forks excluded, between the `<!-- github-pages-auditor:start -->` and `<!-- github-pages-auditor:end -->` markers. `--inject README.md` updates it **inside that file**, between those markers (if they are missing it fails without touching anything).
445
+
446
+ **`--fail-on` rules:** `missing-readme`, `missing-license`, `missing-gitignore`, `missing-description`, `broken-pages`, `analysis-errors` or `any`. Example: `--fail-on missing-license,broken-pages`.
447
+
448
+ **Pages health.** Besides a 200 status, each site is checked for TLS errors, timeouts, redirects to another domain or loops, empty or non-HTML pages, and slowness (warning). With a **token** the tool knows which repos have Pages enabled, so a 404, a failed build (`errored`) or any failure counts as **broken Pages**. Without a token it cannot know whether a repo *should* have Pages, so a failure just means "no Pages".
449
+
450
+ **CI example (GitHub Actions):**
451
+
452
+ ```yaml
453
+ - run: uvx github-pages-auditor -u ${{ github.repository_owner }} -k ${{ secrets.GITHUB_TOKEN }} -f json -o report.json --fail-on missing-license,broken-pages
454
+ ```
455
+
456
+ <a name="tests-en"></a>
457
+ ## Automated tests
458
+
459
+ Tests use a fake HTTP session: they never touch the network or use GitHub quota.
460
+
461
+ ```bash
462
+ uv run pytest # or: pip install -r requirements-dev.txt && pytest
463
+ ```
464
+
465
+ They cover configuration and precedence, the HTTP client, both providers (API and web), parallel orchestration, the report, the CLI, exit codes and credits. Continuous integration (GitHub Actions) runs them on Linux, macOS and Windows with Python 3.10 and 3.13.
466
+
467
+ <a name="structure-en"></a>
468
+ ## Project structure
469
+
470
+ ```text
471
+ github-pages-auditor/
472
+ ├── .github/workflows/test.yml # Continuous integration
473
+ ├── .github/workflows/publish.yml # PyPI publishing
474
+ ├── .env.example # Optional variables template
475
+ ├── .gitignore
476
+ ├── CHANGELOG.md # Version history
477
+ ├── LICENSE
478
+ ├── README.md
479
+ ├── pyproject.toml
480
+ ├── requirements.txt # pip dependencies
481
+ ├── requirements-dev.txt # + pytest
482
+ ├── uv.lock
483
+ ├── src/github_pages_auditor/
484
+ │ ├── __init__.py # Version and author credits
485
+ │ ├── __main__.py # python -m github_pages_auditor
486
+ │ ├── main.py # CLI entry point
487
+ │ ├── config.py # Arguments and environment
488
+ │ ├── audit.py # Parallel orchestration
489
+ │ ├── github_api.py # Provider: official API (with token)
490
+ │ ├── github_web.py # Provider: public web (no token)
491
+ │ ├── http.py # Session with retries and timeout
492
+ │ ├── pages.py # GitHub Pages URLs
493
+ │ ├── pages_health.py # Pages health (404, TLS, redirects...)
494
+ │ ├── rules.py # --fail-on rules
495
+ │ ├── formatters.py # JSON and Markdown output
496
+ │ ├── models.py # Data structures
497
+ │ ├── errors.py # Custom exceptions
498
+ │ └── report.py # Console (Rich) and .txt report
499
+ └── tests/ # pytest suite
500
+ ```
501
+
502
+ <a name="security-en"></a>
503
+ ## Security
504
+
505
+ - The token is sent **only** to `api.github.com`, never to `github.com`, `raw.githubusercontent.com` or your own domain.
506
+ - A `-k` parameter is stored in your shell history: prefer the `GITHUB_TOKEN` environment variable.
507
+ - Do not commit your `.env` (it is already in `.gitignore`). A token with no special scopes (public repos) is enough for this tool.
508
+
509
+ <a name="author-en"></a>
510
+ ## Author
511
+
512
+ Developed by **Alberto Ortiz**.
513
+
514
+ - GitHub: <https://github.com/alberto2005-coder/>
515
+ - Personal website: <https://albertoortiz.is-a.dev/>
516
+
517
+ <a name="license-en"></a>
518
+ ## License
519
+
520
+ Distributed under the MIT License. See [LICENSE](https://github.com/alberto2005-coder/github-pages-auditor/blob/master/LICENSE).
@@ -0,0 +1,20 @@
1
+ github_pages_auditor/__init__.py,sha256=31LPx-um40rdUM4CHA7JJmIFlaM5h5jHUzC-jhnCufw,477
2
+ github_pages_auditor/__main__.py,sha256=cwKJAAML0RRKT9Qbzcwf07HHcuSd8oh7kx4P1apndWQ,84
3
+ github_pages_auditor/audit.py,sha256=nZYlQ-X4lhlRTqUs3613HXn7YihRDGdqt_hT2OVzXlI,3761
4
+ github_pages_auditor/config.py,sha256=emudswKjvBoTnbFXcfyJxrJZaAkRgVuHeKwXaUm09LM,7302
5
+ github_pages_auditor/errors.py,sha256=pmcUPiiJTRlz0q0adM1gBEn7LmuEFfo_zNm5PfeUWdQ,527
6
+ github_pages_auditor/formatters.py,sha256=Uz8O-2WDkHC9QVmKwJJxBCpGEEIZxEolaQgjDP2myU8,4658
7
+ github_pages_auditor/github_api.py,sha256=ng4Liho2J-TIYTmq0WnrFnaDAsO_Bfy2NIvR-iAKyDQ,5792
8
+ github_pages_auditor/github_web.py,sha256=efKzVjjDSKAvn3FMkbA_HU6XYvMKlAV-jjqj-d0mpJ8,4754
9
+ github_pages_auditor/http.py,sha256=SgTjwUqLw1Qqk_PBqBl-cbhxPlLMS1WV625D_BPdiMY,1634
10
+ github_pages_auditor/main.py,sha256=Zn3XritrLsdkCUzuT-8_XAAkNLoNcLa2lBnEwVeLvTs,4363
11
+ github_pages_auditor/models.py,sha256=MvHJMBI4Dsy8XKMrNwBRrjmOwJ9juk8wwB4ZdsQLyZs,3863
12
+ github_pages_auditor/pages.py,sha256=8J-pY6wxspKFVHfoRT6n2AcNcH6w_WuyXfAiV5Su0z8,1782
13
+ github_pages_auditor/pages_health.py,sha256=n_xD1kVw2aNrz_cJHx4QLek8LVQ6sWZQ74I0fwl-vXo,3811
14
+ github_pages_auditor/report.py,sha256=PcQzwIARyfBObDLhjTGAyRv5sPaZugArqAzpdQA2yC8,4854
15
+ github_pages_auditor/rules.py,sha256=Mvy9edRUEf84DBC6Arf3XLZrVUStAbEcekpB7ammX-I,1883
16
+ github_pages_auditor-1.2.0.dist-info/licenses/LICENSE,sha256=wNZmqqZg01ZnCIXzwsBOS8y4vCGmJPvG7MXbcbGfgMQ,1069
17
+ github_pages_auditor-1.2.0.dist-info/WHEEL,sha256=3OmCxFA0ffBIsX4x0o8CdfSvZAOvO3mzEG8U_z5TvV4,80
18
+ github_pages_auditor-1.2.0.dist-info/entry_points.txt,sha256=oX2j9yyCGDBEkfiUX-R4spIG_0McoYTzaISzdbrupDc,123
19
+ github_pages_auditor-1.2.0.dist-info/METADATA,sha256=j1m1n4YAFRYHKrGuZOk-Bj7c_Kj1fKIL8qyBPFAVOa0,23835
20
+ github_pages_auditor-1.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.13.8
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ github-pages-auditor = github_pages_auditor.main:main
3
+ ver-github-pages = github_pages_auditor.main:main
4
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alberto Ortiz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.