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-4/

Create a Reusable Python Library for Data Validation

Problem/Feature Description

A data engineering team frequently writes the same validation logic across multiple projects: checking CSV column types, validating email formats, verifying date ranges, and ensuring numeric values are within bounds. They want to extract this into a reusable Python library that can be installed from their internal PyPI registry.

The library needs to be properly packaged so other teams can pip install it and get full type checking support in their IDEs. It should use the src layout since it will be distributed as a package.

Output Specification

Produce a complete library project structure with:

  • pyproject.toml -- [build-system] with hatchling (or setuptools), [project] with name, version, description, requires-python >= 3.11, minimal dependencies (none or just pydantic), dev/test optional dependency groups, [tool.ruff] and [tool.mypy] configuration with strict mode
  • .gitignore -- venv, pycache, dist, egg-info, .env, coverage, mypy cache
  • src layout: src/datavalidator/ package with:
    • __init__.py -- public API re-exports (Validator, ValidationError, validate)
    • py.typed -- marker file for PEP 561 typed package
    • validators.py -- Core validation functions (validate_email, validate_date_range, validate_numeric_range, validate_column_types)
    • models.py -- Data models: ValidationRule, ValidationResult, ColumnSpec
    • exceptions.py -- Custom exceptions: ValidationError, SchemaError
  • tests/ with __init__.py, conftest.py, and test files for validators and models

All functions must have complete type annotations. The library should be installable with pip install -e ".[dev]".

evals

tile.json