finbrain-python 0.3.1__tar.gz → 0.3.2__tar.gz
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.
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/.github/workflows/ci.yml +4 -1
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/.github/workflows/release.yml +4 -1
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/CHANGELOG.md +17 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/PKG-INFO +27 -1
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/README.md +26 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/insider_transactions.py +7 -1
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/screener.py +6 -1
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/insider_transactions.py +5 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/screener.py +6 -1
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain_python.egg-info/PKG-INFO +27 -1
- finbrain_python-0.3.2/src/finbrain_python.egg-info/scm_version.json +8 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_insider_transactions.py +40 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_screener.py +3 -1
- finbrain_python-0.3.1/src/finbrain_python.egg-info/scm_version.json +0 -8
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/.gitattributes +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/.gitignore +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/LICENSE +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/RELEASE.md +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/examples/async_example.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/examples/transactions_plotting_example.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/pyproject.toml +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/setup.cfg +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/__init__.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/__init__.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/client.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/__init__.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/_utils.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/analyst_ratings.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/app_ratings.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/available.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/corporate_lobbying.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/government_contracts.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/house_trades.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/linkedin_data.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/news.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/options.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/patent_filings.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/predictions.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/recent.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/reddit_mentions.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/senate_trades.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/sentiments.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/client.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/__init__.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/_utils.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/analyst_ratings.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/app_ratings.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/available.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/corporate_lobbying.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/government_contracts.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/house_trades.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/linkedin_data.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/news.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/options.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/patent_filings.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/predictions.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/recent.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/reddit_mentions.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/senate_trades.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/sentiments.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/exceptions.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/plotting.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/py.typed +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain_python.egg-info/SOURCES.txt +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain_python.egg-info/dependency_links.txt +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain_python.egg-info/requires.txt +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain_python.egg-info/scm_file_list.json +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain_python.egg-info/top_level.txt +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/__init__.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/conftest.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_analyst_ratings.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_app_ratings.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_async_client.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_available.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_cik_passthrough.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_client.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_corporate_lobbying.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_envelope.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_government_contracts.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_house_trades.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_integration.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_linkedin_data.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_news.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_options.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_patent_filings.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_plotting.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_predictions.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_recent.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_reddit_mentions.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_senate_trades.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_sentiments.py +0 -0
- {finbrain_python-0.3.1 → finbrain_python-0.3.2}/tests/test_utils.py +0 -0
|
@@ -7,7 +7,10 @@ on:
|
|
|
7
7
|
|
|
8
8
|
jobs:
|
|
9
9
|
test:
|
|
10
|
-
|
|
10
|
+
# ubuntu-latest is Ubuntu 26.04, whose runner image has no Python 3.9
|
|
11
|
+
# (end of life October 2025). 3.9 is still supported by this package
|
|
12
|
+
# (requires-python >=3.9), so its job runs on 24.04, which still has it.
|
|
13
|
+
runs-on: ${{ matrix.python == '3.9' && 'ubuntu-24.04' || 'ubuntu-latest' }}
|
|
11
14
|
strategy:
|
|
12
15
|
matrix:
|
|
13
16
|
python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
|
|
@@ -10,7 +10,10 @@ jobs:
|
|
|
10
10
|
# commit with failing checks could still reach PyPI -- and PyPI versions are
|
|
11
11
|
# immutable, so a bad upload cannot be replaced, only superseded.
|
|
12
12
|
test:
|
|
13
|
-
|
|
13
|
+
# ubuntu-latest is Ubuntu 26.04, whose runner image has no Python 3.9
|
|
14
|
+
# (end of life October 2025). 3.9 is still supported by this package
|
|
15
|
+
# (requires-python >=3.9), so its job runs on 24.04, which still has it.
|
|
16
|
+
runs-on: ${{ matrix.python == '3.9' && 'ubuntu-24.04' || 'ubuntu-latest' }}
|
|
14
17
|
strategy:
|
|
15
18
|
matrix:
|
|
16
19
|
python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
|
|
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.2] - 2026-11-28
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Documentation for insider `valueFlag`**: insider rows from `fb.insider_transactions.ticker()` and `fb.screener.insider_trading()` (sync and async) carry the v2 API's `valueFlag`: `null` on normal rows, `price_implausible` when the filer typed the total proceeds into the price field (about 300 rows in the whole archive), so that row's `pricePerShare` and `totalValue` must not be summed. The field already passed through both the raw-dict and DataFrame branches with no SDK code change; docstrings, a README section (with a filtering example and the open-market `Purchase`/`Sale` note) and unit tests now cover it. `totalValue` is shares × price on every other row since the API's November 2026 value repair
|
|
13
|
+
- **Senate pause noted** in the README: Senate rows stop at 2026-10-22 while collection is paused; House continues
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **DataFrame shape**: insider frames gain a `valueFlag` column (it arrives from the API, not from this release). Code that asserts an exact column set needs updating
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- **CI on Python 3.9**: GitHub's `ubuntu-latest` runner moved to Ubuntu 26.04, which has no Python 3.9, so the 3.9 job failed at setup. It now runs on `ubuntu-24.04` (CI and release workflows); the package still supports 3.9
|
|
22
|
+
|
|
8
23
|
## [0.3.1] - 2026-09-07
|
|
9
24
|
|
|
10
25
|
### Added
|
|
@@ -273,6 +288,8 @@ Previous releases...
|
|
|
273
288
|
|
|
274
289
|
Previous releases...
|
|
275
290
|
|
|
291
|
+
[0.3.2]: https://github.com/ahmetsbilgin/finbrain-python/compare/v0.3.1...v0.3.2
|
|
292
|
+
[0.3.1]: https://github.com/ahmetsbilgin/finbrain-python/compare/v0.3.0...v0.3.1
|
|
276
293
|
[0.3.0]: https://github.com/ahmetsbilgin/finbrain-python/compare/v0.2.9...v0.3.0
|
|
277
294
|
[0.2.1]: https://github.com/ahmetsbilgin/finbrain-python/compare/v0.2.0...v0.2.1
|
|
278
295
|
[0.2.0]: https://github.com/ahmetsbilgin/finbrain-python/compare/v0.1.8...v0.2.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: finbrain-python
|
|
3
|
-
Version: 0.3.
|
|
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`,
|
|
@@ -183,6 +183,32 @@ All four fields — `owner`, `amountRaw`, `amountFlag` and `disclosureDate` —
|
|
|
183
183
|
are also present on `fb.screener.congress_house()` and
|
|
184
184
|
`fb.screener.congress_senate()` rows.
|
|
185
185
|
|
|
186
|
+
Senate collection has been paused since 2026-10-22 (the Senate disclosure
|
|
187
|
+
site refuses automated access), so Senate rows stop at that date while it
|
|
188
|
+
is paused; House collection continues.
|
|
189
|
+
|
|
190
|
+
### Insider transaction values (`valueFlag`)
|
|
191
|
+
|
|
192
|
+
Insider rows from `fb.insider_transactions.ticker()` and
|
|
193
|
+
`fb.screener.insider_trading()` carry `valueFlag`:
|
|
194
|
+
|
|
195
|
+
| Field | Meaning |
|
|
196
|
+
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
197
|
+
| `totalValue` | Shares × price on every row (derivative rows: notional at the exercise price) |
|
|
198
|
+
| `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 |
|
|
199
|
+
|
|
200
|
+
Leave flagged rows out of any dollar sum or average:
|
|
201
|
+
|
|
202
|
+
```python
|
|
203
|
+
df = fb.insider_transactions.ticker("AMD", as_dataframe=True)
|
|
204
|
+
clean = df[df["valueFlag"].isna()]
|
|
205
|
+
open_market = clean[clean["transactionType"].isin(["Purchase", "Sale"])]
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Only `Purchase` and `Sale` are open-market trades at the insider's own
|
|
209
|
+
initiative; the other transaction types are awards, option exercises, tax
|
|
210
|
+
withholding, gifts and other transfers.
|
|
211
|
+
|
|
186
212
|
### Company identifier (`cik`)
|
|
187
213
|
|
|
188
214
|
Rows from the four SEC/government datasets — `fb.insider_transactions`,
|
{finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/insider_transactions.py
RENAMED
|
@@ -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
|
|
{finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/insider_transactions.py
RENAMED
|
@@ -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.
|
|
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`,
|
|
@@ -82,6 +82,46 @@ def test_insider_tx_dataframe_ok(client, _activate_responses):
|
|
|
82
82
|
assert df.loc["2024-01-15", "shares"] == 5000
|
|
83
83
|
|
|
84
84
|
|
|
85
|
+
# ─────────── valueFlag passthrough ──────────────────────────────────────
|
|
86
|
+
def test_insider_tx_value_flag_passthrough(client, _activate_responses):
|
|
87
|
+
path = f"insider-trading/{TICKER}"
|
|
88
|
+
payload = wrap_v2({
|
|
89
|
+
"symbol": "AMD",
|
|
90
|
+
"name": "Advanced Micro Devices Inc",
|
|
91
|
+
"transactions": [
|
|
92
|
+
{
|
|
93
|
+
"date": "2017-08-04",
|
|
94
|
+
"insider": "Filer A",
|
|
95
|
+
"transactionType": "Sale",
|
|
96
|
+
"shares": 40000000,
|
|
97
|
+
"pricePerShare": 525600000,
|
|
98
|
+
"totalValue": 21024000000000000,
|
|
99
|
+
"valueFlag": "price_implausible",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"date": "2017-08-03",
|
|
103
|
+
"insider": "Filer B",
|
|
104
|
+
"transactionType": "Purchase",
|
|
105
|
+
"shares": 100,
|
|
106
|
+
"pricePerShare": 13.0,
|
|
107
|
+
"totalValue": 1300,
|
|
108
|
+
"valueFlag": None,
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
})
|
|
112
|
+
stub_json(_activate_responses, "GET", path, payload)
|
|
113
|
+
|
|
114
|
+
raw = client.insider_transactions.ticker(symbol=TICKER)
|
|
115
|
+
assert raw["transactions"][0]["valueFlag"] == "price_implausible"
|
|
116
|
+
assert raw["transactions"][1]["valueFlag"] is None
|
|
117
|
+
|
|
118
|
+
stub_json(_activate_responses, "GET", path, payload)
|
|
119
|
+
df = client.insider_transactions.ticker(symbol=TICKER, as_dataframe=True)
|
|
120
|
+
assert "valueFlag" in df.columns
|
|
121
|
+
clean = df[df["valueFlag"].isna()]
|
|
122
|
+
assert list(clean["insider"]) == ["Filer B"]
|
|
123
|
+
|
|
124
|
+
|
|
85
125
|
# ─────────── error mapping ──────────────────────────────────────────────
|
|
86
126
|
def test_insider_tx_bad_request(client, _activate_responses):
|
|
87
127
|
path = f"insider-trading/{TICKER}"
|
|
@@ -68,13 +68,15 @@ def test_screener_analyst_ratings_dataframe(client, _activate_responses):
|
|
|
68
68
|
# ── insider trading ────────────────────────────────────────────────────
|
|
69
69
|
def test_screener_insider_trading(client, _activate_responses):
|
|
70
70
|
payload = wrap_v2([
|
|
71
|
-
{"symbol": "AAPL", "name": "Apple", "transactionType": "Sale", "shares": 5000
|
|
71
|
+
{"symbol": "AAPL", "name": "Apple", "transactionType": "Sale", "shares": 5000,
|
|
72
|
+
"valueFlag": "price_implausible"},
|
|
72
73
|
])
|
|
73
74
|
stub_json(_activate_responses, "GET", "screener/insider-trading", payload, params={"limit": "5"})
|
|
74
75
|
data = client.screener.insider_trading(limit=5)
|
|
75
76
|
assert isinstance(data, list)
|
|
76
77
|
assert len(data) == 1
|
|
77
78
|
assert data[0]["transactionType"] == "Sale"
|
|
79
|
+
assert data[0]["valueFlag"] == "price_implausible"
|
|
78
80
|
|
|
79
81
|
|
|
80
82
|
def test_screener_insider_trading_dataframe(client, _activate_responses):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/analyst_ratings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/corporate_lobbying.py
RENAMED
|
File without changes
|
{finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/government_contracts.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/patent_filings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/aio/endpoints/reddit_mentions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/corporate_lobbying.py
RENAMED
|
File without changes
|
{finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain/endpoints/government_contracts.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{finbrain_python-0.3.1 → finbrain_python-0.3.2}/src/finbrain_python.egg-info/scm_file_list.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|