A Python wrapper for Claude Code CLI
Project description
claude-code-botman
A Python wrapper library for the Claude Code CLI that enables programmatic interaction with Claude's coding assistant.
Overview
claude-code-botman provides a simple Python interface to execute Claude Code commands from your scripts with full subprocess management, configuration handling, and response parsing.
Installation
pip install -e .
For development:
pip install -e ".[dev]"
Quick Start
from claude_code_botman import ClaudeCode
# Basic usage
claude = ClaudeCode()
response = claude("Write a hello world function in Python")
# With configuration
claude = ClaudeCode(model="sonnet", timeout=60)
response = claude("Refactor this code for better performance")
# With rules from CLAUDE.md
claude = ClaudeCode(rules="./CLAUDE.md")
response = claude("Follow the project guidelines and add tests")
Features
- Simple API: Single method call to execute Claude Code commands
- Configuration Management: Flexible config system with environment variable support
- Response Parsing: Structured parsing of Claude's responses including file changes and errors
- Session Management: Support for conversation continuity
- Batch Operations: Process multiple commands efficiently
- Error Handling: Comprehensive exception handling with specific error types
Requirements
- Python 3.7+
- Claude Code CLI installed and configured
Development
# Run tests
pytest
# Format code
black claude_code_botman/ tests/ examples/
# Type checking
mypy claude_code_botman/
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_code_botman-1.3.0.tar.gz.
File metadata
- Download URL: claude_code_botman-1.3.0.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
020541f8f05772581ce0a79d4670f0cd9f235e6d360ac7802650532c7d9025a0
|
|
| MD5 |
84eb235ac6904895546a166cb38b4d94
|
|
| BLAKE2b-256 |
26bff1e467d73aa9d172538335b1d2a574eceb2fbe8b975ea43885b16e3a5307
|
Provenance
The following attestation bundles were made for claude_code_botman-1.3.0.tar.gz:
Publisher:
publish.yml on Botman-AI-com/claude-code-botman
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_code_botman-1.3.0.tar.gz -
Subject digest:
020541f8f05772581ce0a79d4670f0cd9f235e6d360ac7802650532c7d9025a0 - Sigstore transparency entry: 284253777
- Sigstore integration time:
-
Permalink:
Botman-AI-com/claude-code-botman@18510436a6fb9274ff7942473688aeab9592f571 -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/Botman-AI-com
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@18510436a6fb9274ff7942473688aeab9592f571 -
Trigger Event:
push
-
Statement type:
File details
Details for the file claude_code_botman-1.3.0-py3-none-any.whl.
File metadata
- Download URL: claude_code_botman-1.3.0-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21da020a9e1e36927899d9a442969b5cd4a2ac5a13640fa7739bf5b4c6b83673
|
|
| MD5 |
f8855dbff25ec42af71362738da74d8b
|
|
| BLAKE2b-256 |
47b273c6ecd0de0889789916baa7213cd728ad5422e428a569d5180f0adceb2d
|
Provenance
The following attestation bundles were made for claude_code_botman-1.3.0-py3-none-any.whl:
Publisher:
publish.yml on Botman-AI-com/claude-code-botman
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_code_botman-1.3.0-py3-none-any.whl -
Subject digest:
21da020a9e1e36927899d9a442969b5cd4a2ac5a13640fa7739bf5b4c6b83673 - Sigstore transparency entry: 284253814
- Sigstore integration time:
-
Permalink:
Botman-AI-com/claude-code-botman@18510436a6fb9274ff7942473688aeab9592f571 -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/Botman-AI-com
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@18510436a6fb9274ff7942473688aeab9592f571 -
Trigger Event:
push
-
Statement type: