Skip to content

mostlyunoriginal/bookit-df

Repository files navigation

BookIt

A Python package for creating professional PDF codebooks from DataFrames.

PyPI version Documentation

Features

  • DataFrame support — Works with polars and pandas
  • Automatic statistics — Count, missing, unique, mean, std, min, max
  • Charts — Bar charts for categorical, histograms for numeric variables
  • Value labels — Document coded values (e.g., 1 = "Male")
  • Context manager — Auto-save with with BookIt(...) as book:

Installation

pip install bookit-df

# With polars support (recommended)
pip install bookit-df[polars]

# With pandas support
pip install bookit-df[pandas]

Quick Example

import polars as pl
from bookit_df import BookIt

df = pl.read_csv("survey_data.csv")

with BookIt("Survey Codebook", output="codebook.pdf", author="Research Team") as book:
    book.from_dataframe(
        df,
        descriptions={
            "age": "Respondent's age in years",
            "income": "Annual household income (USD)",
        },
        value_labels={
            "gender": {1: "Male", 2: "Female"}
        },
        suppress_numeric_stats=["gender"],
    )
# PDF saved automatically!

Documentation

Full documentation: mostlyunoriginal.github.io/bookit-df

About

A codebook creation package

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors