This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is @platformatic/python - a Python stackable for Watt that integrates Python applications with the Platformatic framework. It enables serving Python ASGI applications through a Fastify server with proper request/response handling.
npm test- Run tests using Node.js built-in test runnernpm run build- Generate schema.json and config.d.ts from schema definitionsnpm run ci- Run linting and tests (assumes lint script exists)
The project follows Platformatic's stackable pattern:
- lib/index.js - Main stackable export with configuration and plugin registration
- lib/plugin.js - Fastify plugin that handles Python request routing and execution
- lib/generator.js - Code generator for creating new Python stackable projects
- lib/schema.js - JSON schema definitions for configuration validation
- Stackable Integration: Extends
@platformatic/servicewith Python-specific functionality - Request Handling: All HTTP methods are captured by wildcard routes and forwarded to Python via
@platformatic/python-node - Static File Serving: Non-Python files in docroot are served statically with
@fastify/static - Header Processing: HTTP headers are capitalized for Python compatibility
- Configuration Schema: Uses JSON schema with automatic TypeScript generation
When using the generator, projects include:
public/directory as Python docroot withmain.pycontaining a basic ASGI appplatformatic.jsonconfiguration file.envand.env.samplefor environment variables- Node.js v22.18.0+ and Python 3.8+ requirements
- Uses Node.js built-in test runner (
node --test) - Tests cover generator functionality, configuration validation, and file generation
- Test fixtures in
test/fixtures/for integration testing