finbrain-python 0.2.7__tar.gz → 0.2.9__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.
Files changed (92) hide show
  1. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/CHANGELOG.md +29 -0
  2. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/PKG-INFO +56 -11
  3. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/README.md +55 -10
  4. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/house_trades.py +15 -4
  5. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/screener.py +10 -4
  6. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/senate_trades.py +15 -4
  7. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/house_trades.py +28 -9
  8. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/screener.py +10 -4
  9. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/senate_trades.py +27 -9
  10. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain_python.egg-info/PKG-INFO +56 -11
  11. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain_python.egg-info/SOURCES.txt +1 -0
  12. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain_python.egg-info/scm_file_list.json +60 -59
  13. finbrain_python-0.2.9/src/finbrain_python.egg-info/scm_version.json +8 -0
  14. finbrain_python-0.2.9/tests/test_cik_passthrough.py +160 -0
  15. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_house_trades.py +26 -3
  16. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_integration.py +28 -8
  17. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_screener.py +18 -6
  18. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_senate_trades.py +25 -4
  19. finbrain_python-0.2.7/src/finbrain_python.egg-info/scm_version.json +0 -8
  20. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/.gitattributes +0 -0
  21. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/.github/workflows/ci.yml +0 -0
  22. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/.github/workflows/release.yml +0 -0
  23. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/.gitignore +0 -0
  24. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/LICENSE +0 -0
  25. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/RELEASE.md +0 -0
  26. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/examples/async_example.py +0 -0
  27. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/examples/transactions_plotting_example.py +0 -0
  28. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/pyproject.toml +0 -0
  29. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/setup.cfg +0 -0
  30. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/__init__.py +0 -0
  31. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/__init__.py +0 -0
  32. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/client.py +0 -0
  33. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/__init__.py +0 -0
  34. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/_utils.py +0 -0
  35. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/analyst_ratings.py +0 -0
  36. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/app_ratings.py +0 -0
  37. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/available.py +0 -0
  38. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/corporate_lobbying.py +0 -0
  39. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/government_contracts.py +0 -0
  40. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/insider_transactions.py +0 -0
  41. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/linkedin_data.py +0 -0
  42. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/news.py +0 -0
  43. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/options.py +0 -0
  44. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/patent_filings.py +0 -0
  45. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/predictions.py +0 -0
  46. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/recent.py +0 -0
  47. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/reddit_mentions.py +0 -0
  48. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/aio/endpoints/sentiments.py +0 -0
  49. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/client.py +0 -0
  50. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/__init__.py +0 -0
  51. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/_utils.py +0 -0
  52. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/analyst_ratings.py +0 -0
  53. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/app_ratings.py +0 -0
  54. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/available.py +0 -0
  55. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/corporate_lobbying.py +0 -0
  56. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/government_contracts.py +0 -0
  57. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/insider_transactions.py +0 -0
  58. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/linkedin_data.py +0 -0
  59. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/news.py +0 -0
  60. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/options.py +0 -0
  61. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/patent_filings.py +0 -0
  62. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/predictions.py +0 -0
  63. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/recent.py +0 -0
  64. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/reddit_mentions.py +0 -0
  65. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/endpoints/sentiments.py +0 -0
  66. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/exceptions.py +0 -0
  67. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/plotting.py +0 -0
  68. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain/py.typed +0 -0
  69. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain_python.egg-info/dependency_links.txt +0 -0
  70. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain_python.egg-info/requires.txt +0 -0
  71. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/src/finbrain_python.egg-info/top_level.txt +0 -0
  72. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/__init__.py +0 -0
  73. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/conftest.py +0 -0
  74. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_analyst_ratings.py +0 -0
  75. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_app_ratings.py +0 -0
  76. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_async_client.py +0 -0
  77. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_available.py +0 -0
  78. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_client.py +0 -0
  79. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_corporate_lobbying.py +0 -0
  80. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_envelope.py +0 -0
  81. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_government_contracts.py +0 -0
  82. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_insider_transactions.py +0 -0
  83. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_linkedin_data.py +0 -0
  84. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_news.py +0 -0
  85. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_options.py +0 -0
  86. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_patent_filings.py +0 -0
  87. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_plotting.py +0 -0
  88. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_predictions.py +0 -0
  89. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_recent.py +0 -0
  90. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_reddit_mentions.py +0 -0
  91. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_sentiments.py +0 -0
  92. {finbrain_python-0.2.7 → finbrain_python-0.2.9}/tests/test_utils.py +0 -0
