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

Set Up a New Python Web Service for a Pet Adoption Platform

Problem/Feature Description

A small nonprofit is building a pet adoption platform. They need a FastAPI backend that manages pets (dogs, cats, rabbits) and adoption applications. The API will be deployed to a cloud VM running Ubuntu with Python 3.12.

The team wants the project scaffolded properly from scratch so it is maintainable as volunteers contribute. They care about clean project organization, proper dependency management, and being able to run linting and type checking in CI.

Output Specification

Produce a complete project structure with:

  • pyproject.toml -- project metadata, dependencies (FastAPI, uvicorn, pydantic, pydantic-settings, sqlalchemy), dev/test dependency groups (pytest, httpx, ruff, mypy), tool configuration for ruff and mypy
  • .gitignore -- proper Python ignores including virtual environment, bytecode, build artifacts, .env
  • Application package with __init__.py files in all package directories
  • config.py -- Settings from environment using pydantic-settings BaseSettings
  • models.py -- Pydantic models for Pet (name, species, breed, age, status), AdoptionApplication (applicant_name, pet_id, message, status)
  • routes/pets.py -- CRUD endpoints for pets using APIRouter
  • routes/applications.py -- Endpoints for adoption applications using APIRouter
  • db.py -- Database connection and query functions (can use in-memory store)
  • errors.py -- Custom exception classes with error handler registration
  • main.py -- App factory pattern with router registration, error handlers, and startup event
  • tests/ directory with conftest.py containing test fixtures and at least one test file

Focus on project structure, packaging, and tooling rather than complete business logic. Use type hints on all function signatures.

evals

scenario-1

criteria.json

task.md

tile.json