Skip to main content

Python SDK for Fleeks services

Project description

Fleeks Logo

Fleeks Python SDK

Production-ready Python SDK for the Fleeks AI Development Platform

Python Version License GitHub Stars

Documentation | Website | API Reference


Fleeks is a revolutionary AI-powered development platform that provides instant polyglot workspaces with 11+ languages, AI agents, and complete development environments.

✨ Key Features

  • 🏃 Sub-Second Workspaces - Create complete dev environments in <200ms
  • 🌐 11+ Languages - Python, Node, Go, Rust, Java, Ruby, PHP, and more
  • 🤖 AI Agents - Code generation, debugging, testing, research
  • 📁 Full File System - Complete CRUD operations with safety features
  • 💻 Terminal Control - Sync/async command execution, background jobs
  • 📦 Container Management - Real-time stats, process control
  • 🔄 Real-time Streaming - WebSocket file watching and agent streaming
  • Async/Await - Built for high performance
  • 🔐 Enterprise Security - API key auth with scopes

📦 Installation

pip install fleeks-sdk

🚀 Quick Start

import asyncio
from fleeks_sdk import FleeksClient

async def main():
    # Initialize client
    client = FleeksClient(api_key="fleeks_sk_your_key_here")
    
    # Create workspace with Python
    workspace = await client.workspaces.create(
        project_id="my-project",
        template="python"
    )
    
    # Execute command
    result = await workspace.terminal.execute("python --version")
    print(result.stdout)  # Python 3.11.5
    
    # Create and run file
    await workspace.files.create(
        path="hello.py",
        content="print('Hello from Fleeks!')"
    )
    result = await workspace.terminal.execute("python hello.py")
    print(result.stdout)  # Hello from Fleeks!
    
    # Use AI agent
    agent = await workspace.agents.execute(
        task="Add unit tests",
        agent_type="test"
    )
    await workspace.agents.wait_for_completion(agent.agent_id)
    
    # Cleanup
    await workspace.delete()

asyncio.run(main())

📖 Core Features

Workspaces

# Create with specific languages
workspace = await client.workspaces.create(
    "my-app",
    template="python",
    pinned_versions={"python": "3.11", "node": "20"}
)

# Check health
health = await workspace.get_health()
print(f"Status: {health.status}, Uptime: {health.uptime_seconds}s")

Files

# Create, read, update, delete
await workspace.files.create("src/main.py", content="...")
content = await workspace.files.read("src/main.py")
await workspace.files.update("src/main.py", content="...")
await workspace.files.delete("src/main.py")

# Directories
await workspace.files.mkdir("src/utils")
listing = await workspace.files.list("/", recursive=True)

Terminal

# Sync execution
result = await workspace.terminal.execute("npm test")

# Background jobs
job = await workspace.terminal.start_background_job("npm run dev")
await workspace.terminal.wait_for_job(job.job_id)

AI Agents

# Execute agent task
agent = await workspace.agents.execute(
    task="Create REST API with auth",
    agent_type="code",
    context={"framework": "FastAPI"}
)

# Monitor progress
status = await workspace.agents.get_status(agent.agent_id)
print(f"Progress: {status.progress}%")

# Get results
output = await workspace.agents.get_output(agent.agent_id)
print(f"Files created: {len(output.files_created)}")

📚 Documentation

Running Tests

pytest

Code Formatting

black fleeks_sdk tests
isort fleeks_sdk tests

Type Checking

mypy fleeks_sdk

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

Support

For support, email support@fleeks.com or create an issue on GitHub.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fleeks_sdk-0.1.0.tar.gz (261.2 kB view details)

Uploaded Source

Built Distribution

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

fleeks_sdk-0.1.0-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file fleeks_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: fleeks_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 261.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for fleeks_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f68d794a9bc607976aab0459bf004ab108d0cdcaad5218b4e72fe6281beea577
MD5 c90872524e967f91f55b1e973441be83
BLAKE2b-256 269028e7094d39e38fb547e959bdc3dd367555b662820d14c16e87784d24dff2

See more details on using hashes here.

File details

Details for the file fleeks_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fleeks_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for fleeks_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 278bf3dbb7e55739f9953df1ead4784826d2462b9c6fb2323b30b6103ee18735
MD5 6a9e9f9a8a306b3f4c41c7403f6e0740
BLAKE2b-256 87b70d97d6d183ac34140198bebd0de74896078dcae3c24256182f5931ec3998

See more details on using hashes here.

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