Metadata-Version: 2.1
Name: stagehand-py
Version: 0.1.1
Summary: Python SDK for BrowserBase Stagehand
Home-page: https://github.com/browserbase/stagehand-python-sdk
Author: BrowserBase
Author-email: support@browserbase.io
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.24.0
Requires-Dist: asyncio>=3.4.3

# Stagehand Python SDK

A Python SDK for BrowserBase Stagehand, enabling automated browser control and data extraction.

## Installation

```bash
pip install stagehand-py
```

## Usage

```python
import asyncio
from stagehand import Stagehand

async def main():
    # Initialize the Stagehand client
    browser = Stagehand(
        env="BROWSERBASE",
        api_key="your-api-key",
        project_id="your-project-id"
    )
    
    # Perform browser actions
    result = await browser.act("Navigate to google.com")
    
    # Extract data using a schema
    data = await browser.extract("Get the search results", {
        "results": [{"title": "string", "url": "string"}]
    })
    
    # Close the browser
    await browser.close()

# Run the example
asyncio.run(main())
```

## Configuration

- `env`: Environment to use (default: "BROWSERBASE")
- `api_key`: Your BrowserBase API key (can also be set via BROWSERBASE_API_KEY environment variable)
- `project_id`: Your BrowserBase project ID (can also be set via BROWSERBASE_PROJECT_ID environment variable)
- `verbose`: Verbosity level (default: 0)

## Features

- Automated browser control with natural language commands
- Data extraction with schema validation
- Async/await support
- Automatic NextJS server management

## Requirements

- Python 3.7+
- httpx
- asyncio

## License

MIT License 
