Skip to content

cmudrc/drcutils

Repository files navigation

drcutils

CI Coverage Examples Passing Public API In Examples Docs

drcutils is a shared utility package for Design Research Collective lab members.

It is intended primarily for internal lab workflows where consistent branding, figure export, and lightweight runtime/data helpers are needed across projects.

Overview

This package currently focuses on:

  • DRC brand assets, palettes, and watermarking helpers
  • publication-ready figure export presets
  • CAD and model-visualization wrappers
  • file conversion and runtime environment detection utilities

Quickstart

Requires Python 3.12+. Reproducible release installs are pinned to Python 3.12.12 (.python-version).

python -m venv .venv
source .venv/bin/activate
make dev
make test

Quick Usage

import matplotlib.pyplot as plt

from drcutils.data import convert
from drcutils.runtime import is_notebook
from drcutils.viz import export_figure

convert("inputs/data.csv", "artifacts/data.json")

fig, ax = plt.subplots()
ax.plot([0, 1, 2], [0, 1, 4])

result = export_figure(
    fig,
    "artifacts/figures/main_result",
    targets=["one_col", "slide_16x9"],
    formats=["pdf", "png"],
)

print(is_notebook())
print(result["files"])

Examples

  • Basic functionality: Open in Colab
  • Advanced example: Open in Colab

Docs

See the published documentation for usage guides and API reference.

Build docs locally with:

make docs-build

Contributing

Contribution workflow and quality gates are documented in CONTRIBUTING.md.

About

Python package with useful utilities for the lab

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors