{
  "files": [
    {
      "path": "src/mylib/__init__.py",
      "content": "\"\"\"MyLib — a reusable Python library.\"\"\"\nfrom .core import calculate, parse_config\nfrom .validators import validate_email, validate_url\n\n__version__ = \"0.1.0\"\n__all__ = [\"calculate\", \"parse_config\", \"validate_email\", \"validate_url\"]\n",
      "type": "module"
    },
    {
      "path": "src/mylib/core.py",
      "content": "\"\"\"Core library functions.\"\"\"\nfrom __future__ import annotations\nfrom pathlib import Path\nfrom typing import Any\nimport json\n\ndef calculate(values: list[float], operation: str = \"sum\") -> float:\n    \"\"\"Perform calculation on a list of values.\"\"\"\n    if not values:\n        raise ValueError(\"Empty values list\")\n    ops = {\n        \"sum\": sum,\n        \"mean\": lambda v: sum(v) / len(v),\n        \"max\": max,\n        \"min\": min,\n    }\n    if operation not in ops:\n        raise ValueError(f\"Unknown operation: {operation}. Valid: {list(ops)}\")\n    return ops[operation](values)\n\ndef parse_config(path: str | Path) -> dict[str, Any]:\n    \"\"\"Parse a JSON configuration file.\"\"\"\n    p = Path(path)\n    if not p.exists():\n        raise FileNotFoundError(f\"Config file not found: {p}\")\n    with open(p) as f:\n        config = json.load(f)\n    if not isinstance(config, dict):\n        raise TypeError(\"Config must be a JSON object\")\n    return config\n",
      "type": "module"
    },
    {
      "path": "src/mylib/validators.py",
      "content": "\"\"\"Input validation utilities.\"\"\"\nimport re\n\ndef validate_email(email: str) -> bool:\n    \"\"\"Validate email format.\"\"\"\n    pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$'\n    return bool(re.match(pattern, email))\n\ndef validate_url(url: str) -> bool:\n    \"\"\"Validate URL format.\"\"\"\n    pattern = r'^https?://[\\w.-]+(:\\d+)?(/[\\w./-]*)?$'\n    return bool(re.match(pattern, url))\n",
      "type": "module"
    },
    {
      "path": "pyproject.toml",
      "content": "[project]\nname = \"mylib\"\nversion = \"0.1.0\"\nrequires-python = \">=3.11\"\ndependencies = []\n\n[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n\n[tool.hatch.build.targets.wheel]\npackages = [\"src/mylib\"]\n",
      "type": "config"
    }
  ]
}
