Installation

How to install the DFlow Python SDK

Installation

Requirements

  • Python 3.10 or higher
  • A Solana wallet (for trading operations)

Package Managers

pip

pip install dflow-sdk
uv add dflow-sdk

poetry

poetry add dflow-sdk

Dependencies

The SDK automatically installs the following dependencies:

  • solana - Solana Python SDK
  • solders - Solana data structures
  • httpx - Modern HTTP client
  • websockets - WebSocket support
  • pydantic - Data validation and serialization

Verify Installation

from dflow import DFlowClient, __version__
 
print(f"DFlow SDK version: {__version__}")
 
# Create a client instance
client = DFlowClient()
print("✓ SDK installed successfully!")

Environment Configuration

Development vs Production

The SDK defaults to development environment, which requires no API key:

from dflow import DFlowClient
 
# Development (default) - no API key required
# Uses dev-*.dflow.net endpoints for testing with real capital
client = DFlowClient()
 
# Equivalent to:
client = DFlowClient(environment="development")
 
# Production - requires API key
# Uses *.dflow.net endpoints for production deployments
client = DFlowClient(environment="production", api_key="your-api-key")

API Keys

For production or higher rate limits, set your API key:

from dflow import DFlowClient
 
# At initialization
client = DFlowClient(api_key="your-api-key")
 
# Or set it later
client = DFlowClient()
client.set_api_key("your-api-key")

Next Steps

Now that you have the SDK installed, check out the Quickstart Guide to start building.

On this page