Skip to content

Latest commit

 

History

History
184 lines (144 loc) · 4.35 KB

File metadata and controls

184 lines (144 loc) · 4.35 KB

Requirements and Dependencies

This file documents the dependency requirements extracted from the source projects and their usage patterns.

Source Project Dependencies

Extendo Backend Requirements

flask==3.0.1
gunicorn==21.2.0
flask-cors
python-dotenv
requests
pytest
pytest-cov
black
faceit
responses
pymongo
awpy
zstandard
cloudscraper
selenium
undetected-chromedriver

NadeStacked Requirements

pandas
matplotlib
awpy

Voodoo-Box Module Dependencies

Core Utils (utils/)

  • Standard library only - No external dependencies
  • Compatible with Python 3.7+

API Module (api/)

  • requests - HTTP client functionality
  • python-dotenv - Environment variable management (optional)

Data Module (data/)

  • pandas - Data manipulation and analysis
  • numpy - Numerical operations (dependency of pandas)

Files Module (files/)

  • Standard library only - Uses json, pathlib, os
  • Optional: python-dotenv for configuration

Web Module (web/)

  • JavaScript/Browser APIs only - No Node.js dependencies
  • Uses native browser APIs

Gaming Module (gaming/)

  • awpy - CS2 demo parsing (wraps demoinfocs-golang)
  • pandas - Data manipulation
  • matplotlib - Visualization and heatmap generation

Installation Recommendations

Minimal Installation (Utils + Files only)

# No additional dependencies required
pip install python-dotenv  # Optional for configuration

Data Processing Setup

pip install pandas numpy matplotlib

Gaming Analysis Setup

pip install awpy pandas matplotlib

Full API Integration Setup

pip install requests pandas numpy matplotlib awpy python-dotenv

Development and Testing Setup

pip install pytest pytest-cov responses black
pip install requests pandas numpy matplotlib awpy python-dotenv

Docker Configuration Reference

The extendo project included this Docker setup for reference:

Dockerfile Features

  • Python 3.12 base image
  • Chrome browser installation for Selenium
  • System dependencies for undetected-chromedriver
  • Flask development server configuration

Docker Compose Services

  • API service with environment variable support
  • MongoDB service with persistent volumes
  • Port mapping: 5000:5000 for API, 27017:27017 for MongoDB

Testing Patterns

From the extendo test suite, key testing patterns include:

API Testing with Mocks

import responses
import pytest

@responses.activate
def test_api_call():
    responses.add(responses.GET, "http://api.example.com", json={"data": "test"})
    # Test code here

Fixtures for Reusable Test Components

@pytest.fixture(scope="session")
def client():
    return APIClient(api_key="dummy_key")

@pytest.fixture
def no_sleep(monkeypatch):
    monkeypatch.setattr(time, "sleep", lambda x: None)

Rate Limiting and Error Handling Tests

  • Tests for 429 (rate limit) responses
  • Tests for retry logic with exponential backoff
  • Cache validation and clearing tests
  • Server error handling (5xx responses)

Performance Considerations

Caching Strategy

  • LRU cache for frequently accessed data
  • Cache clearing for testing and development
  • Performance monitoring with timing utilities

Concurrency Patterns

  • Thread-safe operations for demo parsing
  • Parallel processing for multiple demos
  • Background task queues for heavy operations

Security and Configuration

Environment Variables

  • API keys stored in environment variables
  • Database connection strings externalized
  • Debug flags configurable per environment

API Security

  • Rate limiting implementation
  • Error handling that doesn't expose internals
  • Input validation and sanitization

Browser Extension Dependencies

Chrome Extension Manifest V3

  • No external dependencies in content scripts
  • Uses native browser APIs
  • Communication with background scripts via message passing

Development Tools

  • No build process required for simple extensions
  • Optional: Webpack for more complex builds
  • Testing can be done manually or with browser automation

Deployment Notes

Production Considerations

  • Gunicorn for production Flask serving
  • MongoDB Atlas for managed database
  • Environment-specific configuration
  • Logging and monitoring setup

Scaling Patterns

  • Horizontal scaling with load balancers
  • Worker processes for background tasks
  • Caching layers for frequently accessed data