-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path__init__.py
More file actions
77 lines (68 loc) · 1.79 KB
/
__init__.py
File metadata and controls
77 lines (68 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
"""
Discourses - Official Python SDK
Institutional-grade financial sentiment analysis with era-calibrated lexicons.
Basic Usage:
>>> from discourses import Discourses
>>>
>>> client = Discourses(api_key="your-api-key")
>>>
>>> # Analyze single text
>>> result = client.analyze("Strong growth with excellent outlook")
>>> print(f"Label: {result.label}, Outlook: {result.outlook:.2f}")
>>>
>>> # Compare across eras
>>> comparison = client.compare_eras("Diamond hands!", eras=["primitive", "meme"])
>>> for era, data in comparison.results.items():
... print(f"{era}: {data['classification']['label']}")
>>>
>>> # Batch analysis
>>> texts = [{"id": "1", "text": "Bullish!"}, {"id": "2", "text": "Bearish..."}]
>>> batch = client.batch(texts, era="meme")
For more information, visit https://discourses.io/documentation
"""
__version__ = "1.1.4"
__author__ = "discourses.io"
__email__ = "support@discourses.io"
# Main client
from discourses.client import Discourses
# Constants and enums
from discourses.constants import Era, BASE_URL
# Exception classes
from discourses.exceptions import (
DiscoursesError,
APIError,
AuthenticationError,
RateLimitError,
ValidationError,
ResourceNotFoundError,
)
# Response models
from discourses.models import (
AnalysisResult,
CompareResult,
BatchResult,
)
# Public API
__all__ = [
# Version info
"__version__",
"__author__",
"__email__",
# Main client
"Discourses",
# Enums
"Era",
# Constants
"BASE_URL",
# Exceptions
"DiscoursesError",
"APIError",
"AuthenticationError",
"RateLimitError",
"ValidationError",
"ResourceNotFoundError",
# Models
"AnalysisResult",
"CompareResult",
"BatchResult",
]