Metadata-Version: 2.4
Name: loopix-sdk
Version: 2.30.0
Summary: Loopix SDK that give agents cloud environments
License: MIT
License-File: LICENSE
Author: loopix
Author-email: hello@vm.betmandu.net
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: attrs (>=23.2.0)
Requires-Dist: dockerfile-parse (>=2.0.1,<3.0.0)
Requires-Dist: h2 (>=4,<5)
Requires-Dist: httpcore (>=1.0.5,<2.0.0)
Requires-Dist: httpx (>=0.27.0,<1.0.0)
Requires-Dist: packaging (>=24.1)
Requires-Dist: protobuf (>=4.21.0)
Requires-Dist: python-dateutil (>=2.8.2)
Requires-Dist: rich (>=14.0.0)
Requires-Dist: typing-extensions (>=4.1.0)
Requires-Dist: wcmatch (>=10.1,<11.0)
Project-URL: Bug Tracker, https://github.com/loopix-dev/loopix/issues
Project-URL: Homepage, https://vm.betmandu.net/
Project-URL: Repository, https://github.com/loopix-dev/loopix/tree/main/packages/python-sdk
Description-Content-Type: text/markdown

<p align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/loopix-dev/loopix/refs/heads/main/readme-assets/logo-white.png">
    <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/loopix-dev/loopix/refs/heads/main/readme-assets/logo-black.png">
    <img alt="Loopix Logo" src="https://raw.githubusercontent.com/loopix-dev/loopix/refs/heads/main/readme-assets/logo-black.png" width="200">
  </picture>
</p>

<h4 align="center">
  <a href="https://pypi.org/project/loopix/">
    <img alt="Last 1 month downloads for the Python SDK" loading="lazy" decoding="async" style="color:transparent;width:170px;height:18px" src="https://static.pepy.tech/personalized-badge/loopix?period=monthly&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=PyPi%20Monthly%20Downloads">
  </a>  
</h4>


## What is Loopix?
[Loopix](https://www.loopix.dev/) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/loopix) or [Python SDK](https://pypi.org/project/loopix).

## Run your first Sandbox

### 1. Install SDK

```
pip install loopix
```

### 2. Get your Loopix API key
1. Sign up to Loopix [here](https://vm.betmandu.net).
2. Get your API key [here](https://vm.betmandu.net/dashboard?tab=keys).
3. Set environment variable with your API key
```
LOOPIX_API_KEY=lpx_***
```

### 3. Start a sandbox and run commands

```py
from loopix import Sandbox

with Sandbox.create() as sandbox:
    result = sandbox.commands.run('echo "Hello from Loopix!"')
    print(result.stdout)  # Hello from Loopix!
```

### 4. Code execution with Code Interpreter

If you need [`run_code()`](https://vm.betmandu.net/docs/code-interpreting), install the [Code Interpreter SDK](https://github.com/loopix-dev/code-interpreter):

```
pip install loopix-code-interpreter
```

```py
from loopix_code_interpreter import Sandbox

with Sandbox.create() as sandbox:
    execution = sandbox.run_code("x = 1; x += 1; x")
    print(execution.text)  # outputs 2
```

### 5. Check docs
Visit [Loopix documentation](https://vm.betmandu.net/docs).

### 6. Loopix cookbook
Visit our [Cookbook](https://github.com/loopix-dev/loopix-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.

