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

# Run the main financial analyzer
stockholm-finance

# Launch the interactive dashboard
stockholm-dashboard

Python API Usage

from src.core.financial_analyzer import main

# Run analysis
main()

# Or use the dashboard
from src.ui.textual_dashboard import StockholmDashboard
dashboard = StockholmDashboard()
dashboard.run()

โœจ 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.7.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.7-py3-none-any.whl (59.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stockholm-finance-1.0.7.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.7.tar.gz
Algorithm Hash digest
SHA256 7b1b94d25eb923d41eb25a28172d3d0ddefef3a2b05d802252444f406ddfa9f2
MD5 447d6a0d9b75415f9e6f43f50f177ab8
BLAKE2b-256 be37ab8875cd661a5f57bf5ad0c10eb2ba437c505856ee6fce6269b4815d5266

See more details on using hashes here.

Provenance

The following attestation bundles were made for stockholm-finance-1.0.7.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.7-py3-none-any.whl.

File metadata

File hashes

Hashes for stockholm_finance-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d1731376ce32740e1362b356c92a4e9a189c2d96573f7c2843a95247d6d5f1b7
MD5 5bbb8edb58c8632e25c838a81dba5636
BLAKE2b-256 aec0b2e106badd1f8933889a6d3196e5ad8464d9836212806412f9b94c65567c

See more details on using hashes here.

Provenance

The following attestation bundles were made for stockholm_finance-1.0.7-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