2
2
3
3
# pylint: disable=W0212:protected-access
4
4
import json
5
+ import logging
5
6
from functools import wraps
6
7
from pathlib import Path
7
8
from sys import exc_info
17
18
if TYPE_CHECKING :
18
19
from openbb_core .app .static .app_factory import BaseApp
19
20
21
+ logger = logging .getLogger (__name__ )
22
+
23
+ logger .addHandler (logging .StreamHandler ())
24
+ logger .setLevel (logging .WARN )
25
+
26
+
27
+ dep_warning = (
28
+ "\n Deprecation Warning: The Account module is deprecated and will be removed in a future version."
29
+ + " Please migrate to using the `user_settings.json` file. For more information, visit:"
30
+ + " https://docs.openbb.co/platform/settings/user_settings/api_keys"
31
+ )
32
+
20
33
21
34
class Account : # noqa: D205, D400
22
35
"""/account
@@ -123,6 +136,7 @@ def login(
123
136
Optional[UserSettings]
124
137
User settings: profile, credentials, preferences
125
138
"""
139
+ logger .warning (dep_warning )
126
140
self ._hub_service = self ._create_hub_service (email , password , pat )
127
141
incoming = self ._hub_service .pull ()
128
142
self ._base_app .user .profile = incoming .profile
@@ -161,6 +175,7 @@ def save(self, return_settings: bool = False) -> Optional[UserSettings]:
161
175
Optional[UserSettings]
162
176
User settings: profile, credentials, preferences
163
177
"""
178
+ logger .warning (dep_warning )
164
179
if not self ._hub_service :
165
180
UserService .write_to_file (self ._base_app ._command_runner .user_settings )
166
181
else :
@@ -184,6 +199,7 @@ def refresh(self, return_settings: bool = False) -> Optional[UserSettings]:
184
199
Optional[UserSettings]
185
200
User settings: profile, credentials, preferences
186
201
"""
202
+ logger .warning (dep_warning )
187
203
if not self ._hub_service :
188
204
self ._base_app ._command_runner .user_settings = UserService .read_from_file ()
189
205
else :
@@ -210,6 +226,7 @@ def logout(self, return_settings: bool = False) -> Optional[UserSettings]:
210
226
Optional[UserSettings]
211
227
User settings: profile, credentials, preferences
212
228
"""
229
+ logger .warning (dep_warning )
213
230
if not self ._hub_service :
214
231
raise OpenBBError ("Not connected to hub." )
215
232
0 commit comments