@@ -5,6 +5,35 @@ 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.2.9] - 2026-08-14
9
+
10
+ ### Added
11
+
12
+ - **`cik` field on four datasets**: rows from `fb.insider_transactions.ticker()`, `fb.government_contracts.ticker()`, `fb.corporate_lobbying.ticker()`, and `fb.patent_filings.ticker()` (and their async equivalents) now carry `cik` — the SEC Central Index Key of the company as of that record, as a 10-digit zero-padded **string** (`"0000320193"`); `null` where the record has no entity resolution. The field is emitted by the v2 API and passes through both the raw-dict and DataFrame branches with no SDK code changes; tests pin the passthrough (including that the DataFrame column stays string-typed — leading zeros are data)
13
+ - **Documentation**: README "Company identifier (`cik`)" section covering the field, its string typing, the null case, and its use for joining to SEC-keyed datasets
14
+
15
+ ### Changed
16
+
17
+ - **DataFrame shape**: `as_dataframe=True` frames for the four datasets above gain a `cik` column. Code that asserts an exact column set needs updating
18
+
19
+ ## [0.2.8] - 2026-07-28
20
+
21
+ ### Added
22
+
23
+ - **Congressional account owner**: House and Senate trade rows now carry `owner` — the beneficial owner of the traded account: `SELF`, `SP` (spouse), `DC` (dependent child), `JT` (joint), or an account code. Senate filings that leave the owner column blank report `UNKNOWN`; House filings that leave it blank report `SELF`, per the House PTR-form instructions. Available on `fb.house_trades.ticker()`, `fb.senate_trades.ticker()`, their async equivalents, and the `fb.screener.congress_house()` / `fb.screener.congress_senate()` rows
24
+ - **Congressional amount normalization metadata**: ticker-level trade rows also carry `amountRaw` and `amountFlag`. `amount` is now normalized to the ten statutory STOCK Act brackets whenever the filed string is an unambiguous formatting variant of one (open-ended categories like `Over $1,000,000` are kept as filed); on normalized rows `amountRaw` preserves the string as originally filed. When the filed amount could not be safely normalized, `amount` keeps the raw filed string (or `Unknown` when the filing had no usable amount) and `amountFlag` is `review` or `ambiguous`; on all other rows both fields are `null`
25
+ - **Documentation**: README "Congressional trade fields" section covering the new fields, and expanded docstrings on the sync/async ticker and screener methods
26
+ - **Tests**: Unit tests assert the new fields pass through in both the raw-dict and DataFrame branches, including the null cases; integration tests assert the keys are present on live responses
27
+
28
+ ### Changed
29
+
30
+ - **DataFrame shape**: `fb.house_trades.ticker(..., as_dataframe=True)` and `fb.senate_trades.ticker(..., as_dataframe=True)` gain `owner`, `amountRaw` and `amountFlag` columns; the congress screener frames gain an `owner` column. Code that asserts an exact column set (`set(df.columns) == {...}`) or compares frames for equality needs updating
31
+
32
+ ### Notes
33
+
34
+ - `owner` and `disclosureDate` are nullable, but nulls are rare in practice: the pipeline's key-hygiene reconcile upload backfilled both fields onto historical rows in place. Code should still handle missing values with `pandas.isna()` — the `.dropna()` caveat from 0.2.6 applies to any row a reconcile could not fill
35
+ - The raw-dict branch is purely additive — no call-site changes are required to receive the new fields
36
+
8
37
  ## [0.2.7] - 2026-07-24
9
38
 
10
39
  ### Changed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: finbrain-python
3
- Version: 0.2.7
3
+ Version: 0.2.9
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
@@ -84,7 +84,8 @@ fb.analyst_ratings.ticker("AMZN",
84
84
  as_dataframe=True)
85
85
 
86
86
  # ---------- house trades ----------
