Develops, reviews, and debugs Python code following Quanture standards. Use when writing Python scripts, APIs, data processing pipelines, automation tasks, or any Python-related development work.
Resources
1Install
npx skillscat add quanturetechnologies/quanture-skills/python-dev Install via the SkillsCat registry.
SKILL.md
Python Development — Quanture Standards
Quick start
Always activate virtual environment before working:
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txtCode standards
- Python 3.10+ required
- Type hints on all functions
- Black formatter:
black . - Linting:
ruff check . - Tests:
pytest tests/
from typing import Optional
def process_data(input: str, limit: Optional[int] = None) -> dict:
"""Brief docstring explaining what this does."""
# implementation
...Security rules
- Never hardcode credentials, tokens, or passwords
- Load secrets from environment variables:
os.environ.get("SECRET_KEY") - Validate and sanitize all external inputs
- Use
subprocess.run([...], shell=False)— nevershell=Truewith user input - Log errors but never log sensitive data
Project structure
project/
├── src/
│ └── module/
├── tests/
├── requirements.txt
├── .env.example # template without real values
└── README.mdError handling
try:
result = risky_operation()
except SpecificError as e:
logger.error("Operation failed: %s", e)
raiseNever use bare except: — always catch specific exceptions.
Database queries
Use parameterized queries always:
# GOOD
cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))
# NEVER — SQL injection risk
cursor.execute(f"SELECT * FROM users WHERE id = {user_id}")Advanced reference
- APIs: See reference/apis.md
- Testing patterns: See reference/testing.md
- Common utilities: See reference/utils.md