bullishpy 0.70.0__py3-none-any.whl → 0.76.0__py3-none-any.whl

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.
bullish/app/app.py CHANGED
@@ -35,6 +35,7 @@ from bullish.utils.checks import (
35
35
  compatible_bullish_database,
36
36
  empty_analysis_table,
37
37
  )
38
+ from mysec.services import sec # type: ignore
38
39
 
39
40
  CACHE_SHELVE = "user_cache"
40
41
  DB_KEY = "db_path"
@@ -80,7 +81,7 @@ def on_table_select() -> None:
80
81
 
81
82
  db = bearish_db(st.session_state.database_path)
82
83
  if st.session_state.data.empty or (
83
- not st.session_state.data.iloc[row]["symbol"].to_numpy()
84
+ not st.session_state.data.iloc[row]["symbol"].to_numpy().size > 0
84
85
  ):
85
86
  return
86
87
 
@@ -123,7 +124,7 @@ def dialog_pick_database() -> None:
123
124
  f"The database {db_path} has not the necessary data to run this application. "
124
125
  "A backround job will be started to update the data."
125
126
  )
126
- analysis(db_path)
127
+ analysis(db_path, "Update analysis")
127
128
  st.rerun()
128
129
  if event is None:
129
130
  st.stop()
@@ -428,7 +429,7 @@ def main() -> None:
428
429
  st.session_state.initialized = True
429
430
  bearish_db_ = bearish_db(st.session_state.database_path)
430
431
 
431
- charts_tab, jobs_tab = st.tabs(["Charts", "Jobs"])
432
+ charts_tab, jobs_tab, sec_tab = st.tabs(["Charts", "Jobs", "Sec"])
432
433
  if "data" not in st.session_state:
433
434
  st.session_state.data = load_analysis_data(bearish_db_)
434
435
 
@@ -479,6 +480,8 @@ def main() -> None:
479
480
  use_container_width=True,
480
481
  hide_index=True,
481
482
  )
483
+ with sec_tab:
484
+ st.plotly_chart(sec(bearish_db_), use_container_width=True)
482
485
 
483
486
 
484
487
  if __name__ == "__main__":
bullish/database/crud.py CHANGED
@@ -74,7 +74,11 @@ class BullishDb(BearishDb, BullishDbBase): # type: ignore
74
74
  logger.info(
75
75
  "Running tickermood upgrade to create the subject table in the database."
76
76
  )
77
- tickermood_upgrade(database_url=database_url, no_migration=True)
77
+ try:
78
+ tickermood_upgrade(database_url=database_url, no_migration=True)
79
+ except Exception as e:
80
+ logger.error(f"failed to update database: {e}")
81
+ print(f"failed to update database: {e}")
78
82
  return engine
79
83
 
80
84
  def model_post_init(self, __context: Any) -> None:
bullish/jobs/tasks.py CHANGED
@@ -4,6 +4,7 @@ from typing import Optional, Any, Callable, List
4
4
 
5
5
  import pandas as pd
6
6
  from bearish.main import Bearish # type: ignore
7
+ from bearish.models.sec.sec import Secs # type: ignore
7
8
  from tickermood.main import get_news # type: ignore
8
9
  from tickermood.types import DatabaseConfig # type: ignore
9
10
 
@@ -84,6 +85,9 @@ def _base_update(
84
85
  series_length=update_query.window_size,
85
86
  delay=update_query.data_age_in_days,
86
87
  )
88
+ bearish.get_prices_index(series_length=update_query.window_size)
89
+ Secs.upload(bearish._bearish_db)
90
+ Secs.update_values(bearish._bearish_db)
87
91
  if update_query.update_financials:
88
92
  bearish.update_financials()
89
93
  bullish_db = BullishDb(database_path=database_path)
