Modern Python development suite for testing, performance, async patterns, and packaging.
Parseltongue brings Python 3.12+ best practices to your workflow. It covers the full development lifecycle: testing with pytest, performance optimization, async patterns, and modern packaging with uv.
/plugin install parseltongue@claude-night-market
Skill Description When to Use
python-testingPytest and TDD workflows Writing and running tests
python-performanceProfiling and optimization Debugging slow code
python-asyncAsync programming patterns Implementing asyncio
python-packagingModern packaging with uv Managing pyproject.toml
Command Description
/analyze-testsReport on test suite health
/run-profilerProfile code execution
/check-asyncValidate async patterns
Agent Description
python-proMaster Python 3.12+ with modern features
python-testerExpert testing for pytest, TDD, mocking
python-optimizerExpert performance optimization
/analyze-tests
# Reports:
# - Coverage metrics
# - Test distribution
# - Slow tests
# - Missing coverage areas
# - Anti-patterns detected
/run-profiler src/heavy_function.py
# Outputs:
# - CPU time breakdown
# - Memory usage
# - Hot paths
# - Optimization suggestions
/check-async src/async_module.py
# Checks:
# - Proper await usage
# - Event loop handling
# - Async context managers
# - Concurrency patterns
Skill(parseltongue:python-testing)
# Provides:
# - Pytest configuration patterns
# - TDD workflow guidance
# - Mocking strategies
# - Fixture patterns
Parseltongue emphasizes modern Python:
# Modern syntax (3.10+)
def process(data: list[str] | None) -> dict[str, int]:
...
# Structural pattern matching (3.10+)
match response:
case {"status": "ok", "data": data}:
return data
case {"status": "error", "message": msg}:
raise ValueError(msg)
# Exception groups (3.11+)
try:
async with asyncio.TaskGroup() as tg:
tg.create_task(task1())
tg.create_task(task2())
except* ValueError as eg:
for exc in eg.exceptions:
handle(exc)
Skill(parseltongue:python-testing)
# RED-GREEN-REFACTOR:
# 1. Write failing test
# 2. Implement minimal code
# 3. Refactor with tests green
# Recommended patterns
@pytest.fixture
def db_session(tmp_path):
"""Session-scoped database fixture."""
db = Database(tmp_path / "test.db")
yield db
db.close()
@pytest.fixture
def user(db_session):
"""User fixture depending on db."""
return db_session.create_user("test")
# Strategic mocking
def test_api_call(mocker):
mock_response = mocker.patch("requests.get")
mock_response.return_value.json.return_value = {"status": "ok"}
result = fetch_data()
assert result["status"] == "ok"
# cProfile integration
python -m cProfile -s cumtime script.py
# Memory profiling
from memory_profiler import profile
@profile
def memory_heavy():
...
Generators over lists : Save memory
Local variables : Faster lookup
Built-in functions : C-optimized
Lazy evaluation : Defer computation
async def main():
async with aiohttp.ClientSession() as session:
tasks = [fetch(session, url) for url in urls]
results = await asyncio.gather(*tasks)
return results
if __name__ == "__main__":
asyncio.run(main())
Blocking calls in async functions
Creating event loops inside coroutines
Ignoring exceptions in fire-and-forget tasks
[project]
name = "my-package"
version = "1.0.0"
dependencies = ["requests>=2.28"]
[project.optional-dependencies]
dev = ["pytest", "ruff", "mypy"]
[tool.uv]
index-url = "https://pypi.org/simple"
# Install with uv
uv pip install -e ".[dev]"
# Lock dependencies
uv pip compile pyproject.toml -o requirements.lock
# Sync environment
uv pip sync requirements.lock
Skill Enhancement
python-testingUses test-driven-development for TDD cycles
python-testingUses testing-anti-patterns for detection
leyline : Provides pytest-config patterns
sanctum : Test updates integrate with test-updates skill