Metadata-Version: 2.4
Name: wf-disclosure-temp3
Version: 0.1.0
Summary: Generate Word-format Census Bureau disclosure documentation from a packet YAML and a support workbook.
Project-URL: Homepage, https://pypi.org/project/wf-disclosure-temp3/
Author-email: wf-disclosure maintainers <penbit12@gmail.com>
License: MIT
License-File: LICENSE
Keywords: census,disclosure,documentation,quarto
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.8
Requires-Dist: openpyxl>=3.0
Requires-Dist: pandas>=1.5
Requires-Dist: polars>=0.20
Requires-Dist: pyyaml>=5.4
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Description-Content-Type: text/markdown

# wf-disclosure

Generate Word-format disclosure documentation for Census Bureau release packets.
Turns a packet YAML + a long-format Excel support workbook + per-sample membership CSVs
into a rendered `.docx` so that program names, sample sizes, estimate counts, tab
descriptions, glossary entries, and implicit-sample residuals are all generated, never
hand-typed.

## Install

```bash
pip install wf-disclosure
```

For the Census internal environment without public-pip access, build a wheel locally and
transfer it:

```bash
pip install build
python -m build
# then move dist/wf_disclosure-0.1.0-py3-none-any.whl into the environment and:
pip install wf_disclosure-0.1.0-py3-none-any.whl
```

## Runtime prerequisites

`wf-disclosure` builds the YAML inputs. Rendering the `.docx` uses **Quarto** with the
following R packages:

- A working `quarto` install (https://quarto.org)
- R with packages: `yaml`, `purrr`, `glue`, `stringr`

These are not Python dependencies and are installed separately.

## Quick start

```bash
# 1. Scaffold a project directory with config/, templates/, inputs/, to_support/, derived/
wfd-init my_packet

# 2. Rename the example packet to disclosure_packet.yaml and edit it
cd my_packet
mv inputs/disclosure_packet.example.yaml inputs/disclosure_packet.yaml

# 3. Drop your support workbook + sample-membership CSVs
#    into to_support/ and to_support/sample_membership/

# 4. Detect implicit-sample subset relationships
wfd-detect

# 5. Build the disclosure inputs YAML
wfd-build

# 6. Render to docx with Quarto
quarto render templates/disclosure_documentation.qmd \
  -P input_file:derived/disclosure_inputs.yaml \
  -o disclosure_documentation.docx
```

`wfd-detect` and `wfd-build` accept `--project-dir` if you don't want to `cd` into the
project.

## What gets shipped

The `wfd-init` command copies these bundled defaults into your project directory:

- `config/global_defaults.yaml` — matching models, sample roles, release language
- `config/description_templates.yaml` — prose templates per (model, role)
- `config/glossary.yaml` — term/definition pairs
- `templates/disclosure_documentation.qmd` — Quarto template for the docx
- `inputs/disclosure_packet.example.yaml` — example packet showing the schema

These are plain files. Edit them in the project directory; they're versioned with your
packet, not the installed package.

## Python API

```python
from pathlib import Path
from wf_disclosure import build, detect, WorkingDirs

dirs = WorkingDirs.from_root(Path("my_packet"))
detect.run(dirs)
build.run(dirs)
```

## License

MIT
