finbrain-python 0.3.0__py3-none-any.whl → 0.3.2__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.
@@ -24,7 +24,13 @@ class AsyncInsiderTransactionsAPI:
24
24
  limit: int | None = None,
25
25
  as_dataframe: bool = False,
26
26
  ) -> Dict[str, Any] | pd.DataFrame:
27
- """Insider transactions for a symbol (async)."""
27
+ """Insider transactions for a symbol (async).
28
+
29
+ Rows carry ``valueFlag``: ``None`` normally, ``"price_implausible"``
30
+ when the filer typed the total proceeds into the price field, in
31
+ which case ``pricePerShare`` and ``totalValue`` must not be summed.
32
+ ``totalValue`` is shares x price on every other row.
33
+ """
28
34
  params: Dict[str, str] = {}
29
35
  if date_from:
30
36
  params["startDate"] = to_datestr(date_from)
@@ -95,7 +95,12 @@ class AsyncScreenerAPI:
95
95
  limit: int | None = None,
96
96
  as_dataframe: bool = False,
97
97
  ) -> List[Dict[str, Any]] | pd.DataFrame:
98
- """Screen insider trades across all tickers."""
98
+ """Screen insider trades across all tickers.
99
+
100
+ Rows carry ``valueFlag`` (``"price_implausible"`` when the filer typed
101
+ the total proceeds into the price field); leave those rows out of any
102
+ dollar sum or average.
103
+ """
99
104
  params = self._build_params(limit=limit)
100
105
  return await self._get("screener/insider-trading", params, as_dataframe)
101
106
 
@@ -148,6 +148,12 @@ class AppRatingsAPI:
148
148
  publish many apps (Apple has 140 on iOS) and which of them matters
149
149
  is your judgement, not ours.
150
150
 
151
+ Either frame carries a ``cik`` column: the company's SEC Central
152
+ Index Key, a 10-digit zero-padded string (leading zeros are data),
153
+ ``None`` for an issuer with no SEC registration. It is one value
154
+ per company, repeated down the frame, so a frame can be joined to
155
+ the other FinBrain datasets on the entity rather than the symbol.
156
+
151
157
  Returns
152
158
  -------
153
159
  dict | pandas.DataFrame
@@ -165,6 +171,12 @@ class AppRatingsAPI:
165
171
  data = self._c._request("GET", path, params=params)
166
172
 
167
173
  if as_dataframe:
174
+ # One value per company, so it is a constant column rather than a
175
+ # per-row field. Assigned after the flatten so the flatten stays a
176
+ # pure function of the rows it is given. Kept as an object column:
177
+ # a numeric dtype would eat the leading zeros.
178
+ cik = data.get("cik")
179
+
168
180
  if per_app:
169
181
  flat = _flatten_apps(data.get("apps") or [])
170
182
  df = pd.DataFrame(flat)
@@ -174,6 +186,7 @@ class AppRatingsAPI:
174
186
  # row per app, so a date index would not be unique.
175
187
  df.sort_values(["app_id", "date"], inplace=True)
176
188
  df.reset_index(drop=True, inplace=True)
189
+ df["cik"] = cik
177
190
  return df
178
191
 
179
192
  rows: List[Dict[str, Any]] = data.get("data", [])
@@ -182,6 +195,7 @@ class AppRatingsAPI:
182
195
  if not df.empty and "date" in df.columns:
183
196
  df["date"] = pd.to_datetime(df["date"])
184
197
  df.set_index("date", inplace=True)
198
+ df["cik"] = cik
185
199
  return df
186
200
 
187
201
  return data
@@ -49,6 +49,11 @@ class InsiderTransactionsAPI:
49
49
  Returns
50
50
  -------
51
51
  dict | pandas.DataFrame
