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.1.tar.gz (261.3 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.1-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fleeks_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 261.3 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.1.tar.gz
Algorithm Hash digest
SHA256 9f5c3037e2056ad27ddafcba3fbf7696c19b1c0af96c95358472abe77a92de56
MD5 85a99b5c6f91c1dba5028b7fb9fd1beb
BLAKE2b-256 af31bf202eb6b9a65bc13973614482e5b5f9d12e26156d76f063a46e2e36aaba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fleeks_sdk-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4e18be6d3cccde9e47a1902a9c2fa17b1dfa3e2f788172b7bedf3af503fea4a
MD5 f1c9227a0e6543220baa3e5641f4aab8
BLAKE2b-256 0d74f6a663713e57cb90d07f965f3c9ef0b0f79a31c0e69e619982bf26f7f728

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