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_temp5-0.1.0.tar.gz (20.9 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_temp5-0.1.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for wf_disclosure_temp5-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dc06e6f407127a2815588f8cc8b4f5acfbe30b2c9749bb2daa94a17b868a584c
MD5 2c6f6ec0214e0622e4845d0b90ce29a0
BLAKE2b-256 8ca737b3aeb6aca41d745ce761ab4b87840d574434fa9a8db5d07a2ab46c1fa1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wf_disclosure_temp5-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 718c63f373d4ad41fb924ca1452914fbdac5c2d746b5073971cae67bbbc01c7c
MD5 e326c9b91236a7187fc378959ad46340
BLAKE2b-256 6b0095b8fab3b2453a5f0321eb596eaf13959b048156a54ef5ba9143895f7003

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