Skip to main content

A Python package for creating automated datasheets from different data sources.

Project description

Contributors Issues Unlicense License Build and Publish Test and Lint

datasheet-for-dataset

Automatically create standardized documentation ("datasheets") for the datasets used in your ML projects.

Status: Early preview (v0.x). The public API is evolving and subject to change.

Features

  • Focused support for tabular datasets with pandas and polars backends
  • Automatic summary statistics and data quality diagnostics
  • Markdown templates that combine manual answers with automated insights
  • CLI and Python APIs for integrating datasheet generation into workflows

Installation

Prerequisites: Python 3.10+

Install from PyPI:

pip install datasheet-for-dataset

Install a suitable backend

To use this library correctly, install a supported backend. Currently available backends are polars (default) and pandas.

Install for development (editable) with optional dev tools:

# clone the repository
git clone https://github.com/anwielts/datasheet-for-dataset.git
cd datasheet-for-dataset

# install the package (and dev extras: pytest, ruff)
uv pip install -e ".[dev]"

Quickstart

CLI workflow

Generate a template, fill in the manual sections, and compile the final markdown datasheet:

# create an empty questionnaire
dfd template --output docs/datasheet_template.md

# after answering the questions in docs/datasheet_template.md, combine it with a dataset
dfd build \
  --data data/customers.csv \
  --template docs/datasheet_template.md \
  --output docs/datasheet.md \
  --name "Customer Churn" \
  --backend auto

Python workflow

Use the programmatic API to analyse a dataframe or to build a datasheet directly from a dataset file:

import pandas as pd

from dfd import Datasheet

# Load your data
df = pd.read_csv("data/your_data.csv)

# Access automated statistics in-memory
sheet = Datasheet(data=df)
for stat in sheet.analyse():
    print(stat.column_name, stat.mean_val)

# Generate a template and export a full datasheet
Datasheet.generate_template("docs/datasheet_template.md")
compiled = Datasheet.from_path(
    "data/customers.csv",
    backend="auto",
    dataset_name="Customer Churn",
)
compiled.to_markdown(
    output_path="docs/auto_datasheet.md",
    template_path=None,
    version="1.0",
)

Development

After setting up the project for development (see Installation), you can use the following commands:

Install uv with:

pip install uv

Lock dependencies / sync project

uv lock
uv sync
uv sync --extra dev

Building the package

uv build

Running Tests

# Run tests using hatch
uv run pytest

Code Quality with Ruff

# Check for linting issues
uv run ruff check .

# Auto-fix linting issues where possible
uv run ruff check . --fix

# Format code (optional)
uv run ruff format .

Links

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository and create a new branch from main.
  2. Set up the project locally (see Installation > development).
  3. Ensure code quality and tests pass:
    • Lint/format: ruff check . (and optionally ruff format if you use Ruff formatting)
    • Tests: pytest
  4. Open a pull request with a clear description of the change and any relevant context.

Tips:

  • Keep PRs focused and small where possible.
  • Add or update tests when you introduce behavior changes.
  • Follow the existing code style and project conventions.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Links

Contact

For questions, ideas, or issues, please open a GitHub issue; for sensitive security concerns, consider contacting the maintainers by email.

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

datasheet_for_dataset-0.0.6.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

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

datasheet_for_dataset-0.0.6-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file datasheet_for_dataset-0.0.6.tar.gz.

File metadata

  • Download URL: datasheet_for_dataset-0.0.6.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for datasheet_for_dataset-0.0.6.tar.gz
Algorithm Hash digest
SHA256 9ae20b459428977b968ea850814fe6cb622954e3d495420c3c069e5d3e90dd20
MD5 f23f701643978298dc138f6e3a0f232c
BLAKE2b-256 a0f034e74fa16a5e77b3351556315ae541162310f44a4d626c9343b9cd60cdfd

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasheet_for_dataset-0.0.6.tar.gz:

Publisher: build_and_publish.yml on anwielts/datasheet-for-dataset

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datasheet_for_dataset-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for datasheet_for_dataset-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 33cad69f113eb9c99df1caec9c6052a79dff0ccb93a024151f39e7e413fc13bf
MD5 65cc8fcc45bca3f589f79eec27d97a3d
BLAKE2b-256 1dd0129668c854a4f585049ba372ef11e1c9bc3372069a4d955be67f63157077

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasheet_for_dataset-0.0.6-py3-none-any.whl:

Publisher: build_and_publish.yml on anwielts/datasheet-for-dataset

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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