Skip to main content

Advanced financial sentiment analysis tool with policy impact assessment

Project description

๐Ÿ“Š Stockholm Finance

Note: Pre-commit hooks are now active! ๐ŸŽ‰

CI/CD Pipeline PyPI version Python 3.8+ License: MIT Docker

Advanced financial sentiment analysis tool with policy impact assessment, intelligent caching, and professional dashboard interface.

๐Ÿš€ Quick Start

Installation

# From PyPI
pip install stockholm-finance

# From source
git clone https://github.com/aykaym/stockholm.git
cd stockholm
pip install -e .

Docker

# Run with Docker
docker run -it ghcr.io/aykaym/stockholm:latest

# Development environment
docker-compose up dev

Command Line Usage

# Launch the interactive financial analysis dashboard
stockholm-finance

# With options
stockholm-finance --quick      # Quick mode for faster startup
stockholm-finance --verbose    # Verbose output with debug info

Python API Usage

# Launch the dashboard programmatically
from src.core.financial_analyzer import main
main()

# Or use the dashboard directly
from src.ui.textual_dashboard import run_textual_dashboard
run_textual_dashboard()

# With configuration options
from src.ui.textual_dashboard import run_enhanced_textual_dashboard
run_enhanced_textual_dashboard(quick_mode=True, verbose=True)

โœจ Features

๐ŸŽฏ Core Analysis

  • Sentiment Analysis: Advanced NLP for market sentiment from news articles
  • Policy Analysis: Government policy impact assessment on markets
  • Multi-Ticker Support: Analyze sentiment across multiple stocks simultaneously
  • Real-time Data: Live market data integration with yfinance

๐Ÿ’พ Smart Caching

  • TTL-based Caching: Intelligent cache expiration (15min news, 5min prices)
  • Performance Optimization: 50+ cache reads/second, 20+ writes/second
  • Storage Efficiency: Compressed JSON storage with automatic cleanup

๐Ÿ“Š Interactive Dashboard

  • Professional TUI: Rich terminal interface with real-time updates
  • Multiple Views: Ticker info, earnings data, price charts, sentiment analysis
  • Responsive Design: Adaptive layouts for different terminal sizes

๐Ÿงช Enterprise Testing

  • 37+ Tests: Comprehensive test suite with 100% pass rate
  • Coverage: 80% cache manager, 68% policy analyzer, 39% sentiment analyzer
  • Performance: Benchmarked at 10+ articles/second processing

๐Ÿ“‹ Requirements

  • Python: 3.8 or higher
  • Dependencies: See requirements.txt
  • Optional: Docker for containerized deployment

๐Ÿ—๏ธ Architecture

stockholm/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ core/           # Core analysis engines
โ”‚   โ”œโ”€โ”€ data/           # Data fetching and caching
โ”‚   โ”œโ”€โ”€ ui/             # User interface components
โ”‚   โ””โ”€โ”€ config/         # Configuration management
โ”œโ”€โ”€ tests/              # Comprehensive test suite
โ”œโ”€โ”€ docs/               # Documentation
โ”œโ”€โ”€ scripts/            # DevOps and utility scripts
โ””โ”€โ”€ .github/            # CI/CD workflows

๐Ÿงช Testing

# Run all tests
python -m pytest tests/ -v

# With coverage
python -m pytest tests/ --cov=src --cov-report=html

# Performance tests
python -m pytest tests/test_performance.py -v

# Use the coverage checker
python check_coverage.py

๐Ÿš€ Development

Local Setup

# Clone repository
git clone https://github.com/yourusername/stockholm.git
cd stockholm

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate     # Windows

# Install dependencies
pip install -r requirements.txt
pip install -e ".[dev]"

# Run tests
python -m pytest tests/ -v

Docker Development

# Development environment
docker-compose up dev

# Run tests in container
docker-compose up test

# Code quality checks
docker-compose up quality

๐Ÿ“ฆ Releases

Automated Releases

The project uses automated versioning and releases:

# Create new release
python scripts/release.py

# Choose release type:
# - patch: Bug fixes (1.0.0 โ†’ 1.0.1)
# - minor: New features (1.0.0 โ†’ 1.1.0)  
# - major: Breaking changes (1.0.0 โ†’ 2.0.0)

CI/CD Pipeline

  • โœ… Automated Testing: All Python versions (3.8-3.12)
  • โœ… Security Scanning: Bandit + Safety vulnerability checks
  • โœ… Code Quality: Black, isort, flake8, mypy
  • โœ… Docker Images: Multi-platform builds
  • โœ… GitHub Releases: Automatic changelog generation

๐Ÿ“Š Performance

Benchmarks

  • Sentiment Analysis: 10+ articles/second
  • Cache Performance: 50+ reads/second, 20+ writes/second
  • Memory Usage: <100MB for 1000 articles
  • Test Suite: 37 tests in <1 second

Scalability

  • Concurrent Processing: Multi-threaded analysis support
  • Batch Operations: Efficient bulk data processing
  • Memory Efficient: Optimized for large datasets

๐Ÿ”’ Security

  • Dependency Scanning: Automated vulnerability checks
  • Code Analysis: Static security analysis with Bandit
  • Input Validation: Sanitized data processing
  • No Secrets: No hardcoded API keys or credentials

๐Ÿ“– Documentation

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes with tests
  4. Run quality checks (black src/ tests/ && pytest)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • TextBlob: Natural language processing
  • yfinance: Financial data API
  • Textual: Modern terminal UI framework
  • Rich: Beautiful terminal formatting
  • pytest: Testing framework

๐Ÿ“ž Support


Built with โค๏ธ for the financial analysis community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stockholm-finance-1.0.8.tar.gz (53.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stockholm_finance-1.0.8-py3-none-any.whl (59.6 kB view details)

Uploaded Python 3

File details

Details for the file stockholm-finance-1.0.8.tar.gz.

File metadata

  • Download URL: stockholm-finance-1.0.8.tar.gz
  • Upload date:
  • Size: 53.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for stockholm-finance-1.0.8.tar.gz
Algorithm Hash digest
SHA256 968bc77363c7c18778bec2f17b9a3bcf99e3aba71b098636a4a79513a1e39132
MD5 9080b00e795da2e2816c5d73f563efd3
BLAKE2b-256 8f4667c4a87da87360ed3666165f79174dab0a28fa8c2736ee95dc3a1d7ee934

See more details on using hashes here.

Provenance

The following attestation bundles were made for stockholm-finance-1.0.8.tar.gz:

Publisher: release.yml on aykaym/stockholm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stockholm_finance-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for stockholm_finance-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 163d3beeb1511cf453869718893de0c679be01f9040c7b52f175cd18b760e971
MD5 52824149fb5f1e13394ae86cc773f579
BLAKE2b-256 d40ddf82895c5f2353c18315c9e2b3f59bc58c38462d1b3224a34d9c4e94f2f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for stockholm_finance-1.0.8-py3-none-any.whl:

Publisher: release.yml on aykaym/stockholm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page