fpptools 0.2.0__tar.gz → 0.2.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.
Files changed (39) hide show
  1. {fpptools-0.2.0 → fpptools-0.2.1}/CHANGELOG.md +12 -1
  2. fpptools-0.2.1/PKG-INFO +94 -0
  3. fpptools-0.2.1/README.md +72 -0
  4. fpptools-0.2.1/docs/README.md +15 -0
  5. fpptools-0.2.1/docs/config.md +28 -0
  6. fpptools-0.2.1/docs/development.md +30 -0
  7. fpptools-0.2.1/docs/exe.md +18 -0
  8. fpptools-0.2.1/docs/fit-list.md +56 -0
  9. fpptools-0.2.1/docs/options.md +41 -0
  10. fpptools-0.2.1/docs/str-list.md +39 -0
  11. fpptools-0.2.1/docs/wipe.md +44 -0
  12. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/__init__.py +1 -1
  13. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/commands/wipe.py +2 -1
  14. {fpptools-0.2.0 → fpptools-0.2.1}/pyproject.toml +2 -2
  15. fpptools-0.2.0/PKG-INFO +0 -129
  16. fpptools-0.2.0/README.md +0 -107
  17. {fpptools-0.2.0 → fpptools-0.2.1}/.gitignore +0 -0
  18. {fpptools-0.2.0 → fpptools-0.2.1}/LICENSE +0 -0
  19. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/__main__.py +0 -0
  20. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/app.py +0 -0
  21. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/cli.py +0 -0
  22. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/commands/__init__.py +0 -0
  23. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/commands/config_cmd.py +0 -0
  24. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/commands/fit.py +0 -0
  25. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/commands/str.py +0 -0
  26. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/config.py +0 -0
  27. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/db.py +0 -0
  28. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/errors.py +0 -0
  29. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/fpptools.py +0 -0
  30. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/output.py +0 -0
  31. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/quick.py +0 -0
  32. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/safe_write.py +0 -0
  33. {fpptools-0.2.0 → fpptools-0.2.1}/fpptools/strfile.py +0 -0
  34. {fpptools-0.2.0 → fpptools-0.2.1}/scripts/build_exe.ps1 +0 -0
  35. {fpptools-0.2.0 → fpptools-0.2.1}/scripts/exe_estructuras.py +0 -0
  36. {fpptools-0.2.0 → fpptools-0.2.1}/scripts/exe_fpptools.py +0 -0
  37. {fpptools-0.2.0 → fpptools-0.2.1}/tests/__init__.py +0 -0
  38. {fpptools-0.2.0 → fpptools-0.2.1}/tests/conftest.py +0 -0
  39. {fpptools-0.2.0 → fpptools-0.2.1}/tests/test_fpptools.py +0 -0
@@ -1,6 +1,17 @@
1
1
  # Changelog
2
2
 
