CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/python-project-structure

Python project structure — pyproject.toml, src layout, __init__.py, .gitignore, dependency groups, type hints, py.typed, test structure, entry points, ruff/mypy configuration

91

1.03x
Quality

87%

Does it follow best practices?

Impact

99%

1.03x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-3/

Build a Python CLI Tool for Log Analysis

Problem/Feature Description

A DevOps team needs a command-line tool that parses application log files and generates summary reports. The tool reads JSON-formatted log files, filters by severity level and date range, and outputs statistics (error counts by category, response time percentiles, top endpoints by request volume).

The tool will be installed via pip in their CI/CD pipelines and developer machines, so it needs to be a proper installable Python package with a CLI entry point.

Output Specification

Produce a complete project structure with:

  • pyproject.toml -- project metadata, dependencies (click or argparse, rich for output formatting), dev/test optional dependency groups (pytest, ruff, mypy), [project.scripts] entry point for the CLI command, [build-system], requires-python, tool configuration for ruff and mypy
  • .gitignore -- proper Python project ignores
  • Source package (use src layout or flat layout with proper __init__.py):
    • cli.py -- CLI entry point with argument parsing (log file path, severity filter, date range, output format)
    • parser.py -- Log file parsing logic
    • analyzer.py -- Statistics computation (error counts, percentiles, top endpoints)
    • models.py -- Data classes or Pydantic models for LogEntry, AnalysisReport, FilterConfig
    • formatters.py -- Output formatting (JSON, table, CSV)
  • tests/ directory with conftest.py, __init__.py, and at least one test file
  • py.typed marker file in the package directory

Focus on project structure, packaging configuration, entry points, and type hints rather than complete log parsing implementation. All functions must have type annotations.

evals

tile.json