gamesize 1.0.1__tar.gz
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.
- gamesize-1.0.1/CHANGELOG.es.md +93 -0
- gamesize-1.0.1/CHANGELOG.md +93 -0
- gamesize-1.0.1/CONTRIBUTING.es.md +53 -0
- gamesize-1.0.1/CONTRIBUTING.md +53 -0
- gamesize-1.0.1/LICENSE +21 -0
- gamesize-1.0.1/MANIFEST.in +15 -0
- gamesize-1.0.1/PKG-INFO +235 -0
- gamesize-1.0.1/README.es.md +205 -0
- gamesize-1.0.1/README.md +205 -0
- gamesize-1.0.1/SECURITY.es.md +32 -0
- gamesize-1.0.1/SECURITY.md +32 -0
- gamesize-1.0.1/docs/ARCHITECTURE.es.md +49 -0
- gamesize-1.0.1/docs/ARCHITECTURE.md +49 -0
- gamesize-1.0.1/docs/BENCHMARKS.es.md +49 -0
- gamesize-1.0.1/docs/BENCHMARKS.md +49 -0
- gamesize-1.0.1/docs/DATA.es.md +104 -0
- gamesize-1.0.1/docs/DATA.md +104 -0
- gamesize-1.0.1/docs/EXAMPLES.es.md +91 -0
- gamesize-1.0.1/docs/EXAMPLES.md +91 -0
- gamesize-1.0.1/docs/FAQ.es.md +37 -0
- gamesize-1.0.1/docs/FAQ.md +37 -0
- gamesize-1.0.1/docs/PUBLISHING.es.md +43 -0
- gamesize-1.0.1/docs/PUBLISHING.md +43 -0
- gamesize-1.0.1/docs/workbook.png +0 -0
- gamesize-1.0.1/gamesize.egg-info/PKG-INFO +235 -0
- gamesize-1.0.1/gamesize.egg-info/SOURCES.txt +57 -0
- gamesize-1.0.1/gamesize.egg-info/dependency_links.txt +1 -0
- gamesize-1.0.1/gamesize.egg-info/entry_points.txt +2 -0
- gamesize-1.0.1/gamesize.egg-info/requires.txt +6 -0
- gamesize-1.0.1/gamesize.egg-info/top_level.txt +1 -0
- gamesize-1.0.1/inventory/__init__.py +4 -0
- gamesize-1.0.1/inventory/__main__.py +7 -0
- gamesize-1.0.1/inventory/cell_format.py +175 -0
- gamesize-1.0.1/inventory/cli.py +856 -0
- gamesize-1.0.1/inventory/config.py +104 -0
- gamesize-1.0.1/inventory/data.py +278 -0
- gamesize-1.0.1/inventory/excel.py +1022 -0
- gamesize-1.0.1/inventory/i18n.py +688 -0
- gamesize-1.0.1/inventory/network.py +495 -0
- gamesize-1.0.1/inventory/scan.py +74 -0
- gamesize-1.0.1/inventory/text.py +9 -0
- gamesize-1.0.1/pyproject.toml +50 -0
- gamesize-1.0.1/requirements-dev.txt +3 -0
- gamesize-1.0.1/requirements.txt +1 -0
- gamesize-1.0.1/setup.cfg +4 -0
- gamesize-1.0.1/tests/test_basico.py +219 -0
- gamesize-1.0.1/tests/test_env.py +52 -0
- gamesize-1.0.1/tests/test_http.py +83 -0
- gamesize-1.0.1/tests/test_integracion.py +998 -0
- gamesize-1.0.1/tests/test_network.py +324 -0
- gamesize-1.0.1/tests/test_offline.py +75 -0
- gamesize-1.0.1/tests/test_robustez.py +886 -0
- gamesize-1.0.1/tests/test_tools.py +283 -0
- gamesize-1.0.1/tools/__init__.py +1 -0
- gamesize-1.0.1/tools/check_all.py +37 -0
- gamesize-1.0.1/tools/check_dist.py +66 -0
- gamesize-1.0.1/tools/check_i18n.py +75 -0
- gamesize-1.0.1/tools/check_links.py +44 -0
- gamesize-1.0.1/tools/check_release.py +48 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Registro de cambios
|
|
2
|
+
|
|
3
|
+
Cambios destacados del proyecto. El formato sigue [Keep a Changelog](https://keepachangelog.com/es-ES/1.1.0/) y el proyecto usa versionado semántico.
|
|
4
|
+
|
|
5
|
+
## [1.0.1] - 2026-11-24
|
|
6
|
+
|
|
7
|
+
### Cambiado
|
|
8
|
+
|
|
9
|
+
- La distribución se llama `gamesize`. PyPI rechazó `game-inventory` por parecerse a un proyecto existente. El comando sigue siendo `game-inventory` y el paquete que se importa sigue siendo `inventory`.
|
|
10
|
+
|
|
11
|
+
## [1.0.0] - 2026-11-23
|
|
12
|
+
|
|
13
|
+
### Añadido
|
|
14
|
+
|
|
15
|
+
- Escaneo de todas las bibliotecas configuradas, con tamaño en GB y días instalado.
|
|
16
|
+
- Horas de Deku Deals, twoaveragegamers, estimación con reseñas de Steam, Metascore y porcentaje de reseñas de Steam.
|
|
17
|
+
- Excel con las hojas Games, Space, Summary, Plan, History y Wishlist.
|
|
18
|
+
- Salida en inglés y español con `--lang en|es`.
|
|
19
|
+
- Escritura atómica de JSON, histórico y libro.
|
|
20
|
+
- Bloqueo exclusivo para que no se solapen dos ejecuciones.
|
|
21
|
+
- Copia antes de purgar y copia `.corrupto` del histórico roto.
|
|
22
|
+
- Freno de purga que se niega a borrar más de la mitad de las claves sin `--force-purge`.
|
|
23
|
+
- Paquete instalable con el comando `game-inventory`.
|
|
24
|
+
- Suite completa de pruebas, umbral de cobertura y lint en CI.
|
|
25
|
+
- `--dry-run` / `--simular`: escanea y muestra el resumen sin escribir el libro, el histórico, los JSON ni purgar.
|
|
26
|
+
- `--check-data` / `--validar`: valida los ficheros JSON, `config.json`, las claves de metadatos huérfanas, los valores de metadatos inválidos, los títulos repetidos de la wishlist y el histórico, y sale sin escanear ni escribir.
|
|
27
|
+
- `--strict` / `--estricto`: con `--check-data`, sale con código 1 si hay avisos.
|
|
28
|
+
- La comprobación de datos nombra las claves huérfanas e informa de claves desconocidas en la configuración, claves sin normalizar en `hours.json`, choques al normalizar, títulos de completados/jugando que no están en `hours.json` y juegos marcados como completados y jugando a la vez.
|
|
29
|
+
- La comprobación de datos también informa de bibliotecas accesibles, una salida dentro de `data/` y fechas del histórico repetidas o futuras.
|
|
30
|
+
- La comprobación de datos informa de bloques de metadatos que no son objetos, títulos que no son texto en `completed.json` o `playing.json` y filas del histórico sin ordenar, y muestra el total de avisos.
|
|
31
|
+
- La comprobación de datos informa de claves de configuración con tipo incorrecto.
|
|
32
|
+
- La comprobación de datos informa de claves JSON repetidas y de claves que quedan vacías al normalizar.
|
|
33
|
+
- La comprobación de datos informa de una misma ruta de biblioteca configurada dos veces.
|
|
34
|
+
- La comprobación de datos nombra las carpetas de biblioteca que no existen y valida las fechas de origen dentro de los metadatos.
|
|
35
|
+
- La comprobación de datos informa de campos que no son texto dentro de los metadatos y de una fecha `_actualizado` mal formada.
|
|
36
|
+
- El user agent de red usa la versión instalada del paquete.
|
|
37
|
+
- `--open` / `--abrir`: abre el libro con la aplicación predeterminada al guardarlo.
|
|
38
|
+
- Ayuda con ejemplos de uso.
|
|
39
|
+
- `--top N`: muestra los mejores GB/h que no estén completados ni en curso.
|
|
40
|
+
- `--report` / `--informe`: escribe un resumen Markdown de la ejecución. El número de elecciones sigue a `--top`. El informe no puede estar dentro de `data/` ni sobrescribir el libro.
|
|
41
|
+
- Los totales del informe incluyen los GB completados, los juegos en curso y los que no tienen datos.
|
|
42
|
+
- La ruta del informe se rechaza antes de escanear si es una carpeta.
|
|
43
|
+
- `GAME_INVENTORY_LANG` fija el idioma por defecto; `--lang` tiene prioridad.
|
|
44
|
+
- Ctrl+C se captura: el comando muestra `Cancelado.` y sale con código 130.
|
|
45
|
+
- Metadatos del libro (título, autor, asunto, descripción y palabras clave) y configuración de impresión horizontal ajustada al ancho.
|
|
46
|
+
- El libro marca `game-inventory` también como último modificador.
|
|
47
|
+
- `tools/check_release.py`: el flujo de release comprueba la etiqueta, la versión y los dos changelogs.
|
|
48
|
+
- La hoja Plan mantiene la cabecera visible al desplazarse.
|
|
49
|
+
- La hoja Plan tiene filtro automático en la cabecera.
|
|
50
|
+
- `--report` crea las carpetas necesarias para la ruta del informe.
|
|
51
|
+
- La hoja Historico tiene filtro automático en la cabecera.
|
|
52
|
+
- La normalización de nombres vive en `inventory/text.py` y la comparten `data.py` y `config.py`.
|
|
53
|
+
- La hoja Resumen muestra la fecha de generación.
|
|
54
|
+
- `--top` rechaza valores negativos.
|
|
55
|
+
- `data/config.json` puede sustituir bibliotecas, rutas sueltas, exclusiones y ruta de salida. `~` se expande en todas las rutas.
|
|
56
|
+
- Avisos de progreso para el escaneo de carpetas y el paso de red.
|
|
57
|
+
- `tools/check_i18n.py`: falla si las claves o los marcadores de inglés y español difieren, o si una clave de traducción está repetida.
|
|
58
|
+
- Textos de ayuda traducidos, así que `--help` sigue a `--lang`.
|
|
59
|
+
- `docs/DATA.es.md`, `docs/ARCHITECTURE.es.md` y `SECURITY.es.md`.
|
|
60
|
+
- `docs/EXAMPLES.es.md`: ejemplos de consola, libro y carpeta de datos.
|
|
61
|
+
- `docs/FAQ.es.md`: dudas sobre privacidad, horas, bibliotecas y errores.
|
|
62
|
+
- `docs/BENCHMARKS.es.md`: tiempos de escaneo y libro para 100, 500 y 1000 juegos, y la biblioteca real.
|
|
63
|
+
- `docs/PUBLISHING.es.md`: construcción, PyPI Trusted Publishing y la alternativa con token.
|
|
64
|
+
- `docs/PUBLISHING.es.md` recoge el conflicto de nombre con `gameinventory` en PyPI.
|
|
65
|
+
- `tests/test_offline.py`: bloquea `socket.socket` y `socket.create_connection` y demuestra que `--offline` no abre ningún socket.
|
|
66
|
+
- Plantillas de incidencia y de pull request, y EditorConfig.
|
|
67
|
+
- Análisis CodeQL en cada push, en cada pull request y semanal.
|
|
68
|
+
- Flujo de release: una etiqueta `v*` construye el wheel y el sdist, los revisa y publica una release de GitHub.
|
|
69
|
+
- `tools/check_links.py`: falla si un enlace relativo de la documentación está roto.
|
|
70
|
+
- `tools/check_all.py`: ejecuta pyflakes, la comprobación de enlaces y la de traducciones en un solo comando.
|
|
71
|
+
- Dependabot agrupa las actualizaciones menores y de parche en un pull request por ecosistema.
|
|
72
|
+
- CodeQL también se puede iniciar a mano.
|
|
73
|
+
- Instrucciones de instalación con pipx.
|
|
74
|
+
- Actualizaciones de Dependabot para pip y GitHub Actions.
|
|
75
|
+
- Guía de contribución en inglés y español.
|
|
76
|
+
- Palabras clave y clasificadores del paquete.
|
|
77
|
+
|
|
78
|
+
### Cambiado
|
|
79
|
+
|
|
80
|
+
- El CI cachea las descargas de pip, cancela ejecuciones sustituidas, usa permisos de solo lectura y un límite de 15 minutos.
|
|
81
|
+
- El CI construye el wheel y el sdist, comprueba que no llevan `data/`, instala el wheel y lo ejecuta.
|
|
82
|
+
- La comprobación del paquete rechaza las herramientas de desarrollo en el wheel y las exige en el sdist.
|
|
83
|
+
- El CI también instala el sdist y ejecuta el comando instalado.
|
|
84
|
+
- Umbral de cobertura subido del 97% al 98%; Windows y Ubuntu dan ahora un 99%.
|
|
85
|
+
- La fuente de cobertura y el umbral del 98% viven en `pyproject.toml`.
|
|
86
|
+
- El comando instalado `game-inventory` lee `data/` del checkout o de la carpeta actual. `GAME_INVENTORY_DATA` lo cambia.
|
|
87
|
+
- README: limitaciones, preparación de pruebas y enlaces a benchmarks.
|
|
88
|
+
- README: captura del libro de ejemplo con juegos ficticios y sin rutas personales.
|
|
89
|
+
|
|
90
|
+
### Seguridad
|
|
91
|
+
|
|
92
|
+
- El texto de JSON y del libro se mantiene como texto, así que un nombre que empieza por `=` no se trata como fórmula.
|
|
93
|
+
- Los caracteres de control se eliminan de celdas y comentarios de Excel.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses semantic versioning.
|
|
4
|
+
|
|
5
|
+
## [1.0.1] - 2026-11-24
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Distribution name changed to `gamesize`. PyPI rejected `game-inventory` as too similar to an existing project. The command is still `game-inventory` and the import package is still `inventory`.
|
|
10
|
+
|
|
11
|
+
## [1.0.0] - 2026-11-23
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- Scan of every configured game library, with size in GB and days installed.
|
|
16
|
+
- Hours from Deku Deals, twoaveragegamers, Steam review estimates, Metascore and Steam review percentage.
|
|
17
|
+
- Excel workbook with Games, Space, Summary, Plan, History and Wishlist sheets.
|
|
18
|
+
- English and Spanish output with `--lang en|es`.
|
|
19
|
+
- Atomic writes for JSON, history and the workbook.
|
|
20
|
+
- Exclusive lock so two runs cannot overlap.
|
|
21
|
+
- Backup before purging and `.corrupto` copy of a broken history.
|
|
22
|
+
- Purge guard that refuses to remove more than half of the keys without `--force-purge`.
|
|
23
|
+
- Installable package with the `game-inventory` console script.
|
|
24
|
+
- Full test suite, coverage gate and lint in CI.
|
|
25
|
+
- `--dry-run` / `--simular`: scan and print the summary without writing the workbook, history, JSON or purging.
|
|
26
|
+
- `--check-data` / `--validar`: validate the JSON data files, `config.json`, stale metadata keys, invalid metadata values, repeated wishlist titles and the history, then exit without scanning or writing.
|
|
27
|
+
- `--strict` / `--estricto`: with `--check-data`, exit with code 1 when there are warnings.
|
|
28
|
+
- The data check names the stale keys and reports unknown config keys, unnormalized `hours.json` keys, normalization collisions, completed/playing titles missing from `hours.json` and games marked as completed and playing at the same time.
|
|
29
|
+
- The data check also reports reachable libraries, an output path inside `data/`, and repeated or future history dates.
|
|
30
|
+
- The data check reports metadata blocks that are not objects, non-string titles in `completed.json` or `playing.json`, and unsorted history rows, and prints the total warnings.
|
|
31
|
+
- The data check reports config keys with a wrong value type.
|
|
32
|
+
- The data check reports duplicate JSON keys and keys that normalize to an empty name.
|
|
33
|
+
- The data check reports the same library path configured twice.
|
|
34
|
+
- The data check names the library folders that do not exist and validates the source dates inside metadata entries.
|
|
35
|
+
- The data check reports non-text fields inside metadata entries and a malformed `_actualizado` date.
|
|
36
|
+
- The network user agent uses the installed package version.
|
|
37
|
+
- `--open` / `--abrir`: open the workbook with the default application after saving it.
|
|
38
|
+
- Workbook metadata (title, creator, subject, description, keywords) and landscape print setup with fit-to-width.
|
|
39
|
+
- The workbook marks `game-inventory` as the last modifier too.
|
|
40
|
+
- `tools/check_release.py`: the release workflow checks the tag, the version and both changelogs.
|
|
41
|
+
- The Plan sheet keeps its header visible when scrolling.
|
|
42
|
+
- `--report` creates the parent folders of the report path.
|
|
43
|
+
- The Plan sheet has an auto-filter on its header.
|
|
44
|
+
- The History sheet has an auto-filter on its header.
|
|
45
|
+
- Name normalization lives in `inventory/text.py` and is shared by `data.py` and `config.py`.
|
|
46
|
+
- The Summary sheet shows the generation date.
|
|
47
|
+
- `--top` rejects negative values.
|
|
48
|
+
- Help output with usage examples.
|
|
49
|
+
- `--top N`: print the best GB/h picks that are not completed or playing.
|
|
50
|
+
- `--report` / `--informe`: write a Markdown summary of the run. The number of picks follows `--top`. The report cannot be inside `data/` or overwrite the workbook.
|
|
51
|
+
- The report totals include completed GB, playing and games without data.
|
|
52
|
+
- The report path is rejected before scanning when it is a folder.
|
|
53
|
+
- `GAME_INVENTORY_LANG` sets the default language; `--lang` overrides it.
|
|
54
|
+
- Ctrl+C is caught: the command prints `Cancelled.` and exits with code 130.
|
|
55
|
+
- `data/config.json` can override the libraries, loose paths, exclusions and output path. `~` is expanded in every path.
|
|
56
|
+
- Progress lines for the folder scan and the network step.
|
|
57
|
+
- `tools/check_i18n.py`: fails when the English and Spanish keys or placeholders differ, or when a translation key is repeated.
|
|
58
|
+
- Help texts translated, so `--help` follows `--lang`.
|
|
59
|
+
- `docs/DATA.md` and `docs/ARCHITECTURE.md`, and `SECURITY.md`.
|
|
60
|
+
- `docs/EXAMPLES.md`: console, workbook and data folder examples.
|
|
61
|
+
- `docs/FAQ.md`: common questions about privacy, hours, libraries and errors.
|
|
62
|
+
- `docs/BENCHMARKS.md`: scan and workbook times for 100, 500 and 1000 games, plus the real library.
|
|
63
|
+
- `docs/PUBLISHING.md`: build, PyPI Trusted Publishing and the token alternative.
|
|
64
|
+
- `docs/PUBLISHING.md` records the PyPI name conflict with `gameinventory`.
|
|
65
|
+
- `tests/test_offline.py`: blocks `socket.socket` and `socket.create_connection` and proves that `--offline` never opens a socket.
|
|
66
|
+
- Issue forms, pull request template and EditorConfig.
|
|
67
|
+
- CodeQL analysis on every push and pull request, and weekly.
|
|
68
|
+
- Release workflow: a `v*` tag builds the wheel and sdist, checks them and publishes a GitHub release.
|
|
69
|
+
- `tools/check_links.py`: fails when a relative documentation link is broken.
|
|
70
|
+
- `tools/check_all.py`: runs pyflakes, the link check and the translation check in one command.
|
|
71
|
+
- Dependabot groups minor and patch updates into one pull request per ecosystem.
|
|
72
|
+
- CodeQL can also be started manually.
|
|
73
|
+
- pipx install instructions.
|
|
74
|
+
- Dependabot updates for pip and GitHub Actions.
|
|
75
|
+
- Contributing guide in English and Spanish.
|
|
76
|
+
- Package keywords and classifiers.
|
|
77
|
+
|
|
78
|
+
### Changed
|
|
79
|
+
|
|
80
|
+
- CI caches pip downloads, cancels superseded runs, uses read-only permissions and a 15-minute timeout.
|
|
81
|
+
- CI builds the wheel and sdist, checks that `data/` is not inside, installs the wheel and runs it.
|
|
82
|
+
- The package check rejects development tools in the wheel and requires them in the sdist.
|
|
83
|
+
- CI also installs the sdist and runs the installed command.
|
|
84
|
+
- Coverage gate raised from 97% to 98%; Windows and Ubuntu currently report 99%.
|
|
85
|
+
- Coverage source and the 98% gate live in `pyproject.toml`.
|
|
86
|
+
- The installed `game-inventory` command reads `data/` from the source checkout or the current folder. `GAME_INVENTORY_DATA` overrides it.
|
|
87
|
+
- README: limitations, test setup and benchmark links.
|
|
88
|
+
- README: example workbook screenshot with fictional games and no personal paths.
|
|
89
|
+
|
|
90
|
+
### Security
|
|
91
|
+
|
|
92
|
+
- JSON and workbook text is kept as text, so a name starting with `=` is not treated as a formula.
|
|
93
|
+
- Control characters are removed from Excel cells and comments.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Contribuir
|
|
2
|
+
|
|
3
|
+
[English](CONTRIBUTING.md) | Español
|
|
4
|
+
|
|
5
|
+
## Preparación
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
git clone https://github.com/IkerAbad/game-inventory.git
|
|
9
|
+
cd game-inventory
|
|
10
|
+
py -m venv .venv
|
|
11
|
+
.venv\Scripts\activate
|
|
12
|
+
py -m pip install -e ".[dev]"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`requirements-dev.txt` contiene las mismas herramientas para el CI.
|
|
16
|
+
|
|
17
|
+
## Comprobaciones
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
py tools/check_all.py
|
|
21
|
+
py -m coverage run -m unittest discover -s tests -v
|
|
22
|
+
py -m coverage report
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`check_all.py` ejecuta pyflakes, la comprobación de enlaces de la documentación y la de traducciones.
|
|
26
|
+
|
|
27
|
+
El CI falla por debajo del 98% de cobertura.
|
|
28
|
+
|
|
29
|
+
## Código
|
|
30
|
+
|
|
31
|
+
- Python 3.12 o superior.
|
|
32
|
+
- Identificadores, comentarios y docstrings en inglés.
|
|
33
|
+
- Los textos de interfaz van en `inventory/i18n.py`, con inglés y español.
|
|
34
|
+
- Añade o actualiza pruebas con cada cambio de comportamiento.
|
|
35
|
+
- No subas nada de `data/`. Contiene datos personales y está ignorado.
|
|
36
|
+
|
|
37
|
+
## Documentación
|
|
38
|
+
|
|
39
|
+
- `README.md` y `README.es.md` deben ir en paralelo.
|
|
40
|
+
- `CHANGELOG.md` y `CHANGELOG.es.md` deben ir en paralelo.
|
|
41
|
+
- Cada opción nueva necesita una fila en las dos tablas del README.
|
|
42
|
+
|
|
43
|
+
## Pull requests
|
|
44
|
+
|
|
45
|
+
Ejecuta las comprobaciones y mantén el cambio acotado. Indica en el changelog los cambios de comportamiento, las opciones nuevas y los cambios de formato de datos.
|
|
46
|
+
|
|
47
|
+
## Publicación
|
|
48
|
+
|
|
49
|
+
1. Fija la versión nueva en `inventory/__init__.py` y mueve las entradas del changelog de `Sin publicar` a esa versión, en los dos idiomas.
|
|
50
|
+
2. Haz commit, crea la etiqueta y súbela: `git tag v1.0.1` y `git push --tags`.
|
|
51
|
+
3. El flujo de Release comprueba que la etiqueta coincide con la versión y que los dos changelogs tienen una sección para ella, construye el wheel y el sdist, los revisa y abre una release de GitHub con las notas. PyPI usa Trusted Publishing y se publica desde el workflow `PyPI` cuando el publicador pendiente está configurado; ver [docs/PUBLISHING.es.md](docs/PUBLISHING.es.md).
|
|
52
|
+
|
|
53
|
+
CodeQL se ejecuta en cada push, en cada pull request y una vez a la semana.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
English | [Español](CONTRIBUTING.es.md)
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
git clone https://github.com/IkerAbad/game-inventory.git
|
|
9
|
+
cd game-inventory
|
|
10
|
+
py -m venv .venv
|
|
11
|
+
.venv\Scripts\activate
|
|
12
|
+
py -m pip install -e ".[dev]"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`requirements-dev.txt` holds the same tools for the CI.
|
|
16
|
+
|
|
17
|
+
## Checks
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
py tools/check_all.py
|
|
21
|
+
py -m coverage run -m unittest discover -s tests -v
|
|
22
|
+
py -m coverage report
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`check_all.py` runs pyflakes, the documentation link check and the translation check.
|
|
26
|
+
|
|
27
|
+
The CI fails below 98% coverage.
|
|
28
|
+
|
|
29
|
+
## Code
|
|
30
|
+
|
|
31
|
+
- Python 3.12 or newer.
|
|
32
|
+
- Identifiers, comments and docstrings in English.
|
|
33
|
+
- User-facing strings go in `inventory/i18n.py` with both English and Spanish versions.
|
|
34
|
+
- Add or update tests for every behaviour change.
|
|
35
|
+
- Do not commit anything from `data/`. It holds personal data and is ignored.
|
|
36
|
+
|
|
37
|
+
## Docs
|
|
38
|
+
|
|
39
|
+
- `README.md` and `README.es.md` must stay in sync.
|
|
40
|
+
- `CHANGELOG.md` and `CHANGELOG.es.md` must stay in sync.
|
|
41
|
+
- New options need a row in both README tables.
|
|
42
|
+
|
|
43
|
+
## Pull requests
|
|
44
|
+
|
|
45
|
+
Run the checks above and keep the change focused. Mention behaviour changes, new options and data format changes in the changelog.
|
|
46
|
+
|
|
47
|
+
## Release
|
|
48
|
+
|
|
49
|
+
1. Set the new version in `inventory/__init__.py` and move the changelog entries from `Unreleased` to that version, in both languages.
|
|
50
|
+
2. Commit, then create and push the tag: `git tag v1.0.1` and `git push --tags`.
|
|
51
|
+
3. The Release workflow checks that the tag matches the version and that both changelogs have a section for it, builds the wheel and the sdist, checks them and opens a GitHub release with the notes. PyPI uses Trusted Publishing and is published from the `PyPI` workflow after the pending publisher is configured; see [docs/PUBLISHING.md](docs/PUBLISHING.md).
|
|
52
|
+
|
|
53
|
+
CodeQL runs on every push and pull request, and once a week.
|
gamesize-1.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Iker Abad
|
|
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.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
include LICENSE
|
|
2
|
+
include README.md
|
|
3
|
+
include README.es.md
|
|
4
|
+
include CHANGELOG.md
|
|
5
|
+
include CHANGELOG.es.md
|
|
6
|
+
include CONTRIBUTING.md
|
|
7
|
+
include CONTRIBUTING.es.md
|
|
8
|
+
include SECURITY.md
|
|
9
|
+
include SECURITY.es.md
|
|
10
|
+
include requirements.txt
|
|
11
|
+
include requirements-dev.txt
|
|
12
|
+
recursive-include docs *.md
|
|
13
|
+
recursive-include docs *.png
|
|
14
|
+
recursive-include tools *.py
|
|
15
|
+
recursive-include tests *.py
|
gamesize-1.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gamesize
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Game inventory: GB per hour, backlog plan, history and wishlist
|
|
5
|
+
Author: Iker Abad
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/IkerAbad/game-inventory
|
|
8
|
+
Project-URL: Repository, https://github.com/IkerAbad/game-inventory
|
|
9
|
+
Project-URL: Issues, https://github.com/IkerAbad/game-inventory/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/IkerAbad/game-inventory/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: games,backlog,excel,openpyxl,inventory,steam
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Classifier: Topic :: Games/Entertainment
|
|
20
|
+
Classifier: Topic :: Office/Business
|
|
21
|
+
Requires-Python: >=3.12
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: openpyxl<3.2,>=3.1.5
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
27
|
+
Requires-Dist: coverage>=7.6; extra == "dev"
|
|
28
|
+
Requires-Dist: pyflakes>=3.2; extra == "dev"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# Game inventory
|
|
32
|
+
|
|
33
|
+
[](https://github.com/IkerAbad/game-inventory/actions/workflows/ci.yml)
|
|
34
|
+
[](https://github.com/IkerAbad/game-inventory/actions/workflows/codeql.yml)
|
|
35
|
+
[](https://github.com/IkerAbad/game-inventory/blob/main/pyproject.toml)
|
|
36
|
+
[](LICENSE)
|
|
37
|
+
|
|
38
|
+
English | [Español](README.es.md)
|
|
39
|
+
|
|
40
|
+
Scan the folders where your games are installed, cross the disk size with the main-story hours and build an Excel workbook with the GB per hour ratio, a deletion plan, the history and the wishlist. The console and the workbook are available in English and Spanish.
|
|
41
|
+
|
|
42
|
+
## What it does
|
|
43
|
+
|
|
44
|
+
- Scans the drives and folders configured in `inventory/config.py` and measures every game on disk.
|
|
45
|
+
- Fills missing hours from the network (Deku Deals, twoaveragegamers and an estimate from Steam reviews), the Metascore and, when there is no Metascore, the share of positive Steam reviews.
|
|
46
|
+
- Purges from `hours.json` the keys of games that are no longer installed, only when every drive is present.
|
|
47
|
+
- Builds the Excel workbook with up to six sheets: Games, Space, Summary, Plan, History and Wishlist.
|
|
48
|
+
|
|
49
|
+

|
|
50
|
+
|
|
51
|
+
Example workbook with fictional games. The personal paths column is not shown.
|
|
52
|
+
|
|
53
|
+
## Requirements
|
|
54
|
+
|
|
55
|
+
- Python 3.12 or newer.
|
|
56
|
+
- `openpyxl` (see `requirements.txt`).
|
|
57
|
+
- Network access is optional: `--offline` skips every request.
|
|
58
|
+
- The default libraries are Windows paths; `data/config.json` adapts them to any system.
|
|
59
|
+
|
|
60
|
+
## Limitations
|
|
61
|
+
|
|
62
|
+
- Hours are main-story estimates from third-party pages (Deku Deals, twoaveragegamers and Steam reviews). Those pages can change, rate-limit or block requests, and title matching can miss a game or pick another edition.
|
|
63
|
+
- With `--offline` there are no requests at all, so missing hours, Metascores and Steam percentages stay empty. The rest of the workbook is still built.
|
|
64
|
+
- Metascore and the Steam percentage use different scales and are never mixed into one number.
|
|
65
|
+
- It does not measure real playtime, achievements, save files, DLC owned separately, cloud libraries that are not installed, or games outside the configured folders.
|
|
66
|
+
- Folder size is the size on disk, not the download size. Compression, sparse files and hard links can make them differ.
|
|
67
|
+
- The verdicts are a suggestion based on GB per hour and the quartiles of the current list, not a recommendation.
|
|
68
|
+
- The default libraries are Windows paths; other systems need `data/config.json`.
|
|
69
|
+
- Some workbook dates are formulas, so Excel or LibreOffice has to recalculate after opening.
|
|
70
|
+
- Network access is best effort: there is a request budget and stored data, but no guarantee that a source answers.
|
|
71
|
+
- It never uninstalls or deletes a game. The purge only removes stale keys from `hours.json`, after a backup.
|
|
72
|
+
|
|
73
|
+
## Tests
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
py -m venv .venv
|
|
77
|
+
.venv\Scripts\activate
|
|
78
|
+
py -m pip install -e ".[dev]"
|
|
79
|
+
py -m unittest discover -s tests
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Run from the repository root. Without `openpyxl`, three test modules fail at import with `ModuleNotFoundError: No module named 'openpyxl'`; that is a missing dependency, not a failing test. `pip install -e .` or `pip install -r requirements.txt` installs it. Reproduced on 2026-11-23: a clean venv reported 3 import errors from the missing dependency, and after installing `requirements.txt` the same command ran 259 tests with `OK`.
|
|
83
|
+
|
|
84
|
+
## Install as a package
|
|
85
|
+
|
|
86
|
+
The distribution is `gamesize`, because PyPI rejected `game-inventory` as too
|
|
87
|
+
similar to an existing project. The command is still `game-inventory` and the
|
|
88
|
+
import package is still `inventory`.
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
pip install gamesize
|
|
92
|
+
game-inventory --lang es
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
From the repository, `py -m pip install .` works the same. If the package is
|
|
96
|
+
already installed, running the script from the repository with `py -m pip
|
|
97
|
+
install -e .` gives the editable version.
|
|
98
|
+
|
|
99
|
+
The direct script and module commands below also work without installing. When installed, `data/` is read from the current folder unless `GAME_INVENTORY_DATA` points to another one.
|
|
100
|
+
|
|
101
|
+
Or as an isolated command with [pipx](https://pipx.pypa.io):
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
pipx install gamesize
|
|
105
|
+
game-inventory --version
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Usage
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
cd C:\Dev\game-inventory
|
|
112
|
+
py -m pip install -r requirements.txt
|
|
113
|
+
py generate_inventory.py
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Or as a module, from the same folder:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
py -m inventory
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Or double-click `start.cmd`. It saves the output to `data/last_run.log` and keeps the window open when there is an error.
|
|
123
|
+
|
|
124
|
+
Options:
|
|
125
|
+
|
|
126
|
+
| Option | What it does |
|
|
127
|
+
|---|---|
|
|
128
|
+
| `--lang en\|es` | Output language for the console and the workbook. Default: `en`. |
|
|
129
|
+
| `--offline`, `--sin-red` | Do not use the network. |
|
|
130
|
+
| `--keep`, `--conservar` | Do not purge uninstalled game keys. |
|
|
131
|
+
| `--force-purge`, `--forzar-purga` | Allow purging more than half of the keys at once. |
|
|
132
|
+
| `--dry-run`, `--simular` | Scan and show the summary without writing anything. |
|
|
133
|
+
| `--top N` | Show the N best GB/h picks that are not completed or playing (0 disables it). |
|
|
134
|
+
| `--report PATH`, `--informe PATH` | Write a Markdown summary after the run. It cannot be inside `data/` or use the workbook path. |
|
|
135
|
+
| `--open`, `--abrir` | Open the saved workbook with the default application. |
|
|
136
|
+
| `--check-data`, `--validar` | Validate the JSON data files, stale metadata keys, invalid metadata values, repeated wishlist titles and the history, then exit. |
|
|
137
|
+
| `--strict`, `--estricto` | With `--check-data`, exit with code 1 when warnings are found. |
|
|
138
|
+
| `--output PATH`, `--salida PATH` | Write the Excel workbook to another path. |
|
|
139
|
+
| `--version` | Show the installed version. |
|
|
140
|
+
|
|
141
|
+
The workbook is written by default to `%USERPROFILE%\Desktop\Juegos\Inventario juegos GB por hora.xlsx` and keeps a `.bak.xlsx` copy of the previous run. The Spanish file name is kept so the existing workbook is updated in place. Close the workbook before running, otherwise the script stops before scanning anything.
|
|
142
|
+
|
|
143
|
+
Exit codes: `0` success, `1` aborted or invalid data, `130` cancelled with Ctrl+C.
|
|
144
|
+
|
|
145
|
+
`GAME_INVENTORY_LANG=es` changes the default language; `--lang` still wins.
|
|
146
|
+
|
|
147
|
+
## Data
|
|
148
|
+
|
|
149
|
+
All personal data lives in `data/`, which is not versioned. The script creates the folder when it does not exist.
|
|
150
|
+
|
|
151
|
+
| File | Content |
|
|
152
|
+
|---|---|
|
|
153
|
+
| `data/hours.json` | Main-story hours by normalized key. `null` = no end. The `_metacritic`, `_steam`, `_dificultad` and `_notas` blocks keep the notes. |
|
|
154
|
+
| `data/wishlist.json` | Wishlist titles with hours, notes, Metacritic, Steam and difficulty. |
|
|
155
|
+
| `data/playing.json` | Keys of the games you are playing now. |
|
|
156
|
+
| `data/completed.json` | Keys of the games you finished but still have installed. |
|
|
157
|
+
| `data/history.csv` | One row per run day. It feeds the History sheet. |
|
|
158
|
+
| `data/config.json` | Optional. Overrides the libraries, loose paths, exclusions and output path. |
|
|
159
|
+
|
|
160
|
+
The source notes inside the JSON files keep the language they were written in.
|
|
161
|
+
|
|
162
|
+
## Robustness
|
|
163
|
+
|
|
164
|
+
- A syntax error in a JSON file aborts the run, shows the line and column, and writes nothing.
|
|
165
|
+
- Hours that are not positive numbers, `null` or `"?"` are treated as no data and reported.
|
|
166
|
+
- JSON, history and the workbook are written to a temporary file and renamed, so a mid-write failure leaves no corrupt file.
|
|
167
|
+
- The purge keeps `hours.json.bak` and refuses to remove more than half of the keys without `--force-purge`.
|
|
168
|
+
- If the history cannot be read or has broken rows, the original is kept as `history.csv.corrupto`.
|
|
169
|
+
- If the workbook is open, the script stops before scanning.
|
|
170
|
+
- Only one run can be active at a time, enforced by a lock in `data/`.
|
|
171
|
+
- BOM-prefixed JSON is accepted and broken history rows are skipped with a warning.
|
|
172
|
+
|
|
173
|
+
- `--dry-run` scans and prints the summary but writes no workbook, history or JSON.
|
|
174
|
+
|
|
175
|
+
## Troubleshooting
|
|
176
|
+
|
|
177
|
+
| Symptom | What to do |
|
|
178
|
+
|---|---|
|
|
179
|
+
| `ABORTED: the Excel file is open` | Close the workbook and run again. Nothing has been scanned. |
|
|
180
|
+
| `ABORTED: another inventory run is in progress` | Wait for the other run. The lock lives in `data/`. |
|
|
181
|
+
| `is not valid JSON (line ..., column ...)` | Fix that line or restore a backup of the file. |
|
|
182
|
+
| `Warning: cannot read history.csv` | The original is kept as `history.csv.corrupto` and the run writes a clean one. |
|
|
183
|
+
| A game is missing | Add its folder to `libraries` or `loose_paths` in `data/config.json`. |
|
|
184
|
+
| Every game shows NO DATA | `hours.json` is missing or its keys do not match the folder names. Run `--check-data`. |
|
|
185
|
+
|
|
186
|
+
## Structure
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
generate_inventory.py entry point
|
|
190
|
+
pyproject.toml package metadata and console script
|
|
191
|
+
CHANGELOG.md English changelog
|
|
192
|
+
CONTRIBUTING.md English contributing guide
|
|
193
|
+
SECURITY.md English security policy
|
|
194
|
+
docs/
|
|
195
|
+
DATA.md data formats and backups
|
|
196
|
+
ARCHITECTURE.md flow, modules and guarantees
|
|
197
|
+
EXAMPLES.md console, workbook and data folder examples
|
|
198
|
+
FAQ.md common questions
|
|
199
|
+
BENCHMARKS.md measured scan and workbook times
|
|
200
|
+
PUBLISHING.md build, PyPI and trusted publishing
|
|
201
|
+
tools/
|
|
202
|
+
check_all.py runs pyflakes, link and translation checks
|
|
203
|
+
check_dist.py checks the wheel and sdist contents
|
|
204
|
+
check_release.py checks a release tag against the changelogs
|
|
205
|
+
check_links.py checks relative links in the docs
|
|
206
|
+
inventory/
|
|
207
|
+
config.py drives, paths and network settings
|
|
208
|
+
data.py JSON: loading, formatting and safe writing
|
|
209
|
+
scan.py size, days installed and workbook lock
|
|
210
|
+
cell_format.py cells: Metacritic, Steam and difficulty
|
|
211
|
+
excel.py sheets, styles, charts and comparisons
|
|
212
|
+
network.py network autocomplete
|
|
213
|
+
i18n.py English and Spanish strings
|
|
214
|
+
cli.py options, orchestration and console summary
|
|
215
|
+
tests/ unit and end-to-end tests
|
|
216
|
+
start.cmd Windows launcher
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Documentation
|
|
220
|
+
|
|
221
|
+
`README.es.md` is the Spanish version. The personal notes with sources and decisions live in `data/NOTES.md`, which is not versioned.
|
|
222
|
+
|
|
223
|
+
- [Changelog](CHANGELOG.md) / [Registro de cambios](CHANGELOG.es.md)
|
|
224
|
+
- [Contributing](CONTRIBUTING.md) / [Contribuir](CONTRIBUTING.es.md)
|
|
225
|
+
- [Data formats](docs/DATA.md) / [Formatos de datos](docs/DATA.es.md)
|
|
226
|
+
- [Architecture](docs/ARCHITECTURE.md) / [Arquitectura](docs/ARCHITECTURE.es.md)
|
|
227
|
+
- [Examples](docs/EXAMPLES.md) / [Ejemplos](docs/EXAMPLES.es.md)
|
|
228
|
+
- [FAQ](docs/FAQ.md) / [Preguntas frecuentes](docs/FAQ.es.md)
|
|
229
|
+
- [Benchmarks](docs/BENCHMARKS.md) / [Rendimiento](docs/BENCHMARKS.es.md)
|
|
230
|
+
- [Publishing](docs/PUBLISHING.md) / [Publicación](docs/PUBLISHING.es.md)
|
|
231
|
+
- [Security](SECURITY.md) / [Seguridad](SECURITY.es.md)
|
|
232
|
+
|
|
233
|
+
## License
|
|
234
|
+
|
|
235
|
+
MIT. See `LICENSE`.
|