52
+
53
+ Rows carry ``valueFlag``: ``None`` normally, ``"price_implausible"``
54
+ when the filer typed the total proceeds into the price field, in
55
+ which case ``pricePerShare`` and ``totalValue`` must not be summed.
56
+ ``totalValue`` is shares x price on every other row.
52
57
  """
53
58
  params: Dict[str, str] = {}
54
59
  if date_from:
@@ -100,7 +100,12 @@ class ScreenerAPI:
100
100
  limit: int | None = None,
101
101
  as_dataframe: bool = False,
102
102
  ) -> List[Dict[str, Any]] | pd.DataFrame:
103
- """Screen insider trades across all tickers."""
103
+ """Screen insider trades across all tickers.
104
+
105
+ Rows carry ``valueFlag`` (``"price_implausible"`` when the filer typed
106
+ the total proceeds into the price field); leave those rows out of any
107
+ dollar sum or average.
108
+ """
104
109
  params = self._build_params(limit=limit)
105
110
  return self._get("screener/insider-trading", params, as_dataframe)
106
111
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: finbrain-python
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Official Python client for the FinBrain API
5
5
  Author-email: Ahmet Salim Bilgin <ahmet@finbrain.tech>
6
6
  License-Expression: MIT
@@ -211,6 +211,32 @@ All four fields — `owner`, `amountRaw`, `amountFlag` and `disclosureDate` —
211
211
  are also present on `fb.screener.congress_house()` and
212
212
  `fb.screener.congress_senate()` rows.
213
213
 
214
+ Senate collection has been paused since 2026-10-22 (the Senate disclosure
215
+ site refuses automated access), so Senate rows stop at that date while it
216
+ is paused; House collection continues.
217
+
218
+ ### Insider transaction values (`valueFlag`)
219
+
220
+ Insider rows from `fb.insider_transactions.ticker()` and
221
+ `fb.screener.insider_trading()` carry `valueFlag`:
222
+
223
+ | Field | Meaning |
224
+ | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
225
+ | `totalValue` | Shares × price on every row (derivative rows: notional at the exercise price) |
226
+ | `valueFlag` | `null` on normal rows; `price_implausible` when the filer typed the total proceeds into the price field, so `pricePerShare` and `totalValue` are not usable |
227
+
228
+ Leave flagged rows out of any dollar sum or average:
229
+
230
+ ```python
231
+ df = fb.insider_transactions.ticker("AMD", as_dataframe=True)
232
+ clean = df[df["valueFlag"].isna()]
233
+ open_market = clean[clean["transactionType"].isin(["Purchase", "Sale"])]
234
+ ```
235
+
236
+ Only `Purchase` and `Sale` are open-market trades at the insider's own
237
+ initiative; the other transaction types are awards, option exercises, tax
238
+ withholding, gifts and other transfers.
239
+
214
240
  ### Company identifier (`cik`)
215
241
 
216
242
  Rows from the four SEC/government datasets — `fb.insider_transactions`,
@@ -13,7 +13,7 @@ finbrain/aio/endpoints/available.py,sha256=rQuffHowNF7FrVV5Ds-KE5iFjdz0I_vD7Qk2_
13
13
  finbrain/aio/endpoints/corporate_lobbying.py,sha256=4rILB9-W91n6v2UwOnlVeH-ulk4D8onamzdEJf--wko,1429
14
14
  finbrain/aio/endpoints/government_contracts.py,sha256=-jKXMHWrdG-4PszBSTQpK-i4SHpVZufPDBABMDB56Gk,1540
15
15
  finbrain/aio/endpoints/house_trades.py,sha256=0z9F2KvG2Virbz0bDugxKYyh56NcG2EH0qqr3dO0Op4,2602
16
- finbrain/aio/endpoints/insider_transactions.py,sha256=EBqHdvapYWvI53PM_sQy0caN2rbl7Qul4OmqzItMUR0,1437
16
+ finbrain/aio/endpoints/insider_transactions.py,sha256=p2wAE8A4nA8DuXEXgycQG3YakFGnbhxaNuPEFZgpenk,1734
17
17
  finbrain/aio/endpoints/linkedin_data.py,sha256=ucnkyNc1waiFHLxas1onPhxh9Y7ekcI_gOfUJ5gu1hI,1469
18
18
  finbrain/aio/endpoints/news.py,sha256=NJkcpoP8ngNsJdCzQab8yaXJzNe5ypYstzq3-mEHfqU,1446
19
19
  finbrain/aio/endpoints/options.py,sha256=k1XL3ktoFL2Exw6UE2XfU-EcS1Xw8BPXQzABLYXmfxk,1442
@@ -21,18 +21,18 @@ finbrain/aio/endpoints/patent_filings.py,sha256=Wumihz2X7knKZNF36X9t0UJ8mk0ydg6H
21
21
  finbrain/aio/endpoints/predictions.py,sha256=BrUSmqy0v7ngXyoE_UHgqdght8qtJ8IRxAhk_s9UeR0,1285
22
22
  finbrain/aio/endpoints/recent.py,sha256=TSaAwf5w86O1plSmm4eg_gKSjSap2Z8rd2i7FAvgm90,2302
23
23
  finbrain/aio/endpoints/reddit_mentions.py,sha256=P9ToZRaRN521RJ9W2J8cBCySUsNT47ROe-8TTdVtlqA,1508
24
- finbrain/aio/endpoints/screener.py,sha256=VdpS7wWApZpzjAdg3IfUb1k2RgsAF2d5-wups_Q_KaY,11810
24
+ finbrain/aio/endpoints/screener.py,sha256=HFytU17v8qNNtR5pKF8jkYEkcL6KeOX5jr_YOC8MKV0,12008
25
25
  finbrain/aio/endpoints/senate_trades.py,sha256=PVdp08M82fInANyUrLqrxvM8qY5QPisnN-THnORaexY,2602
26
26
  finbrain/aio/endpoints/sentiments.py,sha256=BXFT0jr5j0MnB65MXGxZK36BJLXMTuggkFF9A9eenEQ,1532
27
27
  finbrain/endpoints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  finbrain/endpoints/_utils.py,sha256=wY8SKthpVernWlKwZfWoM8zZtQ3GS_hBQioH1Fk7RK4,1190
29
29
  finbrain/endpoints/analyst_ratings.py,sha256=6q_tecgnbzXn2wLSWqHNUa9MbLcybTD7xEBAkUyGPR0,2218
30
- finbrain/endpoints/app_ratings.py,sha256=LQwikRaiJH85MzfAEOtFSgnLKsjzIVtHRyuwHWCqX3w,6287
30
+ finbrain/endpoints/app_ratings.py,sha256=RIXjLaT40rc3Y4ezklNETtYz6SK9n4xxBIBYCFA1IMo,7067
31
31
  finbrain/endpoints/available.py,sha256=3cXjDK1qE38RHAfQ2C14oD7l7dR8mhDtUcva3LzlK5s,3911
32
32
  finbrain/endpoints/corporate_lobbying.py,sha256=K4jFcgx2_PqxFSlSm2E0rxuunl7FjWEwk_S4nfjsMuw,2213
33
33
  finbrain/endpoints/government_contracts.py,sha256=jb96byPNK32AsEQWgCHMU7kAue9BFC539TH10JGfY7I,2343
34
34
  finbrain/endpoints/house_trades.py,sha256=AeNeA37xV0juZUZn95-Qr9fa0N0aNLDZuTtlR8fJQgc,4558
35
- finbrain/endpoints/insider_transactions.py,sha256=TU6EsSHIeams4OLJ9s8BpNuXeBnWPHghlp4enqkEFe8,2244
35
+ finbrain/endpoints/insider_transactions.py,sha256=NyKVzk6rZT_7YcF1-ZFcNANBYl7N9VlRDoWKetl259s,2532
36
36
  finbrain/endpoints/linkedin_data.py,sha256=zcNboQ-Ejt_7Ncu3p9WCd-PsjEBFbojVaJZdkbaGT8Q,2215
37
37
  finbrain/endpoints/news.py,sha256=q4aaEiunrUbl1FF0JZuX9__cZWxm2r1-B9x-c8g4Ia8,1913
38
38
  finbrain/endpoints/options.py,sha256=_TYWPcJ-gmPTQRg_kEVQl6Oj6fAirtZJ8QrfqFA2cMU,2611
@@ -40,11 +40,11 @@ finbrain/endpoints/patent_filings.py,sha256=496m-3lnGc3twMAdcIDOyMWs3KwHD2W8c_vz
40
40
  finbrain/endpoints/predictions.py,sha256=og1RY68p4O71smogrx-M5FyGk8FVclBGP18BvttzbZk,2026
41
41
  finbrain/endpoints/recent.py,sha256=7D36oVRJKF5hkR42y6M6CiEMYksuFleZou1v86SbEfA,3004
42
42
  finbrain/endpoints/reddit_mentions.py,sha256=WiePVAyUbA0VpWOd22M2YTlDWOQITp8qUBraI29y6d4,2305
43
- finbrain/endpoints/screener.py,sha256=vyay_g0OMfndmJc8UWBmxaHafp6grl7UqVdbMNTqJTc,11704
43
+ finbrain/endpoints/screener.py,sha256=rNrEbG0gKAZ0yl1c4AHbejLa4c5xiV_ERxxVk2lXhpA,11902
44
44
  finbrain/endpoints/senate_trades.py,sha256=qtpuGe_M3dE2vVsol9R6bw1Xqt7XY2rHVrf6ElTc4wE,4484
45
45
  finbrain/endpoints/sentiments.py,sha256=sGGPaxzGGFvMOaYv3VSCmnG7H9v7OVlX7Vsndct8jhA,2606
46
- finbrain_python-0.3.0.dist-info/licenses/LICENSE,sha256=x71LjIUPbK7Y8YBulH_AXzEIX7BK90dgFL2zA6LBT-A,1069
47
- finbrain_python-0.3.0.dist-info/METADATA,sha256=uyM_2pKGhMBmrdrvyVfk5vubu2G3_hhwtIBBY0mIdjY,24211
48
- finbrain_python-0.3.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
49
- finbrain_python-0.3.0.dist-info/top_level.txt,sha256=dCiQtTx3z2TtO_yQI6q3yODcdb-pABB-iEReJegVAv0,9
50
- finbrain_python-0.3.0.dist-info/RECORD,,
46
+ finbrain_python-0.3.2.dist-info/licenses/LICENSE,sha256=x71LjIUPbK7Y8YBulH_AXzEIX7BK90dgFL2zA6LBT-A,1069
47
+ finbrain_python-0.3.2.dist-info/METADATA,sha256=betC8OX1cP9VgNI0R8lWJ6_OgIOXSEmyV9EDJHoQytI,25642
48
+ finbrain_python-0.3.2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
49
+ finbrain_python-0.3.2.dist-info/top_level.txt,sha256=dCiQtTx3z2TtO_yQI6q3yODcdb-pABB-iEReJegVAv0,9
50
+ finbrain_python-0.3.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (84.0.0)
2
+ Generator: setuptools (84.2.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5