Skip to content

Commit 5c72faa

Browse files
committed
Expand README and gitignore
1 parent f86e8d4 commit 5c72faa

2 files changed

Lines changed: 55 additions & 17 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
__pycache__/
22
*.pyc
3+
.venv/
4+
.mypy_cache/
5+
.ruff_cache/
6+
dist/
7+
build/
8+
*.egg-info/

README.md

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,60 @@
11
# breach-web-scraper
2-
A Python tool for scraping breach websites to provide a nice summary.
32

4-
## WA AG scraper (initial source)
5-
This repository now includes a scraper for Washington Attorney General data breach notifications:
3+
[![CI](https://github.com/noderaven/breach-web-scraper/actions/workflows/ci.yml/badge.svg)](https://github.com/noderaven/breach-web-scraper/actions/workflows/ci.yml)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5+
[![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](pyproject.toml)
66

7-
- Source URL: `https://www.atg.wa.gov/data-breach-notifications`
8-
- Script: `scraper/wa_atg_scraper.py`
7+
A Python tool for scraping breach websites to provide a nice summary. The first
8+
supported source is the Washington State Attorney General data breach
9+
notifications page. Runtime dependencies: none (standard library only).
10+
11+
## Install
912

10-
### Usage
1113
```bash
12-
python scraper/wa_atg_scraper.py --output json --limit 10
13-
python scraper/wa_atg_scraper.py --output markdown --out-file wa_breaches.md
14-
python scraper/wa_atg_scraper.py --output csv --out-file wa_breaches.csv
14+
pip install .
1515
```
1616

17-
### Output fields
18-
The parser normalizes column names from the HTML table to `snake_case`. For cells containing links, it also emits a `<column>_url` field.
17+
This installs the `breach-scraper` console command.
1918

20-
### Known hurdles / maintenance notes
21-
- The scraper depends on the page containing a parseable HTML table.
22-
- If WA AG changes table structure or field names, parsing/normalization may need updates.
23-
- For production automation, add retries/backoff, persistence, and monitoring around this script.
19+
## Usage
2420

25-
### Tests
2621
```bash
27-
python -m unittest discover -s tests
22+
# Fetch live and print JSON (default), limited to 10 rows
23+
breach-scraper --output json --limit 10
24+
25+
# Markdown / CSV to a file
26+
breach-scraper --output markdown --out-file wa_breaches.md
27+
breach-scraper --output csv --out-file wa_breaches.csv
28+
29+
# Offline: parse a previously saved page (no network)
30+
breach-scraper --input-html saved_page.html --output json
31+
32+
# Override the User-Agent or retry count
33+
breach-scraper --user-agent "my-agent/1.0" --retries 5
2834
```
35+
36+
If the source returns HTTP 403, the tool prints an actionable message; use
37+
`--input-html` with a saved copy of the page, a different network, or a
38+
different `--user-agent`.
39+
40+
## Output fields
41+
42+
Column names from the HTML table are normalized to `snake_case`. Cells that
43+
contain links also emit a `<column>_url` field.
44+
45+
## Development
46+
47+
```bash
48+
pip install -e ".[dev]"
49+
ruff check .
50+
ruff format --check .
51+
mypy
52+
bandit -r breach_scraper
53+
python -m unittest discover -s tests -v
54+
```
55+
56+
## Source / maintenance notes
57+
58+
- Source URL: `https://www.atg.wa.gov/data-breach-notifications`
59+
- The scraper depends on the page exposing a parseable HTML table; if the WA AG
60+
changes the table structure or field names, parsing may need updates.

0 commit comments

Comments
 (0)