Skip to main content

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.1
  • anthropic ^0.39.0
  • pytest ^8.3.3
  • pytest-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


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.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

scrapybara-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file scrapybara-0.1.0.tar.gz.

File metadata

  • Download URL: scrapybara-0.1.0.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

Hashes for scrapybara-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d62a3482d59ca4d671b4144bee9983e5ed6b795d7268e9aa9d581dee5aa7d89f
MD5 4c64218915543f2502ed2b664bcde2b4
BLAKE2b-256 40f508f3ee5c2808f71f6d18dc101cedbef219efbb9dbbb5eab47a1c882be35b

See more details on using hashes here.

File details

Details for the file scrapybara-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: scrapybara-0.1.0-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

Hashes for scrapybara-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fd3f142e74f9b88435bb37058fa53b2059595a0732d2a2b7bc1d681ea9b6333
MD5 f2578be644215a8edcf8562247cd534e
BLAKE2b-256 097ab77a3eaa824a38ab9cdece3377de52ac047a80e04bb5dcb3210aa7440a41

See more details on using hashes here.

Supported by

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