Metadata-Version: 2.5
Name: bookish-qa
Version: 0.1.0
Summary: Local-first, read-only quality assurance for digital products, templates, ebooks and downloadable bundles.
Project-URL: Homepage, https://github.com/tigerbeef/bookish-developer-toolkit
Project-URL: Repository, https://github.com/tigerbeef/bookish-developer-toolkit
Project-URL: Issues, https://github.com/tigerbeef/bookish-developer-toolkit/issues
Project-URL: Documentation, https://github.com/tigerbeef/bookish-developer-toolkit/tree/main/docs
Project-URL: Changelog, https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/CHANGELOG.md
Author: tigerbeef
License-Expression: MIT
License-File: LICENSE
Keywords: cli,manifest,packaging,quality-assurance,sha256,validation,zip
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Typing :: Typed
Requires-Python: >=3.11
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: hypothesis>=6.100; extra == 'dev'
Requires-Dist: mypy>=1.11; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Requires-Dist: twine>=5.1; extra == 'dev'
Description-Content-Type: text/markdown

# bookish-developer-toolkit
Open-source tools for digital productivity, automation, and template development.

## Bookish QA

**Bookish QA** (`bookish-qa`) is a local-first command-line tool that checks a folder or a ZIP file
*before you ship it*: templates, ebooks, software packages and downloadable bundles. It reports
empty files, duplicate files, files that should not ship (for example a `.env`), missing files you
require, names that break on Windows or macOS, and ZIPs that are damaged or unsafe to open. It can
also check a product against a manifest of file sizes and SHA-256 hashes.

> **Status: version 0.1.0 release candidate. Not published to PyPI yet.** The code is complete for
> Phase 1 and passes CI on Linux, macOS and Windows with Python 3.11 to 3.14. Until the first release
> you install it from a built wheel or from source (see below). The project is young: expect rough
> edges, read [Known limitations](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/dev/KNOWN_LIMITATIONS.md),
> and treat a clean report as "no problems found by these checks", not as proof that a product is
> flawless or safe.

### What makes it different

- **Read-only scanning.** A scan never modifies, moves or deletes your files. It writes a report
  only when you pass `--output`, and then only to a *new* file (it never overwrites, and refuses to
  write inside what it is scanning).
- **Local-first.** Your files are never sent anywhere. The package has no network code, and a test
  checks that it does not import networking modules.
- **ZIPs are inspected, not extracted.** Archives are read in memory with strict size, count, ratio
  and time limits, using a small purpose-built parser.
- **Says when it could not check something.** Encrypted entries, unsupported compression, files it
  could not hash and similar gaps make the inspection *incomplete*. An incomplete scan is labelled as
  such in every report, and `--require-complete` turns it into a failure.
- **No runtime dependencies.** Python 3.11+ standard library only, which keeps it easy to audit.
- **Reports for people and machines.** Text for terminals, Markdown for issues and pull requests, and
  versioned JSON (with a published schema) for CI. Hostile file names cannot inject terminal escape
  sequences or Markdown into a report.

Other tools cover neighbouring ground (archive scanners, secret scanners, file-format validators,
checksum tools; see [the comparison](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/research/competitive-analysis.md)).
Bookish QA is not a replacement for them: it is not a malware scanner, not a secret scanner (it
only flags suspicious *file names* and never reads those files), and it does not validate the
internal structure of EPUB, PDF or other formats.

### Install

Requires Python 3.11 or newer on Windows, macOS or Linux. A virtual environment is recommended.

```bash
# After the first release is published:
python -m pip install bookish-qa

# Today: from a clone of this repository
python -m pip install .
# or, for development:
python -m pip install -e ".[dev]"
```

Check it works:

```bash
bookish-qa --version
bookish-qa --help
```

More detail (wheels, upgrading, uninstalling, platform notes) in
[docs/installation.md](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/installation.md).

### Quickstart

```bash
bookish-qa scan path/to/folder            # scan a folder
bookish-qa scan path/to/bundle.zip        # scan a ZIP (never extracted)
```

Example output for a small flawed bundle:

```text
Bookish QA 0.1.0
Target: flawed (directory)
Inspected: 6 files, 2 directories, 0 links, 0 other
Inspection: complete

ERROR    BQ004  .env
         Possibly sensitive file (matched ".env"). Contents were not read.
         Hint: Remove it from the release; it may contain credentials or keys.
WARNING  BQ001  docs/empty-notes.txt
         Empty file (0 bytes).
         Hint: Add the intended content or remove the file from the release.
...
Summary: 1 error, 3 warnings, 1 info. Result: FAIL (fail-on: error)
```

(Three findings are omitted from this excerpt; `examples/make_flawed_bundle.py` creates the bundle.)

