e2b-desktop


Namee2b-desktop JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://e2b.dev/
SummaryE2B Desktop Sandbox - Deskstop sandbox in cloud powered by E2B
upload_time2024-11-24 06:55:49
maintainerNone
docs_urlNone
authore2b
requires_python<4.0,>=3.9
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # E2B Desktop Sandbox (beta)

E2B Desktop Sandbox is an isolated cloud environment with a desktop-like interface powered by [E2B](https://e2b.dev).

Launching E2B Sandbox takes about 300-500ms. You can customize the desktop environment and preinstall any dependencies you want using our [custom sandbox templates](https://e2b.dev/docs/sandbox-template).

![Desktop Sandbox](screenshot.png)

**Work in progress**
This repository is a work in progress. We welcome feedback and contributions. Here's the list of features we're working on:
- [ ] JavaScript SDK
- [ ] Streaming live desktop
- [ ] Tests
- [ ] Docstrings

## Getting started
The E2B Desktop Sandbox is built on top of [E2B Sandbox](https://e2b.dev/docs).

### 1. Get E2B API key
Sign up at [E2B](https://e2b.dev) and get your API key.
Set environment variable `E2B_API_KEY` with your API key.

### 2. Install SDK
**Python**
```bash
pip install e2b-desktop
```

**JavaScript**
```bash
Coming soon
```

### 3. Create Desktop Sandbox
```python
from e2b_desktop import Sandbox

desktop = Sandbox()
```

## Features

### Mouse control
```python
from e2b_desktop import Sandbox
desktop = Sandbox()

desktop.double_click()
desktop.left_click()
desktop.right_click()
desktop.middle_click()
desktop.scroll(10) # Scroll by the amount. Positive for up, negative for down.
desktop.mouse_move(100, 200) # Move to x, y coordinates
```

### Locate on screen
```python
from e2b_desktop import Sandbox
desktop = Sandbox()

# Find "Home" text on the screen and return the coordinates
x, y = desktop.locate_on_screen("Home")
# Move the mouse to the coordinates
desktop.mouse_move(x, y)
```

### Keyboard control
```python
from e2b_desktop import Sandbox
desktop = Sandbox()

desktop.write("Hello, world!") # Write text at the current cursor position
desktop.hotkey("ctrl", "c") # Press ctrl+c
```

### Screenshot
```python
from e2b_desktop import Sandbox
desktop = Sandbox()

# Take a screenshot and save it as "screenshot.png" locally
desktop.screenshot("screenshot.png")
```

### Open file
```python
from e2b_desktop import Sandbox
desktop = Sandbox()

# Open file with default application
desktop.files.write("/home/user/index.js", "console.log('hello')") # First create the file
desktop.open("/home/user/index.js") # Then open it
```

### Run any bash commands
```python
from e2b_desktop import Sandbox
desktop = Sandbox()

# Run any bash command
desktop.commands.run("ls -la /home/user")
```

### Run PyAutoGUI commands
```python
from e2b_desktop import Sandbox
desktop = Sandbox()

# Run any PyAutoGUI command
desktop.pyautogui("pyautogui.click()")
```

<!-- ### Customization
```python
from e2b_desktop import Sandbox
desktop = Sandbox()
``` -->

## Under the hood
You can use [PyAutoGUI](https://pyautogui.readthedocs.io/en/latest/) to control the whole environment programmatically.

The desktop-like environment is based on Linux and [Xfce](https://www.xfce.org/) at the moment. We chose Xfce because it's a fast and lightweight environment that's also popular and actively supported. However, this Sandbox template is fully customizable and you can create your own desktop environment.
Check out the code [here](./template/)

            

Raw data

            {
    "_id": null,
    "home_page": "https://e2b.dev/",
    "name": "e2b-desktop",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "e2b",
    "author_email": "hello@e2b.dev",
    "download_url": "https://files.pythonhosted.org/packages/d4/a7/59d061670844f75610bf93a3c38655d448ca7da7fd3ddddebe56abb4667d/e2b_desktop-1.0.2.tar.gz",
    "platform": null,
    "description": "# E2B Desktop Sandbox (beta)\n\nE2B Desktop Sandbox is an isolated cloud environment with a desktop-like interface powered by [E2B](https://e2b.dev).\n\nLaunching E2B Sandbox takes about 300-500ms. You can customize the desktop environment and preinstall any dependencies you want using our [custom sandbox templates](https://e2b.dev/docs/sandbox-template).\n\n![Desktop Sandbox](screenshot.png)\n\n**Work in progress**\nThis repository is a work in progress. We welcome feedback and contributions. Here's the list of features we're working on:\n- [ ] JavaScript SDK\n- [ ] Streaming live desktop\n- [ ] Tests\n- [ ] Docstrings\n\n## Getting started\nThe E2B Desktop Sandbox is built on top of [E2B Sandbox](https://e2b.dev/docs).\n\n### 1. Get E2B API key\nSign up at [E2B](https://e2b.dev) and get your API key.\nSet environment variable `E2B_API_KEY` with your API key.\n\n### 2. Install SDK\n**Python**\n```bash\npip install e2b-desktop\n```\n\n**JavaScript**\n```bash\nComing soon\n```\n\n### 3. Create Desktop Sandbox\n```python\nfrom e2b_desktop import Sandbox\n\ndesktop = Sandbox()\n```\n\n## Features\n\n### Mouse control\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox()\n\ndesktop.double_click()\ndesktop.left_click()\ndesktop.right_click()\ndesktop.middle_click()\ndesktop.scroll(10) # Scroll by the amount. Positive for up, negative for down.\ndesktop.mouse_move(100, 200) # Move to x, y coordinates\n```\n\n### Locate on screen\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox()\n\n# Find \"Home\" text on the screen and return the coordinates\nx, y = desktop.locate_on_screen(\"Home\")\n# Move the mouse to the coordinates\ndesktop.mouse_move(x, y)\n```\n\n### Keyboard control\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox()\n\ndesktop.write(\"Hello, world!\") # Write text at the current cursor position\ndesktop.hotkey(\"ctrl\", \"c\") # Press ctrl+c\n```\n\n### Screenshot\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox()\n\n# Take a screenshot and save it as \"screenshot.png\" locally\ndesktop.screenshot(\"screenshot.png\")\n```\n\n### Open file\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox()\n\n# Open file with default application\ndesktop.files.write(\"/home/user/index.js\", \"console.log('hello')\") # First create the file\ndesktop.open(\"/home/user/index.js\") # Then open it\n```\n\n### Run any bash commands\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox()\n\n# Run any bash command\ndesktop.commands.run(\"ls -la /home/user\")\n```\n\n### Run PyAutoGUI commands\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox()\n\n# Run any PyAutoGUI command\ndesktop.pyautogui(\"pyautogui.click()\")\n```\n\n<!-- ### Customization\n```python\nfrom e2b_desktop import Sandbox\ndesktop = Sandbox()\n``` -->\n\n## Under the hood\nYou can use [PyAutoGUI](https://pyautogui.readthedocs.io/en/latest/) to control the whole environment programmatically.\n\nThe desktop-like environment is based on Linux and [Xfce](https://www.xfce.org/) at the moment. We chose Xfce because it's a fast and lightweight environment that's also popular and actively supported. However, this Sandbox template is fully customizable and you can create your own desktop environment.\nCheck out the code [here](./template/)\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "E2B Desktop Sandbox - Deskstop sandbox in cloud powered by E2B",
    "version": "1.0.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/e2b-dev/desktop/issues",
        "Homepage": "https://e2b.dev/",
        "Repository": "https://github.com/e2b-dev/desktop/tree/main/packages/python-sdk"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "841a4a25e61039053a2b721b98c76ea03ff0d6b5a6f83498824fb7ce2302653f",
                "md5": "d273c7fd09b5132925efb4c9f847a04b",
                "sha256": "b25f2626b9112b73844dccabf84dc8e55046859a6aa32fea31f8472439c69a98"
            },
            "downloads": -1,
            "filename": "e2b_desktop-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d273c7fd09b5132925efb4c9f847a04b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 4860,
            "upload_time": "2024-11-24T06:55:47",
            "upload_time_iso_8601": "2024-11-24T06:55:47.768372Z",
            "url": "https://files.pythonhosted.org/packages/84/1a/4a25e61039053a2b721b98c76ea03ff0d6b5a6f83498824fb7ce2302653f/e2b_desktop-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d4a759d061670844f75610bf93a3c38655d448ca7da7fd3ddddebe56abb4667d",
                "md5": "cf2d58d8290129f16a8b597ff54306e5",
                "sha256": "d33dbe5a75acd92376f65f567967b61e7e1c552a517f343067795e06e52ccc0e"
            },
            "downloads": -1,
            "filename": "e2b_desktop-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "cf2d58d8290129f16a8b597ff54306e5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 4363,
            "upload_time": "2024-11-24T06:55:49",
            "upload_time_iso_8601": "2024-11-24T06:55:49.287785Z",
            "url": "https://files.pythonhosted.org/packages/d4/a7/59d061670844f75610bf93a3c38655d448ca7da7fd3ddddebe56abb4667d/e2b_desktop-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-24 06:55:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "e2b-dev",
    "github_project": "desktop",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "e2b-desktop"
}
        
e2b
Elapsed time: 1.41068s