Prerequisites
Before installing the CoW Protocol Python SDK, ensure you have the following:Python Version: Python 3.10 or higher is required
The SDK is tested on Python 3.10, 3.11, and 3.12. We recommend using the latest stable Python version for the best experience.
Installation via pip
The easiest way to install the CoW Protocol Python SDK is via pip:Using Poetry
If you’re using Poetry for dependency management, add the SDK to your project:Core Dependencies
The SDK automatically installs the following key dependencies:Web3 Integration
web3 (version 6.0.0 or higher, below 8.0.0) - For Ethereum and blockchain interactions
Additional Libraries
- eth-abi (version 5.1.0 or higher) - Ethereum ABI encoding/decoding
- eth-typing (version 4.0.0 or higher, below 6.0.0) - Type hints for Ethereum
- backoff (version 2.2.1 or higher) - Retry logic for API calls
- aiolimiter (version 1.1.0 or higher) - Rate limiting for async operations
Development Installation
For contributors or developers who want to work with the source code:Verify Installation
After installation, verify that the SDK is working correctly:Environment Setup
For interacting with the CoW Protocol, you’ll need:- Private Key: An Ethereum wallet private key (for signing transactions)
- RPC Endpoint: Access to an Ethereum/Gnosis Chain node (optional, but recommended for production)
Never commit your private keys to version control. Use environment variables or
.env files (with .gitignore) to manage sensitive credentials.