Make the checks stricter or add your own requirements:

```bash
bookish-qa scan product --require README.md --require "LICENSE*" --max-file-size 20M \
    --fail-on warning --require-complete
bookish-qa scan product --config examples/bookish-qa.toml
```

Write a report to a new file:

```bash
bookish-qa scan product --format markdown --output report.md
bookish-qa scan product --format json --output report.json
```

Record what a release should contain, then verify a delivered copy against it:

```bash
bookish-qa manifest generate product --output manifest.json
bookish-qa scan delivered-copy.zip --manifest manifest.json
```

A step-by-step tutorial with example bundles is in
[docs/quickstart.md](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/quickstart.md).

### Exit codes

| Code | Meaning |
|---|---|
| 0 | No finding at or above `--fail-on` (default `error`); with `--require-complete`, the inspection was also complete |
| 1 | Findings at or above `--fail-on`, or an incomplete inspection with `--require-complete` |
| 2 | Usage error or invalid configuration |
| 3 | Unreadable input, refused output path, closed output pipe, or internal error |
| 130 | Interrupted with Ctrl-C |

The exit code does not depend on `--format` or `--output`.

### What it checks

26 rules, each with a stable ID. Severities can be changed in a configuration file, and rules that
protect you from unsafe input cannot be switched off.

| Area | Rules |
|---|---|
| Files and folders (directories and ZIPs) | BQ001 empty file · BQ002 empty directory · BQ003 missing required file · BQ004 sensitive or junk file · BQ005 duplicate content (SHA-256) · BQ006 unexpected file · BQ007 file too large · BQ008 portability (Windows/macOS names, long paths) · BQ009 link or special file · BQ010 entry could not be inspected |
| ZIP archives | BQ100 unsafe path · BQ101 compression ratio · BQ102 size or count limit · BQ103 encrypted entry · BQ104 integrity failure · BQ105 duplicate names · BQ106 special entry · BQ107 nested archive · BQ108 invalid ZIP structure |
| Manifests | BQ200 missing · BQ201 invalid · BQ202 declared file missing · BQ203 undeclared file · BQ204 hash mismatch · BQ205 size mismatch · BQ206 unsafe or duplicate path |

BQ003, BQ006 and BQ007 do nothing until you give them a policy. The full catalogue, with what each
rule means and how to fix it, is in
[docs/rules.md](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/rules.md).

### Use it in CI

[examples/github-actions/bookish-qa.yml](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/examples/github-actions/bookish-qa.yml)
is a ready-to-copy GitHub Actions workflow that scans a folder, fails the job on problems and keeps
the report. [docs/ci.md](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/ci.md)
explains it.

### Documentation

| Document | Purpose |
|---|---|
| [Quickstart](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/quickstart.md) | First scan to first report, with example bundles |
| [Installation](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/installation.md) | Install, upgrade, uninstall, verify |
| [CLI reference](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/cli.md) | Every command, option and exit code |
| [Rules](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/rules.md) | The rule catalogue |
| [Configuration](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/configuration.md) | TOML configuration, limits, severities |
| [Manifests](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/manifest.md) | Manifest format, generation, verification |
| [Reports](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/reports.md) | Text, Markdown and JSON reports; the JSON schema |
| [CI integration](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/ci.md) | GitHub Actions example |
| [Troubleshooting](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/troubleshooting.md) | Messages, exit codes, false positives |
| [Threat model](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/threat-model.md) | What is defended, how, and what is not |
| [Known limitations](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/dev/KNOWN_LIMITATIONS.md) | Honest list of gaps |
| [Architecture](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/architecture.md) | Design and decisions |
| [Contributing](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/CONTRIBUTING.md) · [Security policy](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/SECURITY.md) · [Changelog](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/CHANGELOG.md) | Project policies |

### Safety, stated carefully

Bookish QA is built to handle untrusted folders, archives, manifests and configuration files
defensively, and the defences are tested, including with generated hostile inputs. That is not a
guarantee. On directories, an attacker who can change the folder *while it is being scanned* can race
the scanner (documented as KL-015); ZIP time limits are cooperative; and the POSIX output-safety code
has been exercised in CI but not mutation-tested. Run it on products you are preparing to ship, not as
a security boundary for hostile content. Details: the
[threat model](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/threat-model.md)
and [known limitations](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/docs/dev/KNOWN_LIMITATIONS.md).
To report a vulnerability, follow [SECURITY.md](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/SECURITY.md).

### License

MIT. See [LICENSE](https://github.com/tigerbeef/bookish-developer-toolkit/blob/main/LICENSE).

### Scope note

Bookish QA is an independent project. It contains no proprietary Bookish Marketplace products,
files, credentials or business assets, and none are used in its tests, fixtures or examples.
