Skip to main content

Codebooks

Automatically generate codebooks from dataframes. Includes methods to:

  • Infer variable type (as unique key, indicator, categorical, or continuous).
  • Summarize values with histograms and KDEs.
  • Generate a self-contained HTML report (may be extended to PDF or other formats in the future).

Usage:

codebooks -o output.html input.csv

Example

Screenshot of codebook for test dataset

Adding variable descriptions

You can specify a csv file that maps variable names to descriptions using:

codebooks --desc descriptions.csv -o output.html input.csv

The csv file is expected to have two columns (variable, description).

License

3-Clause BSD (see LICENSE)

Tests

The test/ subdirectory contains a script to generate a synthetic data set, an integration test for the codebooks package, and a benchmark script used to test performance optimizations. You can run these with:

cd test
python dataset.py
codebooks --desc desc.csv dataset.csv
codebooks --desc desc.csv --parquet dataset.parquet
python benchmark.py

Authors

Mark Howison
http://mark.howison.org

Download files

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

Source Distribution

codebooks-0.0.7.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

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

codebooks-0.0.7-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file codebooks-0.0.7.tar.gz.

File metadata

  • Download URL: codebooks-0.0.7.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for codebooks-0.0.7.tar.gz
Algorithm Hash digest
SHA256 8a37e6ef0dfd2d796270f1806c55ffa6fab6f7a2855f576df1101c641952a6f6
MD5 710fb35bcc4a9d09d1d3d8e6b83256fa
BLAKE2b-256 e0bb565354b489a2559c26b41deabd24f5787af22e05bd6381a8493ea837b64d

See more details on using hashes here.

File details

Details for the file codebooks-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: codebooks-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for codebooks-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 68549ea5dba1f6c079894726745e17580496c2f35f8880f87ca23da0f1240f9f
MD5 c43d94fe034db6ce262cc5b58d2f2a9f
BLAKE2b-256 d73bb447af2cc6e389d382d788227bf4ad57e6a22766ddd7ae3cfdf1829f0167

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

1 file

Supported by

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