Installation Guide
Requirements
Python 3.8 or higher
pip (Python package manager)
Installation
From PyPI (Recommended)
pip install steadfast-python
Verification
Verify installation:
from steadfast import SteadfastClient
print("Steadfast SDK installed successfully!")
Quick Start
from steadfast import SteadfastClient
# Initialize client
client = SteadfastClient(
api_key="your_api_key",
secret_key="your_secret_key"
)
# Create an order
order = client.orders.create(
invoice="ORD-2024-001",
recipient_name="John Smith",
recipient_phone="01234567890",
recipient_address="House 123, Dhaka",
cod_amount=1060,
delivery_type=0
)
print(f"Order created: {order.consignment_id}")
Virtual Environment Setup
Using venv
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install package
pip install steadfast-python
# Deactivate when done
deactivate
Using conda
# Create conda environment
conda create -n steadfast python=3.9
# Activate environment
conda activate steadfast
# Install package
pip install steadfast-python
# Deactivate when done
conda deactivate
Dependencies
The SDK requires:
requests>=2.28.0- HTTP client librarypython-dotenv>=0.21.0- Environment variable management
These are automatically installed with the package.
Troubleshooting
“ModuleNotFoundError: No module named ‘steadfast’”
Solution:
pip install steadfast-python
“ImportError: cannot import name ‘SteadfastClient’”
Solution:
# Verify installation
pip show steadfast-python
# Reinstall if needed
pip install --upgrade steadfast-python
Virtual Environment Issues
Solution:
# Deactivate current environment
deactivate
# Create new environment
python3 -m venv venv
# Activate new environment
source venv/bin/activate
# Install package
pip install steadfast-python
Upgrading
Upgrade to Latest Version
pip install --upgrade steadfast-python
Upgrade to Specific Version
pip install steadfast-python==0.2.0
Check Installed Version
pip show steadfast-python
Or in Python:
import steadfast
print(steadfast.__version__)
Uninstallation
pip uninstall steadfast-python
Next Steps
Read the Authentication Guide
Check Order Management API
Review Error Handling Guide
Explore Examples