Skip to main content

Python SDK for Fleet environments

Project description

Fleet SDK

PyPI version Python versions License

The Fleet Python SDK provides programmatic access to Fleet's environment infrastructure.

Installation

Install the Fleet SDK using pip:

pip install fleet-python

Alpha/Pre-release Versions

To install the latest alpha or pre-release version:

pip install --pre fleet-python

To install a specific alpha version:

pip install fleet-python==0.2.64-alpha1

API Key Setup

Fleet requires an API key for authentication. You can obtain one from the Fleet Platform.

Set your API key as an environment variable:

export FLEET_API_KEY="sk_your_key_here"

Basic Usage

import fleet
import datetime

# Create environment by key
env = fleet.env.make("fira")

# Reset environment with seed and options
env.reset(
    seed=42,
    timestamp=int(datetime.datetime.now().timestamp())
)

# Access environment state ('current' is the resource id for a sqlite database)
sql = env.state("sqlite://current")
sql.exec("UPDATE customers SET status = 'active' WHERE id = 123")

# Clean up
env.close()

Environment Management

Creating Instances

# Create environment instance with explicit version
env = fleet.env.make("fira:v1.2.5")

# Create environment instance with default (latest) version
env = fleet.env.make("fira")

Connecting to Existing Instances

# Connect to a running instance
env = fleet.env.get("env_instance_id")

# List all running instances
instances = fleet.env.list_instances()
for instance in instances:
    print(f"Instance: {instance.instance_id}")
    print(f"Type: {instance.environment_type}")
    print(f"Status: {instance.status}")

# Filter instances by status (running, pending, stopped, error)
running_instances = fleet.env.list_instances(status_filter="running")

# List available environment types
available_envs = fleet.env.list_envs()

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

fleet_python-0.2.129.tar.gz (280.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fleet_python-0.2.129-py3-none-any.whl (324.5 kB view details)

Uploaded Python 3

File details

Details for the file fleet_python-0.2.129.tar.gz.

File metadata

  • Download URL: fleet_python-0.2.129.tar.gz
  • Upload date:
  • Size: 280.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fleet_python-0.2.129.tar.gz
Algorithm Hash digest
SHA256 1d5cd3afd4cd62a1b5c2a88d8bdcff13b3a881e8d381bf1be72ad9215d81ae33
MD5 d2fe46a27c995c8ff0304b3707cb4bf3
BLAKE2b-256 475f71de119fe6d97b02494cbb8eeff086cc655402264acc4abd2b40eca39627

See more details on using hashes here.

Provenance

The following attestation bundles were made for fleet_python-0.2.129.tar.gz:

Publisher: publish-fleet-sdk.yml on fleet-ai/fleet-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fleet_python-0.2.129-py3-none-any.whl.

File metadata

  • Download URL: fleet_python-0.2.129-py3-none-any.whl
  • Upload date:
  • Size: 324.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fleet_python-0.2.129-py3-none-any.whl
Algorithm Hash digest
SHA256 6d5b91bedcd69e352d0ecb7efa193e2d06ae6527c9dcb4b30d8d4c150ec7906b
MD5 66da58c352874c6b1236fccf3a61dfd6
BLAKE2b-256 90ac2bd2f52c940eeb0ac0e287ae729090b9babf6a9b1a0ee29b9a0c6f1ce41c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fleet_python-0.2.129-py3-none-any.whl:

Publisher: publish-fleet-sdk.yml on fleet-ai/fleet-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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