3
- ## 0.2.0 (unreleased)
3
+ ## 0.2.1 (unreleased)
4
+
5
+ ### Added
6
+ - Documentation in `docs/` (one page per command, common options, exes, development). The README is now a short overview that links to it (absolute GitHub links, so they work on PyPI too); `docs/` is in the sdist.
7
+
8
+ ### Changed
9
+ - `wipe kits --help` explains `--source`.
10
+ - `scripts\build_exe.ps1` builds the exes into `dist_exe\`, leaving `dist\` for the PyPI wheel/sdist.
11
+ - Project URL: github.com/andoresuperesu/fpptools.
12
+ - Author email: me@aperezc.xyz.
13
+
14
+ ## 0.2.0 (2026-11-05)
4
15
 
5
16
  Rewrite for current Python and FP Pro 11.
6
17
 
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.5
2
+ Name: fpptools
3
+ Version: 0.2.1
4
+ Summary: Administration and debugging CLI for emmegisoft FP Pro (structures, blocks, jobs)
5
+ Project-URL: Repository, https://github.com/andoresuperesu/fpptools
6
+ Author-email: Andres Perez <me@aperezc.xyz>
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Classifier: Environment :: Console
10
+ Classifier: Environment :: Win32 (MS Windows)
11
+ Classifier: Operating System :: Microsoft :: Windows
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
+ Classifier: Topic :: Utilities
15
+ Requires-Python: >=3.10
16
+ Requires-Dist: click>=8.1
17
+ Requires-Dist: lxml>=5.0
18
+ Requires-Dist: openpyxl>=3.1
19
+ Requires-Dist: pymysql>=1.1
20
+ Requires-Dist: pyodbc>=5.0; sys_platform == 'win32'
21
+ Description-Content-Type: text/markdown
22
+
23
+ # fpptools
24
+
25
+ Administration and debugging command line for emmegisoft **FP Pro**: structures (`.STR`), blocks (`.BLK`) and job records.
26
+ It works on the configuration that is **active in FP Pro right now** (read from `%APPDATA%\Emmegisoft\FP_PRO\FP_PRO.INI`).
27
+
28
+ 📖 **Full documentation:** [docs/](https://github.com/andoresuperesu/fpptools/blob/master/docs/README.md) · *Guía rápida en español más abajo.*
29
+
30
+ ## Install
31
+
32
+ ```powershell
33
+ pip install fpptools # or: uv tool install fpptools
34
+ fpptools --help
35
+ ```
36
+
37
+ No Python on the PC? Use the standalone exes: `fpptools.exe` (full command line) and `fpptools_estructuras.exe` (double-click: structures to `estructuras.xlsx`). See [Standalone exes](https://github.com/andoresuperesu/fpptools/blob/master/docs/exe.md).
38
+
39
+ ## Commands
40
+
41
+ | Command | What it does | Docs |
42
+ |---|---|---|
43
+ | `fpptools config` | Show the active configuration: INI, folders, database (password hidden). Run it first when something isn't found | [config](https://github.com/andoresuperesu/fpptools/blob/master/docs/config.md) |
44
+ | `fpptools str list` | Structures: folder, name, unique code (*nombre unívoco*), description → `structures.csv` | [str list](https://github.com/andoresuperesu/fpptools/blob/master/docs/str-list.md) |
45
+ | `fpptools fit list` | Fittings used in structures, blocks, one job or all jobs (`--source str\|blk\|job\|jobs`), kits expanded from the database → `fittings_<source>.csv` | [fit list](https://github.com/andoresuperesu/fpptools/blob/master/docs/fit-list.md) |
46
+ | `fpptools wipe panedefs` | Remove glass fittings, glass DXF and pane table from every pane of the structures | [wipe](https://github.com/andoresuperesu/fpptools/blob/master/docs/wipe.md) |
47
+ | `fpptools wipe kits` | Remove every kit from structures or blocks (`--source str\|blk`) | [wipe](https://github.com/andoresuperesu/fpptools/blob/master/docs/wipe.md) |
48
+ | `fpptools-estructuras` | Same as `str list --lang es -o estructuras.xlsx` (what the double-click exe runs) | [exe](https://github.com/andoresuperesu/fpptools/blob/master/docs/exe.md) |
49
+ | `fpptools list_fittings` | 0.1 syntax (`--searchtype`), deprecated: use `fit list` | [fit list](https://github.com/andoresuperesu/fpptools/blob/master/docs/fit-list.md#01-syntax-list_fittings) |
50
+
51
+ **Common options** ([details](https://github.com/andoresuperesu/fpptools/blob/master/docs/options.md)):
52
+
53
+ - Choose files: `--under FOLDER`, `--match PATTERN`, `--root FOLDER`.
54
+ - Output: `-o file.csv` / `file.xlsx` / `-` (console); CSV with `;` and UTF-8 BOM (opens right in Excel); `--lang es` for Spanish headers.
55
+ - `--ini PATH` (or `FPPTOOLS_INI`): another FP_PRO.INI · `--version` · `-h` / `--help` on every command · `python -m fpptools` = `fpptools`.
56
+
57
+ **Commands that modify files only simulate** unless you add `--apply`; with `--apply` the originals are backed up first ([wipe](https://github.com/andoresuperesu/fpptools/blob/master/docs/wipe.md)).
58
+
59
+ ```powershell
60
+ fpptools config
61
+ fpptools str list --lang es -o estructuras.xlsx
62
+ fpptools fit list --source blk -o fittings_blk.xlsx
63
+ fpptools wipe panedefs --under "LINEA X" # simulation
64
+ fpptools wipe panedefs --under "LINEA X" --apply # backup + write
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Guía rápida (español)
70
+
71
+ `fpptools` trabaja sobre la configuración **activa en FP Pro**. `fpptools config` muestra cuál es (carpetas y base de datos).
72
+
73
+ **Exportar nombre y descripción de las estructuras:**
74
+
75
+ ```powershell
76
+ fpptools str list --lang es -o estructuras.xlsx
77
+ fpptools str list --under 019_SERIE_22_PESADO --lang es -o serie22.csv
78
+ ```
79
+
80
+ Columnas: Carpeta, Nombre (nombre del archivo), Nombre único (nombre unívoco), Descripción.
81
+
82
+ **Sin línea de comandos:** doble clic en `fpptools_estructuras.exe`. Crea `estructuras.xlsx` en la misma carpeta del programa (si está abierto en Excel, crea `estructuras_<fecha_hora>.xlsx`). El programa debe estar en una carpeta donde se pueda escribir (no en `C:\Program Files`).
83
+
84
+ **Accesorios:** `fpptools fit list --source str|blk|job|jobs --lang es -o accesorios.xlsx`.
85
+
86
+ **Comandos que modifican archivos** (`wipe`): por defecto solo **simulan** y muestran qué cambiarían. Con `--apply` primero copian los originales a `fpptools_backups\<fecha_hora>\` y luego escriben. Cierre las estructuras en FP Pro antes de aplicar.
87
+
88
+ Documentación completa (en inglés): [docs/](https://github.com/andoresuperesu/fpptools/blob/master/docs/README.md).
89
+
90
+ ## Development
91
+
92
+ See [docs/development.md](https://github.com/andoresuperesu/fpptools/blob/master/docs/development.md) (uv, tests, exes, PyPI).
93
+
94
+ License: MIT.
@@ -0,0 +1,72 @@
1
+ # fpptools
2
+
3
+ Administration and debugging command line for emmegisoft **FP Pro**: structures (`.STR`), blocks (`.BLK`) and job records.
4
+ It works on the configuration that is **active in FP Pro right now** (read from `%APPDATA%\Emmegisoft\FP_PRO\FP_PRO.INI`).
5
+
6
+ 📖 **Full documentation:** [docs/](https://github.com/andoresuperesu/fpptools/blob/master/docs/README.md) · *Guía rápida en español más abajo.*
7
+
8
+ ## Install
9
+
10
+ ```powershell
11
+ pip install fpptools # or: uv tool install fpptools
12
+ fpptools --help
13
+ ```
14
+
15
+ No Python on the PC? Use the standalone exes: `fpptools.exe` (full command line) and `fpptools_estructuras.exe` (double-click: structures to `estructuras.xlsx`). See [Standalone exes](https://github.com/andoresuperesu/fpptools/blob/master/docs/exe.md).
16
+
17
+ ## Commands
18
+
19
+ | Command | What it does | Docs |
20
+ |---|---|---|
21
+ | `fpptools config` | Show the active configuration: INI, folders, database (password hidden). Run it first when something isn't found | [config](https://github.com/andoresuperesu/fpptools/blob/master/docs/config.md) |
22
+ | `fpptools str list` | Structures: folder, name, unique code (*nombre unívoco*), description → `structures.csv` | [str list](https://github.com/andoresuperesu/fpptools/blob/master/docs/str-list.md) |
23
+ | `fpptools fit list` | Fittings used in structures, blocks, one job or all jobs (`--source str\|blk\|job\|jobs`), kits expanded from the database → `fittings_<source>.csv` | [fit list](https://github.com/andoresuperesu/fpptools/blob/master/docs/fit-list.md) |
24
+ | `fpptools wipe panedefs` | Remove glass fittings, glass DXF and pane table from every pane of the structures | [wipe](https://github.com/andoresuperesu/fpptools/blob/master/docs/wipe.md) |
25
+ | `fpptools wipe kits` | Remove every kit from structures or blocks (`--source str\|blk`) | [wipe](https://github.com/andoresuperesu/fpptools/blob/master/docs/wipe.md) |
26
+ | `fpptools-estructuras` | Same as `str list --lang es -o estructuras.xlsx` (what the double-click exe runs) | [exe](https://github.com/andoresuperesu/fpptools/blob/master/docs/exe.md) |
27
+ | `fpptools list_fittings` | 0.1 syntax (`--searchtype`), deprecated: use `fit list` | [fit list](https://github.com/andoresuperesu/fpptools/blob/master/docs/fit-list.md#01-syntax-list_fittings) |
28
+
29
+ **Common options** ([details](https://github.com/andoresuperesu/fpptools/blob/master/docs/options.md)):
30
+
31
+ - Choose files: `--under FOLDER`, `--match PATTERN`, `--root FOLDER`.
32
+ - Output: `-o file.csv` / `file.xlsx` / `-` (console); CSV with `;` and UTF-8 BOM (opens right in Excel); `--lang es` for Spanish headers.
33
+ - `--ini PATH` (or `FPPTOOLS_INI`): another FP_PRO.INI · `--version` · `-h` / `--help` on every command · `python -m fpptools` = `fpptools`.
34
+
35
+ **Commands that modify files only simulate** unless you add `--apply`; with `--apply` the originals are backed up first ([wipe](https://github.com/andoresuperesu/fpptools/blob/master/docs/wipe.md)).
36
+
37
+ ```powershell
38
+ fpptools config
39
+ fpptools str list --lang es -o estructuras.xlsx
40
+ fpptools fit list --source blk -o fittings_blk.xlsx
41
+ fpptools wipe panedefs --under "LINEA X" # simulation
42
+ fpptools wipe panedefs --under "LINEA X" --apply # backup + write
43
+ ```
44
+
45
+ ---
46
+
47
+ ## Guía rápida (español)
48
+
49
+ `fpptools` trabaja sobre la configuración **activa en FP Pro**. `fpptools config` muestra cuál es (carpetas y base de datos).
50
+
51
+ **Exportar nombre y descripción de las estructuras:**
52
+
53
+ ```powershell
54
+ fpptools str list --lang es -o estructuras.xlsx
55
+ fpptools str list --under 019_SERIE_22_PESADO --lang es -o serie22.csv
56
+ ```
57
+
58
+ Columnas: Carpeta, Nombre (nombre del archivo), Nombre único (nombre unívoco), Descripción.
59
+
60
+ **Sin línea de comandos:** doble clic en `fpptools_estructuras.exe`. Crea `estructuras.xlsx` en la misma carpeta del programa (si está abierto en Excel, crea `estructuras_<fecha_hora>.xlsx`). El programa debe estar en una carpeta donde se pueda escribir (no en `C:\Program Files`).
61
+
62
+ **Accesorios:** `fpptools fit list --source str|blk|job|jobs --lang es -o accesorios.xlsx`.
63
+
64
+ **Comandos que modifican archivos** (`wipe`): por defecto solo **simulan** y muestran qué cambiarían. Con `--apply` primero copian los originales a `fpptools_backups\<fecha_hora>\` y luego escriben. Cierre las estructuras en FP Pro antes de aplicar.
65
+
66
+ Documentación completa (en inglés): [docs/](https://github.com/andoresuperesu/fpptools/blob/master/docs/README.md).
67
+
68
+ ## Development
69
+
70
+ See [docs/development.md](https://github.com/andoresuperesu/fpptools/blob/master/docs/development.md) (uv, tests, exes, PyPI).
71
+
72
+ License: MIT.
@@ -0,0 +1,15 @@
1
+ # fpptools documentation
2
+
3
+ fpptools works on the FP Pro configuration that is **active right now** (`%APPDATA%\Emmegisoft\FP_PRO\FP_PRO.INI`): its folders (`STR_PATH`, `BLK_PATH`, `JOB_PATH`) and its database.
4
+
5
+ | Page | Contents |
6
+ |---|---|
7
+ | [config](config.md) | `fpptools config`: which configuration, folders and database fpptools will use |
8
+ | [str list](str-list.md) | Structures: folder, name, unique code, description (the Estructura browser) |
9
+ | [fit list](fit-list.md) | Fittings in structures, blocks and job records; kits from the database; the 0.1 `list_fittings` syntax |
10
+ | [wipe](wipe.md) | `wipe panedefs`, `wipe kits`: simulation, `--apply`, backups, reports |
11
+ | [options](options.md) | Options common to all commands: choosing files, output formats, `--ini`, `--version`, errors |
12
+ | [exe](exe.md) | Standalone `fpptools.exe` and the double-click `fpptools_estructuras.exe` |
13
+ | [development](development.md) | uv, tests, building the exes, publishing to PyPI |
14
+
15
+ Every command also explains itself: `fpptools <command> --help` (e.g. `fpptools fit list --help`).
@@ -0,0 +1,28 @@
1
+ # `fpptools config`
2
+
3
+ Shows the FP Pro configuration fpptools will use, without changing anything. **Run it first** when a command says a folder or the database can't be found.
4
+
5
+ ```powershell
6
+ fpptools config
7
+ ```
8
+
9
+ ```
10
+ INI C:\Users\<you>\AppData\Roaming\Emmegisoft\FP_PRO\FP_PRO.INI
11
+ Configuration COLOMBIA_ALUMINA_MM
12
+ STR_PATH D:\CONFIGS11\COLOMBIA_ALUMINA_MM\STR\
13
+ BLK_PATH D:\CONFIGS11\COLOMBIA_ALUMINA_MM\BLK\
14
+ JOB_PATH D:\CONFIGS11\COLOMBIA_ALUMINA_MM\JOB\
15
+ CONFIGS_PATH C:\FP_PRO\CONFIGS\
16
+ Database MySQL localhost:3307/fp_pro32_colombia_alumina_mm (user …, charset latin1)
17
+ ```
18
+
19
+ | Line | From FP_PRO.INI |
20
+ |---|---|
21
+ | INI | the file read: `%APPDATA%\Emmegisoft\FP_PRO\FP_PRO.INI`, or `--ini` / `FPPTOOLS_INI` |
22
+ | Configuration | `[GENERAL] CURRENT_CONFIGURATION` |
23
+ | STR_PATH, BLK_PATH, JOB_PATH, CONFIGS_PATH | `[SYSTEM]`; `[not found]` after a folder that doesn't exist |
24
+ | Database | `[SYSTEM] CONN_STR_FP_PRO`: `1` MySQL (`[MYSQL]` DB_SERVER_NAME, DB_PORT, DB_NAME, DB_USER, DB_CHARSET; port 3306 and charset latin1 when missing), `0` Access (`Fp_Pro32.MDB` in `MDB_PATH`) |
25
+
26
+ The password is never shown or written anywhere.
27
+
28
+ To work on another configuration, switch it in FP Pro, or point fpptools at another INI: `fpptools --ini D:\otro\FP_PRO.INI config`.
@@ -0,0 +1,30 @@
1
+ # Development
2
+
3
+ ```powershell
4
+ uv sync # .venv with the dev group (pytest)
5
+ uv run pytest
6
+ uv run fpptools --help
7
+ ```
8
+
9
+ - Python ≥ 3.10, packaging with uv + hatchling. The version is in `fpptools/__init__.py`; record changes in `CHANGELOG.md`.
10
+ - Tests use generic fixtures only (`tests/conftest.py`), never client files.
11
+ - Layout and rules for contributors (and Claude): [`CLAUDE.md`](../CLAUDE.md).
12
+
13
+ ## Standalone exes
14
+
15
+ ```powershell
16
+ .\scripts\build_exe.ps1 # dist_exe\fpptools.exe, dist_exe\fpptools_estructuras.exe
17
+ ```
18
+
19
+ PyInstaller (`build` dependency group), one file each, console. They go to `dist_exe\`, **not** `dist\`, because `dist\` is for PyPI. The entry scripts are `scripts\exe_*.py` (outside the package on purpose).
20
+
21
+ ## PyPI
22
+
23
+ ```powershell
24
+ uv build # dist\fpptools-X.Y.Z.tar.gz + .whl
25
+ uv publish --token pypi-XXXX dist\fpptools-X.Y.Z*
26
+ ```
27
+
28
+ - A published version can't be replaced: fix → bump the version.
29
+ - The README is the PyPI page: links to these docs are absolute GitHub links.
30
+ - Keep the package name `fpptools`, the `fpptools` command and old commands (hidden aliases when renaming).
@@ -0,0 +1,18 @@
1
+ # Standalone exes
2
+
3
+ For PCs without Python. Built with `scripts\build_exe.ps1` (see [development](development.md)) into `dist_exe\`; sent separately, not on PyPI.
4
+
5
+ | Exe | |
6
+ |---|---|
7
+ | `fpptools.exe` | the full command line: `fpptools.exe str list --lang es -o estructuras.xlsx`, `fpptools.exe config`… |
8
+ | `fpptools_estructuras.exe` | **double-click**: exports the structures of the active configuration to `estructuras.xlsx` **next to the exe** |
9
+
10
+ ## `fpptools_estructuras.exe`
11
+
12
+ Same as `fpptools str list --lang es -o estructuras.xlsx` (columns in [str list](str-list.md)), for users who don't use the command line:
13
+
14
+ - Takes the configuration active in FP Pro.
15
+ - Writes `estructuras.xlsx` in the exe's folder; if that file is open in Excel, writes `estructuras_<YYYYMMDD_HHMMSS>.xlsx` instead.
16
+ - The window stays open at the end (`Pulse Enter para cerrar…`) with `Listo: <file>` or the error.
17
+ - The exe must be in a folder where the user can write (not `C:\Program Files`).
18
+ - With Python installed, the same is the `fpptools-estructuras` command.
@@ -0,0 +1,56 @@
1
+ # `fpptools fit list`
2
+
3
+ Lists every fitting used, one row per fitting.
4
+
5
+ ```powershell
6
+ fpptools fit list # structures -> fittings_str.csv
7
+ fpptools fit list --source blk -o fittings_blk.xlsx
8
+ fpptools fit list --source job --job 27002_6 -o -
9
+ fpptools fit list --source jobs
10
+ fpptools fit list --under "LINEA X" --no-db
11
+ ```
12
+
13
+ ## `--source`
14
+
15
+ | Value | What it scans | Folder (FP_PRO.INI) | Columns |
16
+ |---|---|---|---|
17
+ | `str` (default) | every structure `.STR` | `STR_PATH` | Folder, File, Fitting, Source, Note |
18
+ | `blk` | every block `.BLK` | `BLK_PATH` | Folder, File, Fitting, Source, Note |
19
+ | `job` | the job records of one job (`--job NAME`, asked if missing) | `JOB_PATH` | Job, Item, Fitting, Source |
20
+ | `jobs` | the job records of every job | `JOB_PATH` | Job, Item, Fitting, Source |
21
+
22
+ - **Source** is the element the fitting hangs from, as `<element>:<code>` (e.g. `FP_NODE:10`), or `FP_KIT:<kit>` for fittings that come from a kit.
23
+ - **Note** says when a kit is not in the database, or when `--no-db` was used (the kit is listed but not expanded).
24
+ - Job records are found as `<JOB>_JOBRECORD*.XML` under `JOB_PATH` (as in 0.1; not yet checked on FP Pro 11).
25
+
26
+ ## Kits and the database
27
+
28
+ Kits in STR/BLK files are expanded from the database of the active configuration (tables `kit` / `dettagliokit`): one row per fitting of the kit. Fittings written inside a kit in the file are not listed again.
29
+
30
+ - MySQL (`CONN_STR_FP_PRO=1`): settings from `[MYSQL]` (see [config](config.md)).
31
+ - Access (`CONN_STR_FP_PRO=0`): `Fp_Pro32.MDB` in `MDB_PATH`; needs the Microsoft Access ODBC driver with the same bitness (32/64-bit) as Python or the exe.
32
+ - Queries are read-only (SELECT only).
33
+ - `--no-db` skips the database (e.g. no access to the server).
34
+
35
+ ## Options
36
+
37
+ | Option | Default | |
38
+ |---|---|---|
39
+ | `--source str\|blk\|job\|jobs` | `str` | see above |
40
+ | `--job NAME` | asked | job for `--source job` |
41
+ | `--no-db` | off | don't read the database; kits listed, not expanded |
42
+ | `--under`, `--match`, `--root` | | `str` and `blk` only, see [options](options.md) |
43
+ | `-o`, `--out` | `fittings_<source>.csv` | `.csv`, `.xlsx` or `-` |
44
+ | `--lang en\|es` | `en` | column headers |
45
+
46
+ A file that can't be read gets a row with the reason in **Note** and a `warning:` line; the rest goes on.
47
+
48
+ ## 0.1 syntax (`list_fittings`)
49
+
50
+ `fpptools list_fittings --searchtype str|blk|job|jobs [--tofile y|n] [--verbose y|n]` still works (hidden, deprecated; it prints a reminder):
51
+
52
+ | 0.1 | Now |
53
+ |---|---|
54
+ | `--searchtype X` | `fit list --source X` |
55
+ | `--tofile y` (default) | writes `fittinglist_<X>.csv` |
56
+ | `--verbose y` (or `--tofile n`) | prints to the console (`-o -`) |
@@ -0,0 +1,41 @@
1
+ # Common options
2
+
3
+ ## Configuration
4
+
5
+ | Option | |
6
+ |---|---|
7
+ | (none) | the configuration active in FP Pro: `%APPDATA%\Emmegisoft\FP_PRO\FP_PRO.INI` |
8
+ | `--ini PATH` | another FP_PRO.INI; goes **before** the command: `fpptools --ini D:\x\FP_PRO.INI str list` |
9
+ | `FPPTOOLS_INI` | environment variable, same as `--ini` |
10
+
11
+ Nothing is read until a command needs it, so `--help` and `--version` work on a PC without FP Pro.
12
+
13
+ ## Choosing files (`str list`, `fit list` str/blk, `wipe`)
14
+
15
+ | Option | |
16
+ |---|---|
17
+ | `--under FOLDER` | only inside that folder, relative to the root, e.g. `019_SERIE_22_PESADO` or `LINEA SUPERIOR/SERIE 35` (either slash, case-insensitive) |
18
+ | `--match PATTERN` | file name without extension, wildcards `*` `?`, case-insensitive, e.g. `"VTA_*"` |
19
+ | `--root FOLDER` | scan this folder instead of `STR_PATH` / `BLK_PATH` / `JOB_PATH` (e.g. a copy of a configuration) |
20
+
21
+ ## Output (`str list`, `fit list`)
22
+
23
+ | `-o` / `--out` | |
24
+ |---|---|
25
+ | `file.csv` | `;` separated, UTF-8 with BOM, CRLF: Excel opens it with accents and columns right (Spanish/Italian locale) |
26
+ | `file.xlsx` | Excel workbook: frozen header row, filters, column widths |
27
+ | `-` | the console (`;` separated) |
28
+
29
+ Defaults: `structures.csv`, `fittings_<source>.csv`, in the current folder. `--lang es` writes Spanish headers.
30
+
31
+ Progress bars and `warning:` lines go to the error stream (stderr), so `-o -` output can be redirected cleanly: `fpptools str list -o - > estructuras.csv`.
32
+
33
+ ## General
34
+
35
+ | | |
36
+ |---|---|
37
+ | `--version` | prints the version |
38
+ | `-h`, `--help` | on every command and group: `fpptools wipe kits --help` |
39
+ | `python -m fpptools …` | same as `fpptools …` (when the command isn't on the PATH) |
40
+
41
+ Errors (INI not found, folder missing, database unreachable) print one `Error:` line, no traceback, and exit with code 1.
@@ -0,0 +1,39 @@
1
+ # `fpptools str list`
2
+
3
+ Lists the structures (`.STR`) of `STR_PATH`: the same data as FP Pro's **Estructura** browser.
4
+
5
+ ```powershell
6
+ fpptools str list # -> structures.csv
7
+ fpptools str list --lang es -o estructuras.xlsx
8
+ fpptools str list --under 019_SERIE_22_PESADO --match "VTA_*" -o -
9
+ ```
10
+
11
+ ## Columns
12
+
13
+ | Column (`--lang es`) | Where it comes from |
14
+ |---|---|
15
+ | Folder (Carpeta) | folder of the file inside `STR_PATH` (the tree in the browser), e.g. `019_SERIE_22_PESADO\VENTANA_PROYECTABLE_S22` |
16
+ | Name (Nombre) | file name without `.STR` (the "Nombre" field in FP Pro) |
17
+ | Unique code (Nombre único) | `FP_TREE/@NameStr` (FP Pro's "nombre unívoco"). Not enforced unique: two structures can share it, and it can be empty |
18
+ | Description (Descripción) | `FP_TREE/FP_DESCRIPTION`, stored as Base64 inside the file and decoded |
19
+ | Error | only when some file couldn't be read: the reason, on that file's row |
20
+
21
+ Facade structures (`FP_FACADE` files) are included.
22
+
23
+ ## Options
24
+
25
+ | Option | Default | |
26
+ |---|---|---|
27
+ | `--under FOLDER` | all | only that folder of the tree (either slash, case-insensitive) |
28
+ | `--match PATTERN` | all | file name without extension, `*` and `?` wildcards, case-insensitive |
29
+ | `--root FOLDER` | `STR_PATH` | scan another folder (e.g. a copy) |
30
+ | `-o`, `--out` | `structures.csv` | `.csv`, `.xlsx` or `-` (console) |
31
+ | `--lang en\|es` | `en` | column headers |
32
+
33
+ See [options](options.md) for the output format.
34
+
35
+ ## When a file can't be read
36
+
37
+ The export goes on: the row is kept with an **Error** column, and a `warning:` line is printed for each such file. The summary at the end says how many had errors.
38
+
39
+ For a double-click export without the command line, see [`fpptools_estructuras.exe`](exe.md).
@@ -0,0 +1,44 @@
1
+ # `fpptools wipe`
2
+
3
+ Commands that **modify** FP Pro files. They **only simulate** unless you add `--apply`.
4
+
5
+ | Command | Files | What is removed |
6
+ |---|---|---|
7
+ | `wipe panedefs` | structures (`.STR`) | from every pane (`FP_NODE ElementType="8650"`): its glass fittings (`FP_FITTING` directly under the pane), the glass DXF (`DXF` of `FP_PIECE Type="8510"`) and the pane table (`PaneTableCode`). Leaves a reusable base that can't be used without re-checking glass and pane table |
8
+ | `wipe kits` | structures (`--source str`, default) or blocks (`--source blk`) | every kit (`FP_KIT` with its content) |
9
+
10
+ ```powershell
11
+ fpptools wipe panedefs --under "LINEA X" # simulation
12
+ fpptools wipe panedefs --under "LINEA X" --report informe.txt # simulation, report saved
13
+ fpptools wipe panedefs --under "LINEA X" --apply # backup + write
14
+ fpptools wipe kits --source blk --match "BLK_OLD_*" --apply
15
+ ```
16
+
17
+ **Close the structures/blocks in FP Pro before `--apply`.**
18
+
19
+ ## Simulation (default)
20
+
21
+ Prints, per file, what would change (e.g. `pane 7: glass DXF GLASSES\ST4_4.DXF removed`) and the total:
22
+ `703 file(s) would change, 6826 change(s).` Nothing is written. `--report FILE` also saves that report to a file (UTF-8). With nothing to change: `Nothing to change in N file(s).`
23
+
24
+ ## `--apply`
25
+
26
+ 1. **Backup first:** every file that will change is copied to `--backup-dir` (default `.\fpptools_backups`, in the current folder) under a new `<YYYYMMDD_HHMMSS>\` folder, keeping its sub-folders, together with `report.txt`. If the backup can't be made, nothing is written.
27
+ 2. **Then write:** each file is written to a temporary file and swapped in.
28
+ 3. **FP Pro's format is kept:** XML declaration, windows-1252, line endings (also inside CDATA), `<X/>` vs `<X />` and `<X></X>` as in the original. Only the lines of the removed parts change; an untouched file stays byte-identical.
29
+
30
+ The backup folder **can't be inside the scanned folder** (FP Pro would list the backups as structures): fpptools refuses and asks for another `--backup-dir`.
31
+
32
+ **To undo:** copy the files from the backup folder back over the originals (same sub-folders).
33
+
34
+ ## Options
35
+
36
+ | Option | Default | |
37
+ |---|---|---|
38
+ | `--apply` | off | write (after the backup) |
39
+ | `--backup-dir DIR` | `fpptools_backups` | where `--apply` copies the originals |
40
+ | `--report FILE` | none | save the simulation report |
41
+ | `--source str\|blk` | `str` | `wipe kits` only |
42
+ | `--under`, `--match`, `--root` | | see [options](options.md) |
43
+
44
+ A file that can't be parsed is skipped with a `warning:` line; the others go on.
@@ -1,3 +1,3 @@
1
1
  """fpptools: administration and debugging CLI for emmegisoft FP Pro."""
2
2
 
3
- __version__ = "0.2.0"
3
+ __version__ = "0.2.1"
@@ -113,7 +113,8 @@ def panedefs_cmd(app: App, root, under, match, apply, backup_dir, report):
113
113
 
114
114
 
115
115
  @wipe_group.command("kits")
116
- @click.option("--source", type=click.Choice(["str", "blk"]), default="str", show_default=True)
116
+ @click.option("--source", type=click.Choice(["str", "blk"]), default="str", show_default=True,
117
+ help="Structures (STR_PATH) or blocks (BLK_PATH).")
117
118
  @scope_options
118
119
  @apply_options
119
120
  @pass_app
@@ -5,7 +5,7 @@ description = "Administration and debugging CLI for emmegisoft FP Pro (structure
5
5
  readme = "README.md"
6
6
  license = "MIT"
7
7
  license-files = ["LICENSE"]
8
- authors = [{ name = "Andres Perez", email = "andresperezcera@gmail.com" }]
8
+ authors = [{ name = "Andres Perez", email = "me@aperezc.xyz" }]
9
9
  requires-python = ">=3.10"
10
10
  classifiers = [
11
11
  "Topic :: Utilities",
@@ -43,7 +43,7 @@ build-backend = "hatchling.build"
43
43
  path = "fpptools/__init__.py"
44
44
 
45
45
  [tool.hatch.build.targets.sdist]
46
- include = ["fpptools", "tests", "scripts", "README.md", "LICENSE", "CHANGELOG.md"]
46
+ include = ["fpptools", "tests", "scripts", "docs", "README.md", "LICENSE", "CHANGELOG.md"]
47
47
 
48
48
  [tool.hatch.build.targets.wheel]
49
49
  packages = ["fpptools"]
fpptools-0.2.0/PKG-INFO DELETED
@@ -1,129 +0,0 @@
1
- Metadata-Version: 2.5
2
- Name: fpptools
3
- Version: 0.2.0
4
- Summary: Administration and debugging CLI for emmegisoft FP Pro (structures, blocks, jobs)
5
- Project-URL: Repository, https://github.com/andoresuperesu/fpptools
6
- Author-email: Andres Perez <andresperezcera@gmail.com>
7
- License-Expression: MIT
8
- License-File: LICENSE
9
- Classifier: Environment :: Console
10
- Classifier: Environment :: Win32 (MS Windows)
11
- Classifier: Operating System :: Microsoft :: Windows
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
- Classifier: Topic :: Utilities
15
- Requires-Python: >=3.10
16
- Requires-Dist: click>=8.1
17
- Requires-Dist: lxml>=5.0
18
- Requires-Dist: openpyxl>=3.1
19
- Requires-Dist: pymysql>=1.1
20
- Requires-Dist: pyodbc>=5.0; sys_platform == 'win32'
21
- Description-Content-Type: text/markdown
22
-
23
- # fpptools
24
-
25
- Administration and debugging command line for emmegisoft **FP Pro**: structures (`.STR`), blocks (`.BLK`) and job records.
26
- It works on the configuration that is **active in FP Pro right now** (read from `%APPDATA%\Emmegisoft\FP_PRO\FP_PRO.INI`).
27
-
28
- *Guía rápida en español más abajo.*
29
-
30
- ## Install
31
-
32
- ```powershell
33
- pip install fpptools # or: uv tool install fpptools
34
- fpptools --help
35
- ```
36
-
37
- Standalone exes (no Python needed) are built with `scripts\build_exe.ps1`:
38
-
39
- - `fpptools.exe`: the full command line.
40
- - `fpptools_estructuras.exe`: **double-click** to export the structures of the active configuration to `estructuras.xlsx` next to the exe (same as `fpptools str list --lang es -o estructuras.xlsx`). If that file is open in Excel, it writes `estructuras_<date_time>.xlsx` instead. Also installed as the `fpptools-estructuras` command.
41
-
42
- ## Commands
43
-
44
- | Command | What it does |
45
- |---|---|
46
- | `fpptools config` | Show the active configuration: folders, database (password hidden) |
47
- | `fpptools str list` | List structures: folder, name, unique code, description |
48
- | `fpptools fit list` | List fittings used in structures, blocks, one job or all jobs (kits expanded from the database) |
49
- | `fpptools wipe panedefs` | Remove glass fittings, glass DXF and pane table from every pane of the structures |
50
- | `fpptools wipe kits` | Remove every kit from structures or blocks |
51
-
52
- Every command has `--help`.
53
-
54
- ### Choosing files
55
-
56
- Commands that read STR/BLK folders accept:
57
-
58
- - `--under FOLDER`: only that folder of the tree, e.g. `--under 019_SERIE_22_PESADO`
59
- - `--match PATTERN`: file name pattern without extension, e.g. `--match "VTA_*"` (case-insensitive)
60
- - `--root FOLDER`: another folder instead of the one in FP_PRO.INI
61
-
62
- ### Output
63
-
64
- `--out file.csv` (default), `--out file.xlsx`, or `--out -` for the console.
65
- CSV files use `;` and UTF-8 with BOM, so Excel opens them correctly with accents. `--lang es` writes Spanish headers.
66
-
67
- ### Commands that modify files: simulate first
68
-
69
- `wipe` commands **only simulate** by default: they report what would change and write nothing.
70
- Add `--apply` to write. Before writing, every file is copied to `--backup-dir` (default `.\fpptools_backups\<date_time>\`, same sub-folders) together with a `report.txt`. To undo, copy the backed-up files back.
71
-
72
- ```powershell
73
- fpptools wipe panedefs --under "LINEA X" # simulation
74
- fpptools wipe panedefs --under "LINEA X" --apply # backup + write
75
- ```
76
-
77
- Close the structures in FP Pro before applying.
78
-
79
- ### Structure fields
80
-
81
- | Column | Where it comes from |
82
- |---|---|
83
- | Folder | Folder of the file inside STR_PATH (the tree in FP Pro's structure browser) |
84
- | Name | File name without `.STR` (the "Nombre" field in FP Pro) |
85
- | Unique code | `FP_TREE/@NameStr` ("nombre unívoco" in FP Pro) |
86
- | Description | `FP_TREE/FP_DESCRIPTION`, stored as Base64 inside the file |
87
-
88
- ### Database
89
-
90
- `fit list` reads kits from the FP Pro database of the active configuration: MySQL (`CONN_STR_FP_PRO=1`, settings in `[MYSQL]`) or Access (`Fp_Pro32.MDB` in `MDB_PATH`). Queries are read-only.
91
- Access needs the Microsoft Access ODBC driver with the same bitness (32/64-bit) as Python. Use `--no-db` to skip the database.
92
-
93
- ### Other options
94
-
95
- - `--ini PATH` (or environment variable `FPPTOOLS_INI`): use another FP_PRO.INI.
96
- - `fpptools list_fittings --searchtype str` (0.1 syntax) still works but is deprecated.
97
-
98
- ---
99
-
100
- ## Guía rápida (español)
101
-
102
- `fpptools` trabaja sobre la configuración **activa en FP Pro**.
103
-
104
- **Exportar nombre y descripción de las estructuras:**
105
-
106
- ```powershell
107
- fpptools str list --lang es -o estructuras.xlsx
108
- fpptools str list --under 019_SERIE_22_PESADO --lang es -o serie22.csv
109
- ```
110
-
111
- Columnas: Carpeta, Nombre (nombre del archivo), Nombre único (nombre unívoco), Descripción.
112
-
113
- **Sin línea de comandos:** doble clic en `fpptools_estructuras.exe`. Crea `estructuras.xlsx` en la misma carpeta del programa (si está abierto en Excel, crea `estructuras_<fecha_hora>.xlsx`). El programa debe estar en una carpeta donde se pueda escribir (no en `C:\Program Files`).
114
-
115
- **Comandos que modifican archivos** (`wipe`): por defecto solo **simulan** y muestran qué cambiarían. Con `--apply` primero copian los originales a `fpptools_backups\<fecha_hora>\` y luego escriben. Cierre las estructuras en FP Pro antes de aplicar.
116
-
117
- `fpptools config` muestra qué configuración, carpetas y base de datos está usando.
118
-
119
- ## Development
120
-
121
- ```powershell
122
- uv sync
123
- uv run pytest
124
- uv run fpptools --help
125
- uv build ; uv publish # PyPI
126
- .\scripts\build_exe.ps1 # dist_exe\fpptools.exe, dist_exe\fpptools_estructuras.exe (not in dist\: that is PyPI's)
127
- ```
128
-
129
- License: MIT.
fpptools-0.2.0/README.md DELETED
@@ -1,107 +0,0 @@
1
- # fpptools
2
-
3
- Administration and debugging command line for emmegisoft **FP Pro**: structures (`.STR`), blocks (`.BLK`) and job records.
4
- It works on the configuration that is **active in FP Pro right now** (read from `%APPDATA%\Emmegisoft\FP_PRO\FP_PRO.INI`).
5
-
6
- *Guía rápida en español más abajo.*
7
-
8
- ## Install
9
-
10
- ```powershell
11
- pip install fpptools # or: uv tool install fpptools
12
- fpptools --help
13
- ```
14
-
15
- Standalone exes (no Python needed) are built with `scripts\build_exe.ps1`:
16
-
17
- - `fpptools.exe`: the full command line.
18
- - `fpptools_estructuras.exe`: **double-click** to export the structures of the active configuration to `estructuras.xlsx` next to the exe (same as `fpptools str list --lang es -o estructuras.xlsx`). If that file is open in Excel, it writes `estructuras_<date_time>.xlsx` instead. Also installed as the `fpptools-estructuras` command.
19
-
20
- ## Commands
21
-
22
- | Command | What it does |
23
- |---|---|
24
- | `fpptools config` | Show the active configuration: folders, database (password hidden) |
25
- | `fpptools str list` | List structures: folder, name, unique code, description |
26
- | `fpptools fit list` | List fittings used in structures, blocks, one job or all jobs (kits expanded from the database) |
27
- | `fpptools wipe panedefs` | Remove glass fittings, glass DXF and pane table from every pane of the structures |
28
- | `fpptools wipe kits` | Remove every kit from structures or blocks |
29
-
30
- Every command has `--help`.
31
-
32
- ### Choosing files
33
-
34
- Commands that read STR/BLK folders accept:
35
-
36
- - `--under FOLDER`: only that folder of the tree, e.g. `--under 019_SERIE_22_PESADO`
37
- - `--match PATTERN`: file name pattern without extension, e.g. `--match "VTA_*"` (case-insensitive)
38
- - `--root FOLDER`: another folder instead of the one in FP_PRO.INI
39
-
40
- ### Output
41
-
42
- `--out file.csv` (default), `--out file.xlsx`, or `--out -` for the console.
43
- CSV files use `;` and UTF-8 with BOM, so Excel opens them correctly with accents. `--lang es` writes Spanish headers.
44
-
45
- ### Commands that modify files: simulate first
46
-
47
- `wipe` commands **only simulate** by default: they report what would change and write nothing.
48
- Add `--apply` to write. Before writing, every file is copied to `--backup-dir` (default `.\fpptools_backups\<date_time>\`, same sub-folders) together with a `report.txt`. To undo, copy the backed-up files back.
49
-
50
- ```powershell
51
- fpptools wipe panedefs --under "LINEA X" # simulation
52
- fpptools wipe panedefs --under "LINEA X" --apply # backup + write
53
- ```
54
-
55
- Close the structures in FP Pro before applying.
56
-
57
- ### Structure fields
58
-
59
- | Column | Where it comes from |
60
- |---|---|
61
- | Folder | Folder of the file inside STR_PATH (the tree in FP Pro's structure browser) |
62
- | Name | File name without `.STR` (the "Nombre" field in FP Pro) |
63
- | Unique code | `FP_TREE/@NameStr` ("nombre unívoco" in FP Pro) |
64
- | Description | `FP_TREE/FP_DESCRIPTION`, stored as Base64 inside the file |
65
-
66
- ### Database
67
-
68
- `fit list` reads kits from the FP Pro database of the active configuration: MySQL (`CONN_STR_FP_PRO=1`, settings in `[MYSQL]`) or Access (`Fp_Pro32.MDB` in `MDB_PATH`). Queries are read-only.
69
- Access needs the Microsoft Access ODBC driver with the same bitness (32/64-bit) as Python. Use `--no-db` to skip the database.
70
-
71
- ### Other options
72
-
73
- - `--ini PATH` (or environment variable `FPPTOOLS_INI`): use another FP_PRO.INI.
74
- - `fpptools list_fittings --searchtype str` (0.1 syntax) still works but is deprecated.
75
-
76
- ---
77
-
78
- ## Guía rápida (español)
79
-
80
- `fpptools` trabaja sobre la configuración **activa en FP Pro**.
81
-
82
- **Exportar nombre y descripción de las estructuras:**
83
-
84
- ```powershell
85
- fpptools str list --lang es -o estructuras.xlsx
86
- fpptools str list --under 019_SERIE_22_PESADO --lang es -o serie22.csv
87
- ```
88
-
89
- Columnas: Carpeta, Nombre (nombre del archivo), Nombre único (nombre unívoco), Descripción.
90
-
91
- **Sin línea de comandos:** doble clic en `fpptools_estructuras.exe`. Crea `estructuras.xlsx` en la misma carpeta del programa (si está abierto en Excel, crea `estructuras_<fecha_hora>.xlsx`). El programa debe estar en una carpeta donde se pueda escribir (no en `C:\Program Files`).
92
-
93
- **Comandos que modifican archivos** (`wipe`): por defecto solo **simulan** y muestran qué cambiarían. Con `--apply` primero copian los originales a `fpptools_backups\<fecha_hora>\` y luego escriben. Cierre las estructuras en FP Pro antes de aplicar.
94
-
95
- `fpptools config` muestra qué configuración, carpetas y base de datos está usando.
96
-
97
- ## Development
98
-
99
- ```powershell
100
- uv sync
101
- uv run pytest
102
- uv run fpptools --help
103
- uv build ; uv publish # PyPI
104
- .\scripts\build_exe.ps1 # dist_exe\fpptools.exe, dist_exe\fpptools_estructuras.exe (not in dist\: that is PyPI's)
105
- ```
106
-
107
- License: MIT.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes