neurostats-API 0.0.23b0__py3-none-any.whl → 0.0.23b1__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.
@@ -138,62 +138,6 @@ class TechFetcher(StatsFetcher):
138
138
  )
139
139
 
140
140
  return df
141
-
142
- def conduct_db_search_tej(self):
143
- # 再對TEJ search
144
- tej_required_cols = [
145
- "mdate", "open_d", 'high_d', 'low_d', 'close_d', 'vol'
146
- ]
147
-
148
- required_cols = ['date', 'open', 'high', 'low', 'close', 'volume']
149
- tej_name_proj = {
150
- tej_name: org_name
151
- for tej_name, org_name in zip(tej_required_cols, required_cols)
152
- }
153
-
154
- query = {'ticker': self.ticker}
155
- ticker_full = self.collection.find_one(query)
156
-
157
- if not ticker_full:
158
- raise ValueError("No ticker found in database")
159
-
160
- daily_data = ticker_full.get("data", [])
161
- if not isinstance(daily_data, list):
162
- raise TypeError("Expected 'daily_data' to be a list.")
163
-
164
- df = pd.DataFrame(daily_data)
165
-
166
- if not self.has_required_columns(df, tej_required_cols):
167
- raise KeyError(f"Missing required columns")
168
- df = df.rename(columns=tej_name_proj)
169
-
170
- return df[required_cols]
171
-
172
- def conduct_db_search_us(self):
173
- required_cols = ['date', 'open', 'high', 'low', 'close', 'volume']
174
-
175
- query = {'ticker': self.ticker}
176
- filter_query = {"daily_data" : 1, "_id": 0}
177
- ticker_full = self.collection.find_one(query, filter_query)
178
-
179
- if not ticker_full:
180
- raise ValueError("No ticker found in database")
181
-
182
- daily_data = ticker_full.get("daily_data", [])
183
- if not isinstance(daily_data, list):
184
- raise TypeError("Expected 'daily_data' to be a list.")
185
-
186
- df = pd.DataFrame(daily_data)
187
-
188
- if not self.has_required_columns(df, required_cols):
189
- missing_cols = [col for col in required_cols if col not in df.columns]
190
- missing_cols = ",".join(missing_cols)
191
- print(Warning(f"{missing_cols} not in columns"))
192
- for col in missing_cols:
193
- df[col] = pd.NA
194
- # raise KeyError(f"Missing required columns")
195
-
196
- return df[required_cols]
197
141
 
198
142
 
199
143
  def conduct_db_search_twse(self):
@@ -176,7 +176,10 @@ class FinanceReportFetcher(BaseTEJFetcher):
176
176
  fetched_data = self.collection.aggregate(pipeline).to_list()
177
177
  data_dict = self.transform_value(
178
178
  StatsProcessor.list_of_dict_to_dict(
179
- fetched_data, ["year", "season"], "Q", report_type
179
+ data_list=fetched_data,
180
+ keys=["year", "season"],
181
+ delimeter="Q",
182
+ data_key=report_type
180
183
  )
181
184
  )
182
185
 
@@ -241,7 +244,7 @@ class FinanceReportFetcher(BaseTEJFetcher):
241
244
  "$gt": start_year,
242
245
  "$lt": end_year
243
246
  },
244
- "data.season": end_season
247
+ "data.season": start_season
245
248
  }
246
249
  else:
