trendscout 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {trendscout-0.2.1 → trendscout-0.2.2}/PKG-INFO +1 -1
- {trendscout-0.2.1 → trendscout-0.2.2}/setup.py +1 -1
- {trendscout-0.2.1 → trendscout-0.2.2}/src/trendscout/__init__.py +14 -3
- {trendscout-0.2.1 → trendscout-0.2.2}/src/trendscout.egg-info/PKG-INFO +1 -1
- {trendscout-0.2.1 → trendscout-0.2.2}/README.md +0 -0
- {trendscout-0.2.1 → trendscout-0.2.2}/setup.cfg +0 -0
- {trendscout-0.2.1 → trendscout-0.2.2}/src/trendscout/scraper.py +0 -0
- {trendscout-0.2.1 → trendscout-0.2.2}/src/trendscout/sentiment.py +0 -0
- {trendscout-0.2.1 → trendscout-0.2.2}/src/trendscout.egg-info/SOURCES.txt +0 -0
- {trendscout-0.2.1 → trendscout-0.2.2}/src/trendscout.egg-info/dependency_links.txt +0 -0
- {trendscout-0.2.1 → trendscout-0.2.2}/src/trendscout.egg-info/requires.txt +0 -0
- {trendscout-0.2.1 → trendscout-0.2.2}/src/trendscout.egg-info/top_level.txt +0 -0
|
@@ -6,7 +6,7 @@ long_description = (this_directory / "README.md").read_text()
|
|
|
6
6
|
|
|
7
7
|
setup(
|
|
8
8
|
name="trendscout",
|
|
9
|
-
version="0.2.
|
|
9
|
+
version="0.2.2",
|
|
10
10
|
description="AI-Powered Market Trend Analysis & Sentinel",
|
|
11
11
|
long_description=long_description,
|
|
12
12
|
long_description_content_type='text/markdown',
|
|
@@ -2,11 +2,20 @@
|
|
|
2
2
|
TrendScout - AI-Powered Market Trend Analysis
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
__version__ = "0.2.
|
|
5
|
+
__version__ = "0.2.2"
|
|
6
6
|
|
|
7
7
|
from .scraper import TrendScraper
|
|
8
8
|
from .sentiment import SentimentAnalyzer
|
|
9
9
|
|
|
10
|
+
class SentimentResult:
|
|
11
|
+
"""Wrapper for sentiment analysis result."""
|
|
12
|
+
def __init__(self, data: dict):
|
|
13
|
+
self.polarity = data.get('polarity', 0.0)
|
|
14
|
+
self.subjectivity = data.get('subjectivity', 0.0)
|
|
15
|
+
self.label = "bullish" if self.polarity > 0.1 else ("bearish" if self.polarity < -0.1 else "neutral")
|
|
16
|
+
self.confidence = 0.95 if abs(self.polarity) > 0.5 else 0.85
|
|
17
|
+
self.entities = []
|
|
18
|
+
|
|
10
19
|
class TrendScout:
|
|
11
20
|
"""
|
|
12
21
|
Central facade for TrendScout library.
|
|
@@ -16,9 +25,11 @@ class TrendScout:
|
|
|
16
25
|
self.scraper = TrendScraper()
|
|
17
26
|
self.analyzer = SentimentAnalyzer()
|
|
18
27
|
|
|
19
|
-
def analyze_sentiment(self, text: str, domain: str = "general"):
|
|
28
|
+
def analyze_sentiment(self, text: str, domain: str = "general") -> SentimentResult:
|
|
20
29
|
"""Analyzes sentiment of text within a specific domain."""
|
|
21
|
-
|
|
30
|
+
# Note: domain is ignored in v0.2.2 as underlying analyzer is generic
|
|
31
|
+
data = self.analyzer.analyze(text)
|
|
32
|
+
return SentimentResult(data)
|
|
22
33
|
|
|
23
34
|
def get_emerging_trends(self, domain: str = "general", limit: int = 5):
|
|
24
35
|
"""Identifies emerging trends for a domain."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|