Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_code_botman-1.3.0.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_code_botman-1.3.0-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

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

Hashes for claude_code_botman-1.3.0.tar.gz
Algorithm Hash digest
SHA256 020541f8f05772581ce0a79d4670f0cd9f235e6d360ac7802650532c7d9025a0
MD5 84eb235ac6904895546a166cb38b4d94
BLAKE2b-256 26bff1e467d73aa9d172538335b1d2a574eceb2fbe8b975ea43885b16e3a5307

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_code_botman-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_code_botman-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21da020a9e1e36927899d9a442969b5cd4a2ac5a13640fa7739bf5b4c6b83673
MD5 f8855dbff25ec42af71362738da74d8b
BLAKE2b-256 47b273c6ecd0de0889789916baa7213cd728ad5422e428a569d5180f0adceb2d

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page