@@ -195,22 +199,20 @@ def news(
195
199
  logger.debug(
196
200
  f"extracting news for {symbol} subject: {subject.model_dump()}"
197
201
  )
198
- bullish_db.update_analysis(
199
- symbol,
200
- subject.model_dump(
201
- exclude_none=True,
202
- exclude_unset=True,
203
- exclude_defaults=True,
204
- exclude={"symbol"},
205
- ),
206
- )
207
- base_news(
208
- database_path=database_path,
209
- job_type=job_type,
210
- symbols=symbols,
211
- headless=headless,
212
- task=task,
213
- )
202
+ try:
203
+ bullish_db.update_analysis(
204
+ symbol,
205
+ subject.model_dump(
206
+ exclude_none=True,
207
+ exclude_unset=True,
208
+ exclude_defaults=True,
209
+ exclude={"symbol"},
210
+ ),
211
+ )
212
+ except Exception as e:
213
+ logger.error(f"failed to extract news for {symbol}: {e}")
214
+ print(f"failed to extract news for {symbol}: {e}")
215
+ continue
214
216
 
215
217
 
216
218
  @huey.periodic_task(crontab(minute="0", hour="8"), context=True) # type: ignore
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bullishpy
3
- Version: 0.70.0
3
+ Version: 0.76.0
4
4
  Summary:
5
5
  License-File: LICENSE
6
6
  Author: aan
@@ -8,10 +8,11 @@ Author-email: andoludovic.andriamamonjy@gmail.com
8
8
  Requires-Python: >=3.12,<3.13
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Programming Language :: Python :: 3.12
11
- Requires-Dist: bearishpy (>=0.29.0,<0.30.0)
11
+ Requires-Dist: bearishpy (>=0.35.0,<0.36.0)
12
12
  Requires-Dist: click (>=7.0,<=8.1)
13
13
  Requires-Dist: huey (>=2.5.3,<3.0.0)
14
14
  Requires-Dist: joblib (>=1.5.1,<2.0.0)
15
+ Requires-Dist: mysec (>=0.3.0,<0.4.0)
15
16
  Requires-Dist: pandas-ta (>=0.4.71b0,<0.5.0)
16
17
  Requires-Dist: plotly (>=4.12.0,<6.0.0)
17
18
  Requires-Dist: streamlit (>=1.45.1,<2.0.0)
@@ -10,7 +10,7 @@ bullish/analysis/industry_views.py,sha256=-B4CCAYz2arGQtWTXLLMpox0loO_MGdVQd2ycC
10
10
  bullish/analysis/openai.py,sha256=Fw7A8lFMgSEQFA48Q9GjVpEC3oiBgSHUFi7YO5rzhAc,3444
11
11
  bullish/analysis/predefined_filters.py,sha256=E65qrTSaDFuUxoaeZ8D72K5AobumobpQdpcTIF308D4,14053
12
12
  bullish/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- bullish/app/app.py,sha256=dnTzlyKrG2XTKDeLnJwfdvIf24eXM8fd29bvJWmMr8k,17190
13
+ bullish/app/app.py,sha256=FLWwhjGwMVXYfA9EI5RUeQRQGf9Qu7up0ypJgS4FTFE,17367
14
14
  bullish/cli.py,sha256=yYqiEQAvOIQ-pTn77RPuE449gwaEGBeQwNHHAJ5yQDM,2739
15
15
  bullish/database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  bullish/database/alembic/README,sha256=heMzebYwlGhnE8_4CWJ4LS74WoEZjBy-S-mIJRxAEKI,39
@@ -45,7 +45,7 @@ bullish/database/alembic/versions/ec25c8fa449f_.py,sha256=8Yts74KEjK4jg20zIo90_0
45
45
  bullish/database/alembic/versions/ee5baabb35f8_.py,sha256=nBMEY-_C8AsSXVPyaDdUkwrFFo2gxShzJhmrjejDwtc,1632
46
46
  bullish/database/alembic/versions/fc191121f522_.py,sha256=0sstF6TpAJ09-Mt-Vek9SdSWksvi4C58a5D92rBtuY8,1894
47
47
  bullish/database/alembic/versions/ff0cc4ba40ec_.py,sha256=74lxga54ig_LoNZYK9toJL9iRwGbNRezh1zvO1YI40U,2719
48
- bullish/database/crud.py,sha256=3hx12D0gxnp-helhD6SX5zArCdTX-1FS8g5fYb1KySg,15946
48
+ bullish/database/crud.py,sha256=-pncRg_YA5y2wE2HELJHiGbeTzmaGF7LjMC8be10qwA,16123
49
49
  bullish/database/schemas.py,sha256=HudFJ9lsIkVaEYjQUWammrsDnYSmEe4hOCbim3dN_4A,3946
50
50
  bullish/database/scripts/create_revision.py,sha256=rggIf-3koPqJNth8FIg89EOfnIM7a9QrvL8X7UJsP0g,628
51
51
  bullish/database/scripts/stamp.py,sha256=PWgVUEBumjNUMjTnGw46qmU3p221LeN-KspnW_gFuu4,839
@@ -59,11 +59,11 @@ bullish/interface/interface.py,sha256=6uZAY19WNtDRKdOitqzqMEo6JTep2M3HC8iFUKYntH
59
59
  bullish/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
60
  bullish/jobs/app.py,sha256=5MJ5KXUo7JSNAvOPgkpIMasD11VTrjQvGzM7vmCY65E,77
61
61
  bullish/jobs/models.py,sha256=rBXxtGFBpgZprrxq5_X2Df-bh8BLYEfw-VLMRucrqa8,784
62
- bullish/jobs/tasks.py,sha256=13oK53fBXd5pjMLLMeOoQ4vG-yH-6dfrodhb9KzAYVw,7230
62
+ bullish/jobs/tasks.py,sha256=VuFQ2fmzlP_ayy5PhCzH9YroUSRRnvz2SPomuG3SMD0,7566
63
63
  bullish/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
64
  bullish/utils/checks.py,sha256=g-5QXNWNe1_BwHKrc2PtvPiLraL0tqGgxnzG7u-Wkgo,2189
65
- bullishpy-0.70.0.dist-info/METADATA,sha256=BSKeW7WON1LGGuhloVa1J1GYUech--iexKJp4hfrsCY,3031
66
- bullishpy-0.70.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
67
- bullishpy-0.70.0.dist-info/entry_points.txt,sha256=eaPpmL6vmSBFo0FBtwibCXGqAW4LFJ83whJzT1VjD-0,43
68
- bullishpy-0.70.0.dist-info/licenses/LICENSE,sha256=nYb7AJFegu6ndlQhbbk54MjT-GH-0x9RF6Ls-ggJ_g4,1075
69
- bullishpy-0.70.0.dist-info/RECORD,,
65
+ bullishpy-0.76.0.dist-info/METADATA,sha256=xUHUxktlK_C4Es0mHaQ2r6FSkAtcop456DSmZmpVX3g,3069
66
+ bullishpy-0.76.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
67
+ bullishpy-0.76.0.dist-info/entry_points.txt,sha256=eaPpmL6vmSBFo0FBtwibCXGqAW4LFJ83whJzT1VjD-0,43
68
+ bullishpy-0.76.0.dist-info/licenses/LICENSE,sha256=nYb7AJFegu6ndlQhbbk54MjT-GH-0x9RF6Ls-ggJ_g4,1075
69
+ bullishpy-0.76.0.dist-info/RECORD,,