This project is an automated code generator that leverages Anthropic's Claude Sonnet LLM to create Python calculator applications from a prompt. It reads a project specification, sends it to Claude, parses the generated code blocks, writes them to files, installs dependencies, and launches the resulting application.
- Automated code generation: Uses Claude Sonnet to generate all required code files for a calculator project based on a prompt.
- Dependency management: Automatically updates and installs dependencies from generated
requirements.txt. - Debugging support: Saves raw Claude outputs with timestamps for easy debugging.
- Seamless execution: Runs the generated application immediately after setup.
- Python 3.8 or higher
- Anthropic API key
- Internet connection for AI calculations
Ensure you have all the required files:
-
Create a
.envfile in the project root with your Anthropic API key:ANTHROPIC_API_KEY=your_api_key_here -
Install dependencies:
pip install -r requirements.txt
Modify prompt.txt to describe the calculator project you want to generate.
Execute the main script:
python script.pyThe script will:
- Call Claude Sonnet with your prompt
- Save the raw output in
claude_outputs/ - Parse and write all generated code files
- Update/install dependencies
- Launch the generated application (via
run.py)
script.py— Main orchestrator scriptrun.py— Entry point for the generated applicationcalculator.py— (May be generated) Calculator logicprompt.txt— Project specification promptrequirements.txt— Python dependenciesclaude_outputs/— Saved raw Claude outputs for debugging
- Requires Python 3.8+
- Requires an Anthropic API key
- Claude's output must follow the expected code block format for correct parsing
See LICENSE for details.