Python SDK for Fleet environments
Project description
Fleet SDK
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fleet_python-0.2.127.tar.gz.
File metadata
- Download URL: fleet_python-0.2.127.tar.gz
- Upload date:
- Size: 278.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcd4dfa050d7aafeb00db551f7663fd6d340a3d3c7f5d3057dcddd616d541d4e
|
|
| MD5 |
915e17197f559190b14ea11d6dd8d485
|
|
| BLAKE2b-256 |
d1e82a1aaf14c81e8921966259f0f31f5622e87d92f5253ddfe71fb97ad9d727
|
Provenance
The following attestation bundles were made for fleet_python-0.2.127.tar.gz:
Publisher:
publish-fleet-sdk.yml on fleet-ai/fleet-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fleet_python-0.2.127.tar.gz -
Subject digest:
fcd4dfa050d7aafeb00db551f7663fd6d340a3d3c7f5d3057dcddd616d541d4e - Sigstore transparency entry: 1523231704
- Sigstore integration time:
-
Permalink:
fleet-ai/fleet-sdk@7d24cfe3744c8e640383287558534ac197da5162 -
Branch / Tag:
refs/tags/fleet-python-v0.2.127 - Owner: https://github.com/fleet-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-fleet-sdk.yml@7d24cfe3744c8e640383287558534ac197da5162 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fleet_python-0.2.127-py3-none-any.whl.
File metadata
- Download URL: fleet_python-0.2.127-py3-none-any.whl
- Upload date:
- Size: 322.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb8ddd3444c8890919187a116021da0e8614926790e4b916d0d5865948d8ef1a
|
|
| MD5 |
a6eae71a91592e69e6831809c3074d35
|
|
| BLAKE2b-256 |
17607831396273699c15706d14c507f4204fb3183b2142aef15ebeafa1ccc175
|
Provenance
The following attestation bundles were made for fleet_python-0.2.127-py3-none-any.whl:
Publisher:
publish-fleet-sdk.yml on fleet-ai/fleet-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fleet_python-0.2.127-py3-none-any.whl -
Subject digest:
bb8ddd3444c8890919187a116021da0e8614926790e4b916d0d5865948d8ef1a - Sigstore transparency entry: 1523231713
- Sigstore integration time:
-
Permalink:
fleet-ai/fleet-sdk@7d24cfe3744c8e640383287558534ac197da5162 -
Branch / Tag:
refs/tags/fleet-python-v0.2.127 - Owner: https://github.com/fleet-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-fleet-sdk.yml@7d24cfe3744c8e640383287558534ac197da5162 -
Trigger Event:
push
-
Statement type: