CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-tabulate

tessl install tessl/pypi-tabulate@0.9.0

Pretty-print tabular data in Python with extensive formatting options and output format support.

Agent Success

Agent success rate when using this tile

69%

Improvement

Agent success rate improvement when using this tile compared to baseline

0.9x

Baseline

Agent success rate without this tile

77%

task.mdevals/scenario-4/

Log Formatter

A utility for formatting structured log data into human-readable tables with custom delimiters.

Overview

Create a log formatter that takes structured log entries and formats them into tables using custom column separators. The formatter should support different delimiter styles for different log levels or output contexts.

Requirements

Core Functionality

The formatter must provide a function that accepts log entries (as a list of dictionaries or similar tabular data) and outputs formatted tables with customizable column separators.

Custom Separators

The formatter should support creating tables with various separator styles:

  • Pipe-delimited format (columns separated by "|")
  • Comma-delimited format (columns separated by ",")
  • Custom single-character separators
  • Custom multi-character separators (e.g., " | ", " :: ")

Input and Output

  • Input: Tabular data representing log entries with fields such as timestamp, level, message, etc.
  • Output: Formatted string representation of the table with the specified delimiter

Test Cases

  • Given a list of log entries [{"timestamp": "2024-01-01", "level": "INFO", "message": "Started"}], formatting with "|" separator produces a table with columns separated by "|" @test
  • Given a list of log entries [{"timestamp": "2024-01-01", "level": "INFO", "message": "Started"}], formatting with "," separator produces a table with columns separated by "," @test
  • Given log entries, formatting with a custom multi-character separator " :: " produces a table with columns separated by " :: " @test

Implementation

@generates

API

def format_logs(entries, separator):
    """
    Format log entries into a table with custom column separators.

    Args:
        entries: List of dictionaries containing log entry data
        separator: String to use as column separator

    Returns:
        Formatted table string with custom separators
    """
    pass

Dependencies { .dependencies }

tabulate { .dependency }

Provides table formatting capabilities with support for custom separators.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/tabulate@0.9.x
tile.json