Installing the Python SDK
Overview
The Sentor Machine Learning SDK provides Python developers with a powerful interface to our sentiment analysis API.
Features
- 🚀 Python 3.10+ support
- ⚡ Simple and intuitive API
- 🌍 Support for multiple languages
- 📦 Batch processing capabilities
- 🛡️ Comprehensive error handling
- 🔄 Real-time sentiment analysis
Requirements
System Requirements
- Python 3.10 or higher
- pip package manager
- Minimum 512MB RAM
- Active internet connection
Installation Methods
Using pip
pip install sentor-python-sdk Verifying Installation
import sentor
# Check version
print(sentor.__version__)
# Verify connectivity
from sentor import SentorClient
client = SentorClient("your-api-key")
health = client.check_health()
print(f"API Status: {health['status']}") Environment Setup
Virtual Environment (recommended)
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
.venvScriptsactivate
# Install Sentor ML
pip install sentor-python-sdk Environment Variables
# Create .env file
echo "SENTOR_API_KEY=your-api-key" > .env # Load environment variables
from dotenv import load_dotenv
import os
load_dotenv()
api_key = os.getenv("SENTOR_API_KEY") Troubleshooting
Common Issues
- SSL Certificate Errors
# Install certificates (if needed)
pip install certifi - Dependency Conflicts
# Install with specific versions
pip install "sentor-python-sdk[all]" - Version Mismatch
# Force reinstall
pip install --force-reinstall sentor-python-sdk Installation Verification Script
def verify_installation():
try:
import sentor
print(f"✅ Sentor ML SDK Version: {sentor.__version__}")
from sentor import SentorClient
client = SentorClient("test_key")
print("✅ Client initialization successful")
# Check dependencies
import requests
import pydantic
print("✅ All dependencies installed")
return True
except Exception as e:
print(f"❌ Installation verification failed: {str(e)}")
return False
if __name__ == "__main__":
verify_installation() Additional Resources
Support
- 📧 Email: support@sentor.app
- 💬 Discord: Join our community
- 📚 Documentation: sentor.app/docs