Sciris printing

From sciris/sciris · View interactive version

Sciris printing is an AI agent skill from the GitHub repository sciris/sciris. Use when printing or formatting output with Sciris — sc.heading, sc.printgreen, sc.printblue, colored output, sc.strjoin, sc.newlinejoin, sc.pr, sc.prettyobj, sc.indent, sc.progressbar, sc.printmedian, or monitoring loop progress.

How to use this skill

Skill file

Sciris Printing Tools

Reference for output formatting and progress display. See full tutorial: docs/tutorials/tut_printing.ipynb.

If you need more detail, use your MCP tools (Context7 or GitMCP) to look up current Sciris documentation, or consult the other Sciris skills.

Headings and Colors

sc.heading('Section Title')           # Bold section heading with divider
sc.printgreen('Success message')      # Green text
sc.printblue('Info message')          # Blue text
sc.indent(text)                       # Indent text block

String Joining

sc.strjoin(['a', 'b', 'c'])          # 'a, b, c' (shortcut to ', '.join())
sc.newlinejoin(['a', 'b', 'c'])      # 'a\nb\nc' (auto str conversion)
# Especially useful in f-strings and error messages

Object Inspection

sc.pr(obj)                            # Pretty representation (attributes, types, sizes)
# Much more informative than dir(obj)

prettyobj base class

class MySim(sc.prettyobj):            # Inherit for nice print(sim) output
    def __init__(self):
        self.n = 10
        self.ready = False

sim = MySim()
print(sim)                            # Shows all attributes with types and values

Progress Monitoring

for i in sc.progressbar(range(100)):  # tqdm-based progress bar
    do_work(i)

Numeric Formatting

sc.printmedian(data)                  # Print median with 95% CI
sc.sigfig(123456, 3, sep=True)       # '123,000' (significant figures with separator)
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.