247
250
  match_stage = {
@@ -9,6 +9,13 @@ TWN/AINVFQ1:
9
9
  - annd
10
10
  - fin_ind
11
11
  - eps
12
+ - r307
13
+ - r305
14
+ - r306
15
+ - r316
16
+ - r609
17
+ - r614
18
+ - r611
12
19
  TWN/AFESTM1:
13
20
  - coid
14
21
  - mdate
@@ -19,4 +26,8 @@ TWN/AFESTM1:
19
26
  - curr
20
27
  - annd
21
28
  - fin_ind
22
- - eps
29
+ - eps
30
+ - r307
31
+ - r305
32
+ - r306
33
+ - r316
@@ -56,10 +56,6 @@ TWN/AINVFQ1:
56
56
  - person
57
57
  - shares
58
58
  - wavg
59
- - r304
60
- - r305
61
- - r306
62
- - r316
63
59
  - r834
64
60
  TWN/AFESTM1:
65
61
  - ip12
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neurostats_API
3
- Version: 0.0.23b0
3
+ Version: 0.0.23b1
4
4
  Summary: The service of NeuroStats website
5
5
  Home-page: https://github.com/NeurowattStats/NeuroStats_API.git
6
6
  Author: JasonWang@Neurowatt
@@ -10,14 +10,14 @@ neurostats_API/fetchers/institution.py,sha256=UrcBc6t7u7CnEwUsf6YmLbbJ8VncdWpq8b
10
10
  neurostats_API/fetchers/margin_trading.py,sha256=lQImtNdvaBoSlKhJvQ3DkH3HjSSgKRJz4ZZpyR5-Z4I,10433
11
11
  neurostats_API/fetchers/month_revenue.py,sha256=DZeOblfSz7NhQXVvL5xfMHZ1rv2B8pgqu-U-o_gcAuc,6323
12
12
  neurostats_API/fetchers/profit_lose.py,sha256=ZvSG4vx4gBrWMKmcyuSaoNyW6JGiOtIpFxRIeyCAeDY,7705
13
- neurostats_API/fetchers/tech.py,sha256=LvgWhcHdruTGJE_1_z8rrArJs3s7X5AbE3LtuR4zwIM,18051
14
- neurostats_API/fetchers/tej_finance_report.py,sha256=5ERpg1kq2wSPdLMBYXX5MUWRxOrwwFHSBXNidSKeuRo,11233
13
+ neurostats_API/fetchers/tech.py,sha256=u0L6X19g7VmbCUXF_9UI_tBIJJ9hPareEggjXUe52_o,16079
14
+ neurostats_API/fetchers/tej_finance_report.py,sha256=og3wg0Vdyzyx3Ex6ejk10ORo4zQjcrUrRtR9W1dCWNE,11320
15
15
  neurostats_API/fetchers/value_invest.py,sha256=b_x2Dpgs8VBU5HdG8ocKtfIEkqhU-Q0S5n6RxuFuM2g,7467
16
16
  neurostats_API/tools/company_list/tw.json,sha256=VWaDFvd0ACCVSWItcHHpmVuM_RzP71jLZl9RBHztu-0,51332
17
17
  neurostats_API/tools/tej_db/tej_db_index.yaml,sha256=lu-cmbB6dhx0eUlBSkyzXWqPKlwRtEvqlMTAh2y0oHs,969
18
18
  neurostats_API/tools/tej_db/tej_db_percent_index.yaml,sha256=-rBSdOoYs5UB9H6Y3FE5PTqV9meXEFZD2KhSlAQ_4Eg,323
19
- neurostats_API/tools/tej_db/tej_db_skip_index.yaml,sha256=nSbrflaJrWCIjL5WeHT3UDKZyN0WegVElUKVYA4YSa0,169
20
- neurostats_API/tools/tej_db/tej_db_thousand_index.yaml,sha256=S1k4PFZ7NsjGUgeCb89dyaojkOcvGPRdBr45hz3wlWY,507
19
+ neurostats_API/tools/tej_db/tej_db_skip_index.yaml,sha256=6UtMfPL7XvkKvEWTFXIIUZMJWZSagIduLYJb-r3HEg8,246
20
+ neurostats_API/tools/tej_db/tej_db_thousand_index.yaml,sha256=K2YFBSrxqX1V2upy0IUeQ4ung4aPrjtlqYSvCGaaO8I,479
21
21
  neurostats_API/tools/twse/balance_sheet.yaml,sha256=6XygNG_Ybb1Xkk1e39LMLKr7ATvaCP3xxuwFbgNl6dA,673
22
22
  neurostats_API/tools/twse/cash_flow_percentage.yaml,sha256=fk2Z4eb1JjGFvP134eJatHacB7BgTkBenhDJr83w8RE,1345
23
23
  neurostats_API/tools/twse/finance_overview_dict.yaml,sha256=B9nV75StXkrF3yv2-eezzitlJ38eEK86RD_VY6588gQ,2884
@@ -28,7 +28,7 @@ neurostats_API/utils/calculate_value.py,sha256=Zc5DG_qXnHZLkCjUYdoMWka3KVXu2o9Am
28
28
  neurostats_API/utils/data_process.py,sha256=LdDmhQMGBg1UI6cIWCdsj9YTkixtf1cyrN1xq2JZmPo,9971
29
29
  neurostats_API/utils/datetime.py,sha256=XJya4G8b_-ZOaBbMXgQjWh2MC4wc-o6goQ7EQJQMWrQ,773
30
30
  neurostats_API/utils/db_client.py,sha256=OYe6yazcR4Aa6jYmy47JrryUeh2NnKGqY2K_lSZe6i8,455
31
- neurostats_API-0.0.23b0.dist-info/METADATA,sha256=433KG3-zXJJeDPaZcmxBBIsamFrZziYqmGNoNG-Oz5E,31621
32
- neurostats_API-0.0.23b0.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
33
- neurostats_API-0.0.23b0.dist-info/top_level.txt,sha256=nSlQPMG0VtXivJyedp4Bkf86EOy2TpW10VGxolXrqnU,15
34
- neurostats_API-0.0.23b0.dist-info/RECORD,,
31
+ neurostats_API-0.0.23b1.dist-info/METADATA,sha256=W8Ks1L96z3SeSc5moAXkDwLYVlbMildAHJH6x4D09mo,31621
32
+ neurostats_API-0.0.23b1.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
33
+ neurostats_API-0.0.23b1.dist-info/top_level.txt,sha256=nSlQPMG0VtXivJyedp4Bkf86EOy2TpW10VGxolXrqnU,15
34
+ neurostats_API-0.0.23b1.dist-info/RECORD,,