87
- # Rows include `disclosureDate` alongside the transaction `date`.
87
+ # Rows include `disclosureDate`, `owner`, `amountRaw` and `amountFlag`
88
+ # alongside the transaction `date` — see "Congressional trade fields" below.
88
89
  fb.house_trades.ticker("AMZN",
89
90
  date_from="2025-01-01",
90
91
  date_to="2025-06-30",
@@ -156,7 +157,7 @@ fb.screener.insider_trading(limit=50)
156
157
  fb.screener.reddit_mentions(limit=100, as_dataframe=True)
157
158
  fb.screener.government_contracts(limit=100, as_dataframe=True)
158
159
  fb.screener.patent_filings(limit=100, as_dataframe=True)
159
- fb.screener.congress_house(limit=50) # rows carry `disclosureDate`
160
+ fb.screener.congress_house(limit=50) # rows carry `disclosureDate` and `owner`
160
161
  fb.screener.congress_senate(limit=50)
161
162
 
162
163
  # ---------- recent data ----------
@@ -164,7 +165,7 @@ fb.recent.news(limit=100, as_dataframe=True)
164
165
  fb.recent.analyst_ratings(limit=50)
165
166
  ```
166
167
 
167
- ### Congressional trade dates
168
+ ### Congressional trade fields
168
169
 
169
170
  House and Senate trade rows carry **two** dates, and the gap between them is
170
171
  the reporting lag — often weeks:
@@ -174,13 +175,51 @@ the reporting lag — often weeks:
174
175
  | `date` | Transaction date — when the member actually bought or sold |
175
176
  | `disclosureDate` | Public disclosure date — when the periodic transaction report ran |
176
177
 
177
- `disclosureDate` is `null` on historical rows collected before the field was
178
- captured upstream. With `as_dataframe=True`, `date` is the **index** and
179
- `disclosureDate` is a column whose missing values read as `None` or `NaN`
180
- depending on your pandas version — test them with `pandas.isna()` rather than
181
- `is None`. Note that `.dropna()` on such a frame will now discard every
182
- historical row. The same field is present on `fb.screener.congress_house()`
183
- and `fb.screener.congress_senate()` rows.
178
+ Rows also identify **whose account** traded and how the filed amount was
179
+ normalized:
180
+
181
+ | Field | Meaning |
182
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
183
+ | `owner` | Beneficial owner of the account: `SELF`, `SP` (spouse), `DC` (dependent child), `JT` (joint), or an account code |
184
+ | `amountRaw` | The amount string as originally filed — set only when `amount` was rewritten to the canonical STOCK Act bracket, `null` otherwise |
185
+ | `amountFlag` | `null` on clean rows; `review` or `ambiguous` when the filed amount could not be safely normalized (then `amount` keeps the raw string as filed) |
186
+
187
+ `amount` is normalized to the ten statutory STOCK Act brackets (e.g.
188
+ `"$1,001 - $15,000"`) whenever the filed string is an unambiguous formatting
189
+ variant of one; open-ended filing categories like `"Over $1,000,000"` are
190
+ kept as filed. A filing with no usable amount at all reports `amount` as
191
+ `"Unknown"` with `amountFlag` = `review`. Senate filings that leave the owner
192
+ column blank report `owner` as `UNKNOWN`; House filings that leave it blank
193
+ report `SELF`, per the House PTR-form instructions.
194
+
195
+ `disclosureDate` and `owner` are nullable. Historical rows were backfilled
196
+ in place by the pipeline's reconcile upload, so nulls are rare — but code
197
+ should still handle them. With `as_dataframe=True`, `date` is the **index**
198
+ and the other fields are columns whose missing values read as `None` or
199
+ `NaN` depending on your pandas version — test them with `pandas.isna()`
200
+ rather than `is None`. Note that `.dropna()` on such a frame will discard
201
+ every row with any missing field — use `.dropna(subset=[...])`.
202
+ `disclosureDate` and `owner` are also present on
203
+ `fb.screener.congress_house()` and `fb.screener.congress_senate()` rows.
204
+
205
+ ### Company identifier (`cik`)
206
+
207
+ Rows from the four SEC/government datasets — `fb.insider_transactions`,
208
+ `fb.government_contracts`, `fb.corporate_lobbying`, and `fb.patent_filings`
209
+ (ticker endpoints and their async equivalents) — carry `cik`, the SEC
210
+ **Central Index Key** of the company as of that record:
211
+
212
+ | Field | Meaning |
213
+ | ----- | ------------------------------------------------------------------------------------------- |
214
+ | `cik` | SEC Central Index Key of the company, as a 10-digit zero-padded string (`"0000320193"`) |
215
+
216
+ `cik` is a **string, not a number** — the leading zeros are part of the
217
+ identifier, so keep the column as text when loading into other tools. Rows
218
+ without an entity resolution (for example, records of companies absent from
219
+ the SEC's public company file) carry `null`; with `as_dataframe=True` the
220
+ column stays object-typed and missing values read as `None`. Use it to join
221
+ FinBrain rows to SEC-keyed datasets (EDGAR filings, financial statements,
222
+ 13F holdings) or to your own security master.
184
223
 
185
224
  `date_from` / `date_to` bound the **transaction** date, not the disclosure
186
225
  date — a trade executed inside the window is returned even if it was disclosed
@@ -193,6 +232,12 @@ lag_days = [
193
232
  for t in trades
194
233
  if t["disclosureDate"]
195
234
  ]
235
+
236
+ # Only the member's own trades, skipping flagged amounts
237
+ own = [
238
+ t for t in trades
239
+ if t["owner"] == "SELF" and t["amountFlag"] is None
240
+ ]
196
241
  ```
197
242
 
198
243
  ## ⚡ Async Usage
@@ -56,7 +56,8 @@ fb.analyst_ratings.ticker("AMZN",
56
56
  as_dataframe=True)
57
57
 
58
58
  # ---------- house trades ----------
59
- # Rows include `disclosureDate` alongside the transaction `date`.
59
+ # Rows include `disclosureDate`, `owner`, `amountRaw` and `amountFlag`
60
+ # alongside the transaction `date` — see "Congressional trade fields" below.
60
61
  fb.house_trades.ticker("AMZN",
61
62
  date_from="2025-01-01",
62
63
  date_to="2025-06-30",
@@ -128,7 +129,7 @@ fb.screener.insider_trading(limit=50)
128
129
  fb.screener.reddit_mentions(limit=100, as_dataframe=True)
129
130
  fb.screener.government_contracts(limit=100, as_dataframe=True)
130
131
  fb.screener.patent_filings(limit=100, as_dataframe=True)
131
- fb.screener.congress_house(limit=50) # rows carry `disclosureDate`
132
+ fb.screener.congress_house(limit=50) # rows carry `disclosureDate` and `owner`
132
133
  fb.screener.congress_senate(limit=50)
133
134
 
134
135
  # ---------- recent data ----------
@@ -136,7 +137,7 @@ fb.recent.news(limit=100, as_dataframe=True)
136
137
  fb.recent.analyst_ratings(limit=50)
137
138
  ```
138
139
 
139
- ### Congressional trade dates
140
+ ### Congressional trade fields
140
141
 
141
142
  House and Senate trade rows carry **two** dates, and the gap between them is
142
143
  the reporting lag — often weeks:
@@ -146,13 +147,51 @@ the reporting lag — often weeks:
146
147
  | `date` | Transaction date — when the member actually bought or sold |
147
148
  | `disclosureDate` | Public disclosure date — when the periodic transaction report ran |
148
149
 
149
- `disclosureDate` is `null` on historical rows collected before the field was
150
- captured upstream. With `as_dataframe=True`, `date` is the **index** and
151
- `disclosureDate` is a column whose missing values read as `None` or `NaN`
152
- depending on your pandas version — test them with `pandas.isna()` rather than
153
- `is None`. Note that `.dropna()` on such a frame will now discard every
154
- historical row. The same field is present on `fb.screener.congress_house()`
155
- and `fb.screener.congress_senate()` rows.
150
+ Rows also identify **whose account** traded and how the filed amount was
151
+ normalized:
152
+
153
+ | Field | Meaning |
154
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
155
+ | `owner` | Beneficial owner of the account: `SELF`, `SP` (spouse), `DC` (dependent child), `JT` (joint), or an account code |
156
+ | `amountRaw` | The amount string as originally filed — set only when `amount` was rewritten to the canonical STOCK Act bracket, `null` otherwise |
157
+ | `amountFlag` | `null` on clean rows; `review` or `ambiguous` when the filed amount could not be safely normalized (then `amount` keeps the raw string as filed) |
158
+
159
+ `amount` is normalized to the ten statutory STOCK Act brackets (e.g.
160
+ `"$1,001 - $15,000"`) whenever the filed string is an unambiguous formatting
161
+ variant of one; open-ended filing categories like `"Over $1,000,000"` are
162
+ kept as filed. A filing with no usable amount at all reports `amount` as
163
+ `"Unknown"` with `amountFlag` = `review`. Senate filings that leave the owner
164
+ column blank report `owner` as `UNKNOWN`; House filings that leave it blank
165
+ report `SELF`, per the House PTR-form instructions.
166
+
167
+ `disclosureDate` and `owner` are nullable. Historical rows were backfilled
168
+ in place by the pipeline's reconcile upload, so nulls are rare — but code
169
+ should still handle them. With `as_dataframe=True`, `date` is the **index**
170
+ and the other fields are columns whose missing values read as `None` or
171
+ `NaN` depending on your pandas version — test them with `pandas.isna()`
172
+ rather than `is None`. Note that `.dropna()` on such a frame will discard
173
+ every row with any missing field — use `.dropna(subset=[...])`.
174
+ `disclosureDate` and `owner` are also present on
175
+ `fb.screener.congress_house()` and `fb.screener.congress_senate()` rows.
176
+
177
+ ### Company identifier (`cik`)
178
+
179
+ Rows from the four SEC/government datasets — `fb.insider_transactions`,
180
+ `fb.government_contracts`, `fb.corporate_lobbying`, and `fb.patent_filings`
181
+ (ticker endpoints and their async equivalents) — carry `cik`, the SEC
182
+ **Central Index Key** of the company as of that record:
183
+
184
+ | Field | Meaning |
185
+ | ----- | ------------------------------------------------------------------------------------------- |
186
+ | `cik` | SEC Central Index Key of the company, as a 10-digit zero-padded string (`"0000320193"`) |
187
+
188
+ `cik` is a **string, not a number** — the leading zeros are part of the
189
+ identifier, so keep the column as text when loading into other tools. Rows
190
+ without an entity resolution (for example, records of companies absent from
191
+ the SEC's public company file) carry `null`; with `as_dataframe=True` the
192
+ column stays object-typed and missing values read as `None`. Use it to join
193
+ FinBrain rows to SEC-keyed datasets (EDGAR filings, financial statements,
194
+ 13F holdings) or to your own security master.
156
195
 
157
196
  `date_from` / `date_to` bound the **transaction** date, not the disclosure
158
197
  date — a trade executed inside the window is returned even if it was disclosed
@@ -165,6 +204,12 @@ lag_days = [
165
204
  for t in trades
166
205
  if t["disclosureDate"]
167
206
  ]
207
+
208
+ # Only the member's own trades, skipping flagged amounts
209
+ own = [
210
+ t for t in trades
211
+ if t["owner"] == "SELF" and t["amountFlag"] is None
212
+ ]
168
213
  ```
169
214
 
170
215
  ## ⚡ Async Usage
@@ -28,10 +28,21 @@ class AsyncHouseTradesAPI:
28
28
  Fetch House-member trades for a symbol (async).
29
29
 
30
30
  Each row in ``trades`` carries ``date`` (the transaction date),
31
- ``politician``, ``transactionType``, ``amount`` and
32
- ``disclosureDate`` — the date the trade was publicly disclosed in the
33
- member's periodic transaction report. ``disclosureDate`` is ``None``
34
- for historical rows collected before the field was captured (``NaN``
31
+ ``politician``, ``transactionType``, ``amount``, ``owner``,
32
+ ``amountRaw``, ``amountFlag`` and ``disclosureDate`` — the date the
33
+ trade was publicly disclosed in the member's periodic transaction
34
+ report.
35
+
36
+ ``owner`` is the beneficial owner of the traded account: ``"SELF"``,
37
+ ``"SP"`` (spouse), ``"DC"`` (dependent child), ``"JT"`` (joint), or
38
+ an account code; House filings that leave the owner column blank
39
+ report as ``"SELF"``. ``amountRaw`` preserves the originally filed
40
+ amount string on rows whose ``amount`` was normalized to a STOCK Act
41
+ bracket; ``amountFlag`` is ``"review"`` or ``"ambiguous"`` when the
42
+ amount could not be safely normalized (``None`` otherwise).
43
+
44
+ ``disclosureDate`` and ``owner`` are nullable; historical rows were
45
+ backfilled upstream, so missing values are rare but possible (``NaN``
35
46
  in the DataFrame branch on newer pandas — use ``pandas.isna``).
36
47
 
37
48
  ``date_from``/``date_to`` bound the transaction date, not the
@@ -111,8 +111,11 @@ class AsyncScreenerAPI:
111
111
  Screen House trades across all tickers.
112
112
 
113
113
  Rows carry ``symbol``, ``name``, ``date``, ``politician``,
114
- ``transactionType``, ``amount`` and ``disclosureDate`` (the public
115
- disclosure date, ``None`` on historical rows).
114
+ ``transactionType``, ``amount``, ``owner`` (beneficial owner of the
115
+ account: ``"SELF"``, ``"SP"``, ``"DC"``, ``"JT"``, or an account
116
+ code) and ``disclosureDate`` (the public disclosure date). ``owner``
117
+ and ``disclosureDate`` are nullable, though rare — historical rows
118
+ were backfilled upstream.
116
119
  """
117
120
  params = self._build_params(limit=limit)
118
121
  return await self._get("screener/congress/house", params, as_dataframe)
@@ -129,8 +132,11 @@ class AsyncScreenerAPI:
129
132
  Screen Senate trades across all tickers.
130
133
 
131
134
  Rows carry ``symbol``, ``name``, ``date``, ``politician``,
132
- ``transactionType``, ``amount`` and ``disclosureDate`` (the public
133
- disclosure date, ``None`` on historical rows).
135
+ ``transactionType``, ``amount``, ``owner`` (beneficial owner of the
136
+ account: ``"SELF"``, ``"SP"``, ``"DC"``, ``"JT"``, an account code,
137
+ or ``"UNKNOWN"`` for blank Senate filings) and ``disclosureDate``
138
+ (the public disclosure date). ``owner`` and ``disclosureDate`` are
139
+ nullable, though rare — historical rows were backfilled upstream.
134
140
  """
135
141
  params = self._build_params(limit=limit)
136
142
  return await self._get("screener/congress/senate", params, as_dataframe)
@@ -28,10 +28,21 @@ class AsyncSenateTradesAPI:
28
28
  Fetch Senate-member trades for a symbol (async).
29
29
 
30
30
  Each row in ``trades`` carries ``date`` (the transaction date),
31
- ``politician``, ``transactionType``, ``amount`` and
32
- ``disclosureDate`` — the date the trade was publicly disclosed in the
33
- member's periodic transaction report. ``disclosureDate`` is ``None``
34
- for historical rows collected before the field was captured (``NaN``
31
+ ``politician``, ``transactionType``, ``amount``, ``owner``,
32
+ ``amountRaw``, ``amountFlag`` and ``disclosureDate`` — the date the
33
+ trade was publicly disclosed in the member's periodic transaction
34
+ report.
35
+
36
+ ``owner`` is the beneficial owner of the traded account: ``"SELF"``,
37
+ ``"SP"`` (spouse), ``"DC"`` (dependent child), ``"JT"`` (joint), an
38
+ account code, or ``"UNKNOWN"`` when the Senate filing left the owner
39
+ column blank. ``amountRaw`` preserves the originally filed amount
40
+ string on rows whose ``amount`` was normalized to a STOCK Act
41
+ bracket; ``amountFlag`` is ``"review"`` or ``"ambiguous"`` when the
42
+ amount could not be safely normalized (``None`` otherwise).
43
+
44
+ ``disclosureDate`` and ``owner`` are nullable; historical rows were
45
+ backfilled upstream, so missing values are rare but possible (``NaN``
35
46
  in the DataFrame branch on newer pandas — use ``pandas.isna``).
36
47
 
37
48
  ``date_from``/``date_to`` bound the transaction date, not the
@@ -51,14 +51,32 @@ class HouseTradesAPI:
51
51
  dict | pandas.DataFrame
52
52
  The raw dict has a ``trades`` list whose rows carry ``date``
53
53
  (the transaction date), ``politician``, ``transactionType``,
54
- ``amount`` and ``disclosureDate`` — the date the trade was
55
- publicly disclosed in the member's periodic transaction report.
56
- The gap between the two dates is the reporting lag.
57
-
58
- ``disclosureDate`` is ``None`` for historical rows collected
59
- before the field was captured upstream. In the DataFrame branch
60
- ``date`` becomes the index and ``disclosureDate`` is a column
61
- whose missing values read as ``None`` or ``NaN`` depending on the
54
+ ``amount``, ``owner``, ``amountRaw``, ``amountFlag`` and
55
+ ``disclosureDate`` — the date the trade was publicly disclosed
56
+ in the member's periodic transaction report. The gap between the
57
+ two dates is the reporting lag.
58
+
59
+ ``owner`` is the beneficial owner of the traded account:
60
+ ``"SELF"``, ``"SP"`` (spouse), ``"DC"`` (dependent child),
61
+ ``"JT"`` (joint), or an account code. House filings that leave
62
+ the owner column blank report as ``"SELF"``, per the House
63
+ instructions for the PTR form.
64
+
65
+ ``amount`` is normalized to the statutory STOCK Act bracket
66
+ (e.g. ``"$1,001 - $15,000"``) whenever the filed string is an
67
+ unambiguous formatting variant of one. On rows that were
68
+ normalized, ``amountRaw`` preserves the string as originally
69
+ filed. When the filed amount could not be safely normalized,
70
+ ``amount`` keeps the raw filed string (or ``"Unknown"`` when the
71
+ filing had no usable amount) and ``amountFlag`` is ``"review"``
72
+ or ``"ambiguous"``; on all other rows ``amountRaw`` and
73
+ ``amountFlag`` are ``None``.
74
+
75
+ ``disclosureDate`` and ``owner`` are nullable; historical rows
76
+ were backfilled in place by the upstream pipeline, so missing
77
+ values are rare but possible. In the DataFrame branch ``date``
78
+ becomes the index and the remaining fields are columns whose
79
+ missing values read as ``None`` or ``NaN`` depending on the
62
80
  pandas version — test them with :func:`pandas.isna`.
63
81
 
64
82
  Notes
@@ -71,7 +89,8 @@ class HouseTradesAPI:
71
89
 
72
90
  {"date": "2026-06-15", "politician": "Jane Doe",
73
91
  "transactionType": "Purchase", "amount": "$1,001 - $15,000",
74
- "disclosureDate": "2026-07-01"}
92
+ "owner": "JT", "amountRaw": "$1,001 - $15,000 *",
93
+ "amountFlag": None, "disclosureDate": "2026-07-01"}
75
94
 
76
95
  """
77
96
  params: Dict[str, str] = {}
@@ -116,8 +116,11 @@ class ScreenerAPI:
116
116
  Screen House trades across all tickers.
117
117
 
118
118
  Rows carry ``symbol``, ``name``, ``date``, ``politician``,
119
- ``transactionType``, ``amount`` and ``disclosureDate`` (the public
120
- disclosure date, ``None`` on historical rows).
119
+ ``transactionType``, ``amount``, ``owner`` (beneficial owner of the
120
+ account: ``"SELF"``, ``"SP"``, ``"DC"``, ``"JT"``, or an account
121
+ code) and ``disclosureDate`` (the public disclosure date). ``owner``
122
+ and ``disclosureDate`` are nullable, though rare — historical rows
123
+ were backfilled upstream.
121
124
  """
122
125
  params = self._build_params(limit=limit)
123
126
  return self._get("screener/congress/house", params, as_dataframe)
@@ -134,8 +137,11 @@ class ScreenerAPI:
134
137
  Screen Senate trades across all tickers.
135
138
 
136
139
  Rows carry ``symbol``, ``name``, ``date``, ``politician``,
137
- ``transactionType``, ``amount`` and ``disclosureDate`` (the public
138
- disclosure date, ``None`` on historical rows).
140
+ ``transactionType``, ``amount``, ``owner`` (beneficial owner of the
141
+ account: ``"SELF"``, ``"SP"``, ``"DC"``, ``"JT"``, an account code,
142
+ or ``"UNKNOWN"`` for blank Senate filings) and ``disclosureDate``
143
+ (the public disclosure date). ``owner`` and ``disclosureDate`` are
144
+ nullable, though rare — historical rows were backfilled upstream.
139
145
  """
140
146
  params = self._build_params(limit=limit)
141
147
  return self._get("screener/congress/senate", params, as_dataframe)
@@ -51,14 +51,31 @@ class SenateTradesAPI:
51
51
  dict | pandas.DataFrame
52
52
  The raw dict has a ``trades`` list whose rows carry ``date``
53
53
  (the transaction date), ``politician``, ``transactionType``,
54
- ``amount`` and ``disclosureDate`` — the date the trade was
55
- publicly disclosed in the member's periodic transaction report.
56
- The gap between the two dates is the reporting lag.
57
-
58
- ``disclosureDate`` is ``None`` for historical rows collected
59
- before the field was captured upstream. In the DataFrame branch
60
- ``date`` becomes the index and ``disclosureDate`` is a column
61
- whose missing values read as ``None`` or ``NaN`` depending on the
54
+ ``amount``, ``owner``, ``amountRaw``, ``amountFlag`` and
55
+ ``disclosureDate`` — the date the trade was publicly disclosed
56
+ in the member's periodic transaction report. The gap between the
57
+ two dates is the reporting lag.
58
+
59
+ ``owner`` is the beneficial owner of the traded account:
60
+ ``"SELF"``, ``"SP"`` (spouse), ``"DC"`` (dependent child),
61
+ ``"JT"`` (joint), an account code, or ``"UNKNOWN"`` when the
62
+ Senate filing left the owner column blank.
63
+
64
+ ``amount`` is normalized to the statutory STOCK Act bracket
65
+ (e.g. ``"$1,001 - $15,000"``) whenever the filed string is an
66
+ unambiguous formatting variant of one. On rows that were
67
+ normalized, ``amountRaw`` preserves the string as originally
68
+ filed. When the filed amount could not be safely normalized,
69
+ ``amount`` keeps the raw filed string (or ``"Unknown"`` when the
70
+ filing had no usable amount) and ``amountFlag`` is ``"review"``
71
+ or ``"ambiguous"``; on all other rows ``amountRaw`` and
72
+ ``amountFlag`` are ``None``.
73
+
74
+ ``disclosureDate`` and ``owner`` are nullable; historical rows
75
+ were backfilled in place by the upstream pipeline, so missing
76
+ values are rare but possible. In the DataFrame branch ``date``
77
+ becomes the index and the remaining fields are columns whose
78
+ missing values read as ``None`` or ``NaN`` depending on the
62
79
  pandas version — test them with :func:`pandas.isna`.
63
80
 
64
81
  Notes
@@ -71,7 +88,8 @@ class SenateTradesAPI:
71
88
 
72
89
  {"date": "2026-06-10", "politician": "Jane Doe",
73
90
  "transactionType": "Purchase", "amount": "$1,001 - $15,000",
74
- "disclosureDate": "2026-06-25"}
91
+ "owner": "SP", "amountRaw": "$1,001-$15,000",
92
+ "amountFlag": None, "disclosureDate": "2026-06-25"}
75
93
 
76
94
  """
77
95
  params: Dict[str, str] = {}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: finbrain-python
3
- Version: 0.2.7
3
+ Version: 0.2.9
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
@@ -84,7 +84,8 @@ fb.analyst_ratings.ticker("AMZN",
84
84
  as_dataframe=True)
85
85
 
86
86
  # ---------- house trades ----------
87
- # Rows include `disclosureDate` alongside the transaction `date`.
87
+ # Rows include `disclosureDate`, `owner`, `amountRaw` and `amountFlag`
88
+ # alongside the transaction `date` — see "Congressional trade fields" below.
88
89
  fb.house_trades.ticker("AMZN",
89
90
  date_from="2025-01-01",
90
91
  date_to="2025-06-30",
@@ -156,7 +157,7 @@ fb.screener.insider_trading(limit=50)
156
157
  fb.screener.reddit_mentions(limit=100, as_dataframe=True)
157
158
  fb.screener.government_contracts(limit=100, as_dataframe=True)
158
159
  fb.screener.patent_filings(limit=100, as_dataframe=True)
159
- fb.screener.congress_house(limit=50) # rows carry `disclosureDate`
160
+ fb.screener.congress_house(limit=50) # rows carry `disclosureDate` and `owner`
160
161
  fb.screener.congress_senate(limit=50)
161
162
 
162
163
  # ---------- recent data ----------
@@ -164,7 +165,7 @@ fb.recent.news(limit=100, as_dataframe=True)
164
165
  fb.recent.analyst_ratings(limit=50)
165
166
  ```
166
167
 
167
- ### Congressional trade dates
168
+ ### Congressional trade fields
168
169
 
169
170
  House and Senate trade rows carry **two** dates, and the gap between them is
170
171
  the reporting lag — often weeks:
@@ -174,13 +175,51 @@ the reporting lag — often weeks:
174
175
  | `date` | Transaction date — when the member actually bought or sold |
175
176
  | `disclosureDate` | Public disclosure date — when the periodic transaction report ran |
176
177
 
177
- `disclosureDate` is `null` on historical rows collected before the field was
178
- captured upstream. With `as_dataframe=True`, `date` is the **index** and
179
- `disclosureDate` is a column whose missing values read as `None` or `NaN`
180
- depending on your pandas version — test them with `pandas.isna()` rather than
181
- `is None`. Note that `.dropna()` on such a frame will now discard every
182
- historical row. The same field is present on `fb.screener.congress_house()`
183
- and `fb.screener.congress_senate()` rows.
178
+ Rows also identify **whose account** traded and how the filed amount was
179
+ normalized:
180
+
181
+ | Field | Meaning |
182
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
183
+ | `owner` | Beneficial owner of the account: `SELF`, `SP` (spouse), `DC` (dependent child), `JT` (joint), or an account code |
184
+ | `amountRaw` | The amount string as originally filed — set only when `amount` was rewritten to the canonical STOCK Act bracket, `null` otherwise |
185
+ | `amountFlag` | `null` on clean rows; `review` or `ambiguous` when the filed amount could not be safely normalized (then `amount` keeps the raw string as filed) |
186
+
187
+ `amount` is normalized to the ten statutory STOCK Act brackets (e.g.
188
+ `"$1,001 - $15,000"`) whenever the filed string is an unambiguous formatting
189
+ variant of one; open-ended filing categories like `"Over $1,000,000"` are
190
+ kept as filed. A filing with no usable amount at all reports `amount` as
191
+ `"Unknown"` with `amountFlag` = `review`. Senate filings that leave the owner
192
+ column blank report `owner` as `UNKNOWN`; House filings that leave it blank
193
+ report `SELF`, per the House PTR-form instructions.
194
+
195
+ `disclosureDate` and `owner` are nullable. Historical rows were backfilled
196
+ in place by the pipeline's reconcile upload, so nulls are rare — but code
197
+ should still handle them. With `as_dataframe=True`, `date` is the **index**
198
+ and the other fields are columns whose missing values read as `None` or
199
+ `NaN` depending on your pandas version — test them with `pandas.isna()`
200
+ rather than `is None`. Note that `.dropna()` on such a frame will discard
201
+ every row with any missing field — use `.dropna(subset=[...])`.
202
+ `disclosureDate` and `owner` are also present on
203
+ `fb.screener.congress_house()` and `fb.screener.congress_senate()` rows.
204
+
205
+ ### Company identifier (`cik`)
206
+
207
+ Rows from the four SEC/government datasets — `fb.insider_transactions`,
208
+ `fb.government_contracts`, `fb.corporate_lobbying`, and `fb.patent_filings`
209
+ (ticker endpoints and their async equivalents) — carry `cik`, the SEC
210
+ **Central Index Key** of the company as of that record:
211
+
212
+ | Field | Meaning |
213
+ | ----- | ------------------------------------------------------------------------------------------- |
214
+ | `cik` | SEC Central Index Key of the company, as a 10-digit zero-padded string (`"0000320193"`) |
215
+
216
+ `cik` is a **string, not a number** — the leading zeros are part of the
217
+ identifier, so keep the column as text when loading into other tools. Rows
218
+ without an entity resolution (for example, records of companies absent from
219
+ the SEC's public company file) carry `null`; with `as_dataframe=True` the
220
+ column stays object-typed and missing values read as `None`. Use it to join
221
+ FinBrain rows to SEC-keyed datasets (EDGAR filings, financial statements,
222
+ 13F holdings) or to your own security master.
184
223
 
185
224
  `date_from` / `date_to` bound the **transaction** date, not the disclosure
186
225
  date — a trade executed inside the window is returned even if it was disclosed
@@ -193,6 +232,12 @@ lag_days = [
193
232
  for t in trades
194
233
  if t["disclosureDate"]
195
234
  ]
235
+
236
+ # Only the member's own trades, skipping flagged amounts
237
+ own = [
238
+ t for t in trades
239
+ if t["owner"] == "SELF" and t["amountFlag"] is None
240
+ ]
196
241
  ```
197
242
 
198
243
  ## ⚡ Async Usage
@@ -67,6 +67,7 @@ tests/test_analyst_ratings.py
67
67
  tests/test_app_ratings.py
68
68
  tests/test_async_client.py
69
69
  tests/test_available.py
70
+ tests/test_cik_passthrough.py
70
71
  tests/test_client.py
71
72
  tests/test_corporate_lobbying.py
72
73
  tests/test_envelope.py