Getting Started with FinanceQuery¶
This guide will help you set up and run FinanceQuery on your system.
Requirements¶
Before getting started with FinanceQuery, ensure your system meets the following requirements:
System Requirements¶
- Python: 3.11 or higher (Python 3.12 recommended)
- Operating System: Linux, macOS, or Windows
- Memory: Minimum 512MB RAM (1GB+ recommended for production)
FinanceQuery requires several system-level dependencies for optimal performance:
Dependency Management¶
FinanceQuery uses Poetry for dependency management. A requirements.txt
file is also provided for environments where Poetry isn't available.
Optional Requirements¶
Redis (Recommended for Production)¶
- Redis server for caching and improved performance
- Installation: Redis Quick Start Guide
Proxy Support (Optional)¶
- For enhanced data fetching reliability in production environments
- Configure via environment variables (see Configuration section)
Quick Start¶
Installation¶
Create and activate a virtual environment and then install the dependencies:
# Clone the project
git clone https://github.com/Verdenroz/finance-query.git
cd finance-query
# Install dependencies
poetry install
# Cythonize files for performance
python setup.py build_ext --inplace
# Start the server
uvicorn src.main:app --reload
Testing the API¶
Once the server is running, you can access:
- API Documentation: http://localhost:8000/docs
- Alternative Documentation: http://localhost:8000/redoc
Making Your First Request¶
Try getting stock information using curl:
Or using Python:
import requests
response = requests.get("http://localhost:8000/v1/simple-quotes", params={"symbols": "AAPL"})
print(response.json())
Configuration¶
Environment Variables¶
FinanceQuery can be configured using environment variables. Copy the template and customize as needed:
Basic Configuration¶
For a quick start, the following minimal configuration is sufficient:
# Optional: Enable Redis caching for better performance
REDIS_URL=redis://localhost:6379
# Optional: Configure logging
LOG_LEVEL=INFO
LOG_FORMAT=text
Logging Setup¶
Configure logging based on your environment:
This provides: - Detailed diagnostic information - Human-readable log format - Strict performance monitoring
Verifying Configuration¶
After starting the server, you should see log output indicating your configuration:
# With DEBUG level
2025-01-15 14:30:20 - main - INFO - [system] - Application startup completed
2025-01-15 14:30:20 - main - DEBUG - [system] - Logging configured: DEBUG level, text format
For more detailed logging configuration options, see the Logging Documentation.