INFINITE ANTHOLOGIES — LOCAL EARLY SF CORPUS SCANNER

WHAT THIS PACKAGE DOES
----------------------
The local web application lets a researcher:
1. Run a small Python server on their own computer.
2. Open a browser interface at http://127.0.0.1:5000
3. Enter their own OpenAI API key.
4. Select up to 100 plain-text (.txt) fiction files.
5. Analyze only the first 1,000 model tokens of each file.
6. Download a CSV containing:
   - science-fiction rating (0-10)
   - SF level
   - plot description (<=30 words)
   - OCR quality
   - up to three period-appropriate popular-fiction genres
   - token-usage metadata
   - status/error fields

INSTALLATION
------------
1. Install Python 3.10 or later.
2. Open a terminal or Anaconda PowerShell in this folder.
3. Run:
       pip install -r requirements.txt

RUNNING THE LOCAL APP
---------------------
1. Run:
       python app.py
2. Open:
       http://127.0.0.1:5000
3. Press Ctrl+C in the terminal when finished.

SECURITY
--------
The application is intentionally bound to 127.0.0.1 rather than the public
network. It does not save the user's API key to disk. Do not change the host to
0.0.0.0 or deploy this version publicly without redesigning authentication and
secret management.

COST CONTROL
------------
The interface has a hard limit of 100 files per run and reads at most the first
1,000 model tokens from each file. This is a usage guard, not a guaranteed dollar
ceiling. API pricing and project rate limits can change, and prompt/output tokens
also contribute to usage. Researchers should configure their own OpenAI project
budget/alerts before running a corpus scan.

METHODOLOGICAL CAUTION
----------------------
This is a screening tool, not a final genre adjudicator. Because only the opening
sample of each file is analysed, science-fiction or genre material appearing later
in a serial may be missed. Candidate texts should be manually reviewed.
