Official Python client for Scrapybara
Project description
Scrapybara Python Client
Official Python client for Scrapybara ₍ᐢ•(ܫ)•ᐢ₎
Installation
pip install scrapybara
Usage
from scrapybara import Scrapybara
# Initialize the client
client = Scrapybara(api_key="your-api-key")
# Start a new instance and get its ID
instance = client.start()
client.status(instance.instance_id)
# Interact with the instance
client.computer(instance.instance_id, "mouse_move", [100, 200])
client.screenshot(instance.instance_id)
# Stop the instance
client.stop(instance.instance_id)
With Anthropic Computer Use
from scrapybara.anthropic import ToolCollection, ComputerTool, EditTool, BashTool
tool_collection = ToolCollection(
ComputerTool(client, instance.instance_id),
EditTool(client, instance.instance_id),
BashTool(client, instance.instance_id),
)
# From https://github.com/anthropics/anthropic-quickstarts/blob/main/computer-use-demo
raw_response = client.beta.messages.with_raw_response.create(
max_tokens=max_tokens,
messages=messages,
model=model,
system=[system],
tools=tool_collection.to_params(),
betas=betas,
)
Requirements
- Python >= 3.8
requests
>= 2.25.1anthropic
^0.39.0pytest
^8.3.3pytest-asyncio
^0.23.5
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Feel free to submit an issue.
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
scrapybara-0.1.1.tar.gz
(7.6 kB
view details)
Built Distribution
File details
Details for the file scrapybara-0.1.1.tar.gz
.
File metadata
- Download URL: scrapybara-0.1.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.11.5 Darwin/23.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3e0077dcbdffaec1beb96e4160b4bcfae0b13f8f9d3b35ba92fc770d789ed11 |
|
MD5 | 3e46362a0109a6834ae3729a4ee048d0 |
|
BLAKE2b-256 | ec2add465023cb6229dab7403d3d2108dabc623279c3203897e5b062dc065291 |
File details
Details for the file scrapybara-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: scrapybara-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.11.5 Darwin/23.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21c08e08638a61d4f25f42464b6c705eeed465193fba77c526c9e4361170b033 |
|
MD5 | 49d301aab5cbbebeceb37c5173decbf1 |
|
BLAKE2b-256 | 1f24865b46c934212b72d210b4ca5acedea6e4a49c5c5cb919053666014863ad |