Metadata-Version: 2.5
Name: byterun
Version: 0.0.3
Summary: Official Python SDK for ByteRun, an AI infrastructure platform for Python, SQL and AI agent execution.
Project-URL: Homepage, https://byterun.io/
Project-URL: Platform, https://byterun.io/platform
Project-URL: Roadmap, https://byterun.io/roadmap
Project-URL: Repository, https://github.com/byterunio/byterun-python
Project-URL: Issues, https://github.com/byterunio/byterun-python/issues
Author: ByteRun
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agents,ai,byterun,execution,infrastructure,python,sdk
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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-Python: >=3.10
Requires-Dist: httpx<1,>=0.27
Description-Content-Type: text/markdown

# ByteRun Python SDK

The official Python SDK for [ByteRun](https://byterun.io/), an AI infrastructure platform that
provides execution environments for Python, SQL and AI agents.

> **Early preview.** Version `0.0.x` reserves the `byterun` package name and sets up the
> project, and adds `byterun login`. The SDK client itself is **not ready yet**: it can't run
> code today. In the meantime,
> try ByteRun in the [playground on byterun.io](https://byterun.io/), and follow the
> [roadmap](https://byterun.io/roadmap) for the first functional release.

## What is ByteRun?

ByteRun gives developers managed environments to run code and AI agents without operating the
infrastructure themselves. Today that covers Python, SQL and agent execution; the platform
roadmap also includes headless jobs, workflows and inference. See the
[platform overview](https://byterun.io/platform) for details.

## What this SDK is for

This SDK is meant to be the single Python entry point to ByteRun, so you can work with the
platform from your own code, scripts and services. AI agent execution comes first; other
platform capabilities will be added to the same package rather than split into separate ones.

What is planned, in no fixed order and subject to change: projects, code and agent execution,
files, SQL, headless jobs, workflows and inference. **None of this is available yet.**

## Installation

Requires Python 3.10 or newer.

```bash
pip install byterun
```

Check that it installed:

```bash
python -c "import byterun; print(byterun.__version__)"
```

The package currently exposes `byterun.__version__` and the `byterun login` / `byterun logout`
commands below. API documentation and usage examples will appear here once the client is released.

## Logging in from the command line

```bash
pip install byterun
byterun login     # opens your browser; approve the request, and a key is saved on this machine
byterun logout    # revokes this machine's key and deletes the saved credentials
```

`byterun login` prints a short code and a link, opens the link in your browser and waits. Check
that the code on the page matches the one in your terminal before you approve, and only approve a
login you started. Each machine gets its own key (limited to your starter project, 90 days), so
revoking one never affects another. You can see and revoke keys in Settings on byterun.io.

- `--no-browser` only prints the link, for SSH and headless machines: open it on any device.
- `--force` logs in again even if this machine is already logged in. The new key is saved first,
  then the old one is revoked.
- `byterun logout --local-only` only deletes the local file; the key stays valid until revoked.
- Exit codes: `0` success, `1` failure (denied, expired, network), `2` usage error, `130` Ctrl+C.

The key is stored in `~/.config/byterun/credentials.json` (or under `$XDG_CONFIG_HOME`), a `0600`
file in a `0700` directory, and is never printed. The SDK talks to `https://api.byterun.io`; set
`BYTERUN_API_URL` only to point at another deployment. A key is accepted on the API host only.

> A key lets code run in your project's container with that project's privileges. ByteRun is not a
> sandbox for untrusted code: treat the key like a password.

## Naming

| Where                  | Name             |
| ---------------------- | ---------------- |
| PyPI package           | `byterun`        |
| Python import          | `byterun`        |
| GitHub repository      | `byterun-python` |

## Feedback and contributions

Questions, ideas and bug reports are welcome as
[GitHub issues](https://github.com/byterunio/byterun-python/issues). The API is still being
designed, so please open an issue to discuss before sending a large pull request.

## Links

- Website: <https://byterun.io/>
- Platform: <https://byterun.io/platform>
- Roadmap: <https://byterun.io/roadmap>
- PyPI: <https://pypi.org/project/byterun/>
- Source: <https://github.com/byterunio/byterun-python>

## License

Licensed under the [Apache License, Version 2.0](LICENSE). Unless required by applicable law
or agreed to in writing, the software is distributed on an "AS IS" basis, without warranties or
conditions of any kind.
