Skip to main content

Generate Word-format Census Bureau disclosure documentation from a packet YAML and a support workbook.

Project description

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

pip install wf-disclosure

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

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

# 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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wf_disclosure_temp4-0.1.0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wf_disclosure_temp4-0.1.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file wf_disclosure_temp4-0.1.0.tar.gz.

File metadata

  • Download URL: wf_disclosure_temp4-0.1.0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for wf_disclosure_temp4-0.1.0.tar.gz
Algorithm Hash digest
SHA256 053ab5fb7b30f353ae3ea51d07a4ab5e71187138d1a96cfbfe2fe5cd15349391
MD5 db2e9f1a37a18b7cc7d5d058d309cc68
BLAKE2b-256 e8877693570755ccac531a6db3a2e4e08e049eed3d7e6328797ee14ea0336a8d

See more details on using hashes here.

File details

Details for the file wf_disclosure_temp4-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wf_disclosure_temp4-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a72a9b96fe924110ac0c7497902d2516d343aaab695347bca6e26cc81fd8658d
MD5 c1e45fc03d3df2567b4131a7bc2db0de
BLAKE2b-256 2c861a2d3af3f5cd34e98c5332e6d90733f27a293aaa1b5ab62e61b38106851c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page