Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
__pycache__
__pycache__
.venv
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
22 changes: 17 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,30 @@ This is a web application for viewing and managing security control overlays tha
## Common Development Commands

### Python Data Extraction

Python 3.13 (pinned in `.python-version`), managed with `uv`. Never use bare `pip` or conda.

```bash
# One-time environment setup
uv venv --python 3.13
uv pip install -r requirements.txt

# Extract overlay data from PDFs (requires PyMuPDF/fitz)
python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf
python classified_information/extract_classified_information.py classified_information/classified_information_overlay_2022.pdf
uv run python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf
uv run python classified_information/extract_classified_information.py classified_information/classified_information_overlay_2022.pdf

# Debug specific pages
python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf --debug-page 10
uv run python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf --debug-page 10

# Sort NIST controls naturally
python nist_catalog/nist_sorter.py input.json output.json
uv run python nist_catalog/nist_sorter.py input.json output.json
```

**Extractor output paths:** `extract_*.py` write their JSON to the *current working directory* using hardcoded
filenames, so run them from the repo root to land on the committed files. `nist_sorter.py` overwrites its input
file when no output path is given. When regenerating output just to verify a change, run from a scratch
directory so the committed JSON is never clobbered, then `diff` the result.

### Development
- No build process - edit `index.html` directly
- No package manager - pure vanilla JavaScript
Expand Down Expand Up @@ -93,6 +105,6 @@ No automated tests exist. Manual testing process:

## Dependencies

- **Python**: PyMuPDF (fitz) for PDF extraction
- **Python**: 3.13, PyMuPDF (fitz) for PDF extraction (see `requirements.txt`)
- **JavaScript**: None (vanilla JS only)
- **Deployment**: GitHub Pages
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,26 @@ The application uses a PDF → JSON → Web pipeline:

### Extracting Data from PDFs

The extractors target **Python 3.13** (pinned in `.python-version`) and depend on PyMuPDF (fitz). Set up the environment with [uv](https://docs.astral.sh/uv/):

```bash
# Requires PyMuPDF (fitz)
pip install PyMuPDF
# Create the environment and install dependencies
uv venv --python 3.13
uv pip install -r requirements.txt
```

The extractor scripts write their JSON output to the **current working directory**, so run them from the repository root:

```bash
# Extract CNSSI 1253 overlay
python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf
uv run python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf

# Extract Classified Information overlay
python classified_information/extract_classified_information.py \
uv run python classified_information/extract_classified_information.py \
classified_information/classified_information_overlay_2022.pdf

# Debug specific pages
python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf --debug-page 10
uv run python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf --debug-page 10
```

---
Expand Down Expand Up @@ -192,7 +199,7 @@ The site is deployed at [https://il6.sl5taskforce.org/](https://il6.sl5taskforce
| Component | Dependency |
|-----------|------------|
| **Web App** | None (vanilla JavaScript) |
| **PDF Extraction** | Python 3, PyMuPDF (`pip install PyMuPDF`) |
| **PDF Extraction** | Python 3.13, PyMuPDF (`uv pip install -r requirements.txt`) |
| **Deployment** | GitHub Pages |

---
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# PDF extraction dependencies
PyMuPDF>=1.23.0
PyMuPDF>=1.28.0