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_temp3-0.1.0.tar.gz (18.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_temp3-0.1.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wf_disclosure_temp3-0.1.0.tar.gz
  • Upload date:
  • Size: 18.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_temp3-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1fb87ac07a23ab440dda6a5db63debc03bd5f7ed914a057bdc5c6aa6b808eeea
MD5 c9344110d4037d2b22c60b1115b360c6
BLAKE2b-256 8b6b403eddb5d6d444d2443f9625507830ece48600c6645c107794b955392e73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wf_disclosure_temp3-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d95331a5bf21e3a8b8c515da4897bab8b2e77dd1c5ea007a375873e927c407e5
MD5 bc0ee9e5dc57f675e57d5ff1f66e90c5
BLAKE2b-256 c7f8cc227adc9b54e01e3fdf25939ee7c1e2f487f8074e085a854d9e89979be1

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