tweaked some code after looking at real images and added a readme

This commit is contained in:
2026-07-05 23:07:47 -05:00
parent 0da73f6c6e
commit 9eb7784e9c
5 changed files with 178 additions and 45 deletions

78
README.md Normal file
View File

@@ -0,0 +1,78 @@
# FCCS Data Extraction Tool
Extracts and organizes documents from FileCabinet CS (Thomson Reuters) using GUI automation. Designed to work across multiple client engagements without code changes.
## Prerequisites
- 32-bit Python (must match FCCS architecture)
- `pywinauto` (`pip install pywinauto`)
- FileCabinet CS installed and restored with client backup data
## Project Layout
| File | Purpose |
|------|---------|
| `config.ini` | All paths, timeouts, and FCCS control identifiers |
| `fccs_folders.txt` | FCCS folder templates (manually populated per engagement) |
| `fccs_config.py` | Shared config loading, logging, folder pattern building |
| `fccs_scan.py` | Step 1: Scan backup directory for drawer IDs |
| `fccs_export.py` | Step 2: Automate FCCS GUI to export all drawers |
| `fccs_reorganize.py` | Step 3: Parse filenames and rebuild folder structure |
## Setup Per Engagement
1. Edit `config.ini` -- point `backup_dir`, `export_dir`, and `output_dir` at the client's directories.
2. Populate `fccs_folders.txt` -- open FCCS > System Configuration > Document Folders and list each folder template exactly as shown, one per line. Keep the `YYYY` prefix on recurring folders. UltraTax CS folders are detected automatically and do not need to be listed.
## Workflow
### Step 1: Scan Drawers
```
python fccs_scan.py
```
Reads the restored FCCS backup directory and writes all drawer IDs (subfolder names) to `drawer_ids.txt`.
### Step 2: Export Documents
```
python fccs_export.py
```
Requires FCCS to be open with export destination already configured. Automates the GUI to export every drawer via File > Send To > File. Features:
- **Resumable** -- tracks completed drawers in `completed.txt`; safe to restart
- **Screenshots** -- captures failure states for diagnosis
- **Defensive** -- one bad drawer won't crash the entire run
### Step 3: Reorganize Files
```
python fccs_reorganize.py
```
Parses the flat exported filenames and copies them into an organized structure:
```
output/
01069_ABRAHAM, REBEKAH L./
2025 Tax Documents/
01069_ABRAHAM, REBEKAH L._2025 Tax Documents_03-03-2026_030126 E-mail re Tax Info.pdf
Permanent File/
01069_ABRAHAM, REBEKAH L._Permanent File_02-24-2018_Driver's License.pdf
UltraTax CS 12-31-2008/
01069_ABRAHAM, REBEKAH L._UltraTax CS 12-31-2008_02-12-2009_2008 Form 1040 Filing Instructions.doc
_unparsed/
(files that couldn't be parsed go here for manual review)
```
Exported filenames follow the format `{drawer_id}_{client_name}_{folder_name}_{creation_date}_{document_name}.ext`. The parser uses folder templates from `fccs_folders.txt` (with `YYYY` expanded via regex) and the creation date (`MM-DD-YYYY`) as anchors to reliably split the underscore-delimited fields. UltraTax CS folders are matched by a built-in pattern.
## Config Reference
All scripts read from `config.ini` (or specify `--config path\to\config.ini`).
- **`[paths]`** -- backup_dir, export_dir, output_dir, drawer_id_file, completed_file, log_file, screenshot_dir, folder_list
- **`[timeouts]`** -- nav_timeout, dialog_timeout, progress_appear, progress_finish, settle, confirm_timeout
- **`[controls]`** -- FCCS window class names and button titles (rarely need changing)