secfeed 0.1.2__tar.gz → 0.1.4__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.
secfeed-0.1.4/PKG-INFO ADDED
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.1
2
+ Name: secfeed
3
+ Version: 0.1.4
4
+ Summary: Python SDK for the SecFeed SEC EDGAR API
5
+ License: MIT
6
+ Project-URL: Homepage, https://secfeedapi.com
7
+ Project-URL: Documentation, https://secfeedapi.com/docs/
8
+ Keywords: sec,edgar,filings,xbrl,13f,insider trading,api
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+
12
+ # secfeed (Python)
13
+
14
+ Client for the [SecFeed](https://secfeedapi.com) SEC EDGAR API. No dependencies, Python 3.8+.
15
+
16
+ ```bash
17
+ pip install secfeed
18
+ ```
19
+
20
+ ```python
21
+ from secfeed import Client
22
+
23
+ sf = Client("sf_...") # free key at https://secfeedapi.com
24
+ sf.filings('ticker:AAPL AND formType:"10-K"', size=5)
25
+ sf.insider_trades(ticker="NVDA", code="P")
26
+ sf.financial_statements("AAPL")
27
+ sf.events_8k(item="5.02")
28
+ for filing in sf.stream(form_types=["8-K"]):
29
+ print(filing["companyName"], filing["formType"])
30
+ ```
31
+
32
+ Federal contracts use the same key: SAM.gov opportunities and entity registrations, USAspending awards, awards by ticker,
33
+ and the recompete radar (contracts ending in the next 24 months; Developer plans and up).
34
+
35
+ ```python
36
+ sf.sam_opportunities(naics="5415", setAside="SBA")
37
+ sf.sam_entity(cage="02GJ5")
38
+ sf.company_federal_awards("LMT")
39
+ sf.recompetes(naics="5415", setAside="SBA", hasNotice="true")
40
+ ```
41
+
42
+ Company data beyond the filings uses the same key: financial ratios, point-in-time fundamentals, revenue by segment,
43
+ customer concentration, a fundamentals screener, delistings and ticker history, WARN layoff notices, SEC comment
44
+ letters, LEI lookup, UK Companies House, Treasury yields and economic data, private offerings, money market funds
45
+ and fund flows.
46
+
47
+ ```python
48
+ sf.financial_ratios("AAPL")
49
+ sf.point_in_time("MSFT", concept="Revenues")
50
+ sf.segments("AAPL", type="product")
51
+ sf.suppliers("WMT")
52
+ sf.screener("Revenue>1e9,GrossProfit/Revenue>0.6", period="CY2025", size=3)
53
+ sf.delistings(ticker="SIVB")
54
+ sf.company_warn_notices("INTC")
55
+ sf.comment_letters(topic="non-GAAP", size=2)
56
+ sf.lei(ticker="AAPL")
57
+ sf.uk_companies(name="rolls-royce")
58
+ sf.yield_curve(size=5)
59
+ sf.private_offerings(source="form-d", minAmount=5000000, size=3)
60
+ sf.money_market_funds(category="government", size=5)
61
+ ```
62
+
63
+ Every endpoint in the [API docs](https://secfeedapi.com/docs/) has a method. Errors raise `SecFeedError`.
64
+
65
+ SecFeed is an independent service and is not affiliated with or endorsed by the U.S. Securities and Exchange Commission. Filing data comes from SEC EDGAR, which is public.
66
+
67
+ ### Ownership, trading and alerts (0.1.4)
68
+
69
+ ```python
70
+ sf.ownership_changes(ticker="AAPL", period="2026Q2", size=20) # 13F managers that bought, sold, opened, closed
71
+ sf.class_period_holders(ticker="AAPL", start_date="2024-01-15", end_date="2024-12-15")
72
+ sf.trading_plans(ticker="NVDA", action="adopted") # 10b5-1 plans (Item 408)
73
+ sf.fails_to_deliver(symbol="GME", startDate="2026-10-01", endDate="2026-10-31")
74
+ sf.watch("insider_buy", "AAPL", minValue=100000) # email alert; sf.watchlist(), sf.unwatch(id), sf.watch_events()
75
+ ```
@@ -0,0 +1,64 @@
1
+ # secfeed (Python)
2
+
3
+ Client for the [SecFeed](https://secfeedapi.com) SEC EDGAR API. No dependencies, Python 3.8+.
4
+
5
+ ```bash
6
+ pip install secfeed
7
+ ```
8
+
9
+ ```python
10
+ from secfeed import Client
11
+
12
+ sf = Client("sf_...") # free key at https://secfeedapi.com
13
+ sf.filings('ticker:AAPL AND formType:"10-K"', size=5)
14
+ sf.insider_trades(ticker="NVDA", code="P")
15
+ sf.financial_statements("AAPL")
16
+ sf.events_8k(item="5.02")
17
+ for filing in sf.stream(form_types=["8-K"]):
18
+ print(filing["companyName"], filing["formType"])
19
+ ```
20
+
21
+ Federal contracts use the same key: SAM.gov opportunities and entity registrations, USAspending awards, awards by ticker,
22
+ and the recompete radar (contracts ending in the next 24 months; Developer plans and up).
23
+
24
+ ```python
25
+ sf.sam_opportunities(naics="5415", setAside="SBA")
26
+ sf.sam_entity(cage="02GJ5")
27
+ sf.company_federal_awards("LMT")
28
+ sf.recompetes(naics="5415", setAside="SBA", hasNotice="true")
29
+ ```
30
+
31
+ Company data beyond the filings uses the same key: financial ratios, point-in-time fundamentals, revenue by segment,
32
+ customer concentration, a fundamentals screener, delistings and ticker history, WARN layoff notices, SEC comment
33
+ letters, LEI lookup, UK Companies House, Treasury yields and economic data, private offerings, money market funds
34
+ and fund flows.
35
+
36
+ ```python
37
+ sf.financial_ratios("AAPL")
38
+ sf.point_in_time("MSFT", concept="Revenues")
39
+ sf.segments("AAPL", type="product")
40
+ sf.suppliers("WMT")
41
+ sf.screener("Revenue>1e9,GrossProfit/Revenue>0.6", period="CY2025", size=3)
42
+ sf.delistings(ticker="SIVB")
43
+ sf.company_warn_notices("INTC")
44
+ sf.comment_letters(topic="non-GAAP", size=2)
45
+ sf.lei(ticker="AAPL")
46
+ sf.uk_companies(name="rolls-royce")
47
+ sf.yield_curve(size=5)
48
+ sf.private_offerings(source="form-d", minAmount=5000000, size=3)
49
+ sf.money_market_funds(category="government", size=5)
50
+ ```
51
+
52
+ Every endpoint in the [API docs](https://secfeedapi.com/docs/) has a method. Errors raise `SecFeedError`.
53
+
54
+ SecFeed is an independent service and is not affiliated with or endorsed by the U.S. Securities and Exchange Commission. Filing data comes from SEC EDGAR, which is public.
55
+
56
+ ### Ownership, trading and alerts (0.1.4)
57
+
58
+ ```python
59
+ sf.ownership_changes(ticker="AAPL", period="2026Q2", size=20) # 13F managers that bought, sold, opened, closed
60
+ sf.class_period_holders(ticker="AAPL", start_date="2024-01-15", end_date="2024-12-15")
61
+ sf.trading_plans(ticker="NVDA", action="adopted") # 10b5-1 plans (Item 408)
62
+ sf.fails_to_deliver(symbol="GME", startDate="2026-10-01", endDate="2026-10-31")
63
+ sf.watch("insider_buy", "AAPL", minValue=100000) # email alert; sf.watchlist(), sf.unwatch(id), sf.watch_events()
64
+ ```
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "secfeed"
7
- version = "0.1.2"
7
+ version = "0.1.4"
8
8
  description = "Python SDK for the SecFeed SEC EDGAR API"
9
9
  requires-python = ">=3.8"
10
10
  readme = "README.md"
@@ -0,0 +1,323 @@
1
+ """SecFeed Python SDK. Stdlib only.
2
+
3
+ pip install secfeed
4
+
5
+ from secfeed import Client
6
+ sf = Client("sf_...")
7
+ sf.filings('ticker:AAPL AND formType:"10-K"')
8
+ sf.insider_trades(ticker="NVDA", code="P")
9
+ for filing in sf.stream(form_types=["8-K"]): ...
10
+ """
11
+ import json
12
+ import urllib.parse
13
+ import urllib.request
14
+
15
+ __all__ = ["Client", "SecFeedError"]
16
+
17
+
18
+ class SecFeedError(Exception):
19
+ pass
20
+
21
+
22
+ class Client:
23
+ def __init__(self, api_key, base_url="https://secfeedapi.com"):
24
+ self.key, self.base = api_key, base_url.rstrip("/")
25
+
26
+ def _req(self, method, path, params=None, body=None, raw=False):
27
+ q = urllib.parse.urlencode({k: v for k, v in (params or {}).items() if v is not None})
28
+ req = urllib.request.Request(f"{self.base}{path}{'?' + q if q else ''}", method=method,
29
+ data=json.dumps(body).encode() if body is not None else None,
30
+ headers={"Authorization": f"Bearer {self.key}", "Content-Type": "application/json"})
31
+ try:
32
+ with urllib.request.urlopen(req, timeout=120) as r:
33
+ data = r.read()
34
+ except urllib.error.HTTPError as e:
35
+ raise SecFeedError(f"{e.code}: {e.read().decode(errors='replace')}") from None
36
+ return data if raw else json.loads(data)
37
+
38
+ # search
39
+ def filings(self, query, start=0, size=50, sort="desc"):
40
+ return self._req("POST", "/v1/filings", body={"query": query, "from": start, "size": size, "sort": sort})
41
+
42
+ def full_text_search(self, query, form_types=None, start_date=None, end_date=None, page=1):
43
+ return self._req("GET", "/v1/full-text-search", {"query": query, "formTypes": ",".join(form_types or []) or None,
44
+ "startDate": start_date, "endDate": end_date, "page": page})
45
+
46
+ # documents
47
+ def files(self, cik, accession_no):
48
+ return self._req("GET", "/v1/files", {"cik": cik, "accessionNo": accession_no})
49
+
50
+ def download(self, url):
51
+ return self._req("GET", "/v1/download", {"url": url}, raw=True)
52
+
53
+ def pdf(self, url):
54
+ return self._req("GET", "/v1/pdf", {"url": url}, raw=True)
55
+
56
+ def extract(self, url, item, type="text"):
57
+ return self._req("GET", "/v1/extractor", {"url": url, "item": item, "type": type}, raw=True).decode()
58
+
59
+ # financials
60
+ def xbrl_to_json(self, accession_no=None, htm_url=None, cik=None):
61
+ return self._req("GET", "/v1/xbrl-to-json", {"accessionNo": accession_no, "htmUrl": htm_url, "cik": cik})
62
+
63
+ def financial_statements(self, ticker, form_type="10-K", n=1):
64
+ return self._req("GET", "/v1/financial-statements", {"ticker": ticker, "formType": form_type, "n": n})
65
+
66
+ def company_facts(self, ticker):
67
+ return self._req("GET", "/v1/xbrl/company-facts", {"ticker": ticker})
68
+
69
+ def frames(self, concept, period, unit="USD"):
70
+ return self._req("GET", "/v1/xbrl/frames", {"concept": concept, "period": period, "unit": unit})
71
+
72
+ # ownership, events, forms
73
+ def insider_trades(self, **filters):
74
+ return self._req("GET", "/v1/insider-trading", filters)
75
+
76
+ def holdings_13f(self, cusip=None, cik=None, period=None):
77
+ return self._req("GET", "/v1/form-13f/holdings", {"cusip": cusip, "cik": cik, "period": period})
78
+
79
+ def form(self, family, **filters):
80
+ """family: form-144, form-13f, form-13d-13g, form-d, form-c, reg-a, n-port, n-cen, n-px"""
81
+ return self._req("GET", f"/v1/{family}", filters)
82
+
83
+ def events_8k(self, item=None, **filters):
84
+ return self._req("GET", "/v1/form-8k", {"item": item, **filters})
85
+
86
+ # company data & reference
87
+ def entity(self, ticker_or_cik):
88
+ return self._req("GET", "/v1/entities", {"cik": ticker_or_cik})
89
+
90
+ def map_ticker(self, ticker):
91
+ return self._req("GET", "/v1/mapping/ticker", {"ticker": ticker})
92
+
93
+ def map_cusip(self, cusip):
94
+ return self._req("GET", "/v1/mapping/cusip", {"cusip": cusip})
95
+
96
+ def shares_outstanding(self, ticker):
97
+ return self._req("GET", "/v1/shares-outstanding", {"ticker": ticker})
98
+
99
+ def auditor(self, ticker):
100
+ return self._req("GET", "/v1/auditor", {"ticker": ticker})
101
+
102
+ def executive_compensation(self, ticker):
103
+ return self._req("GET", "/v1/executive-compensation", {"ticker": ticker})
104
+
105
+ def directors(self, ticker):
106
+ return self._req("GET", "/v1/directors", {"ticker": ticker})
107
+
108
+ def subsidiaries(self, ticker):
109
+ return self._req("GET", "/v1/subsidiaries", {"ticker": ticker})
110
+
111
+ # datasets extracted from proxy statements, audit reports and enforcement releases
112
+ # filters: cik, ticker, accessionNo, startDate, endDate, from, size, and data.<path>=value
113
+ def dataset(self, path, **filters):
114
+ return self._req("GET", f"/v1/{path}", filters)
115
+
116
+ def audit_report_content(self, id):
117
+ return self._req("GET", "/v1/audit-reports/content", {"id": id}, raw=True).decode()
118
+
119
+ def ipos(self, **filters):
120
+ return self._req("GET", "/v1/ipo", filters)
121
+
122
+ # enforcement
123
+ def enforcement(self, kind="litigation-releases", page=0, details=False):
124
+ return self._req("GET", f"/v1/enforcement/{kind}", {"page": page, "details": str(details).lower()})
125
+
126
+ # real time
127
+ def stream(self, form_types=None, ciks=None):
128
+ """Yield each new filing as a dict, as soon as EDGAR publishes it."""
129
+ q = urllib.parse.urlencode({"formTypes": ",".join(form_types or []), "ciks": ",".join(map(str, ciks or []))})
130
+ req = urllib.request.Request(f"{self.base}/v1/stream?{q}", headers={"Authorization": f"Bearer {self.key}"})
131
+ with urllib.request.urlopen(req) as r:
132
+ for line in r:
133
+ if line.startswith(b"data: "):
134
+ yield json.loads(line[6:])
135
+
136
+ def add_webhook(self, url, form_types=None, ciks=None):
137
+ return self._req("POST", "/v1/webhooks", body={"url": url, "formTypes": form_types or [], "ciks": ciks or []})
138
+
139
+ def list_webhooks(self):
140
+ return self._req("GET", "/v1/webhooks")
141
+
142
+ def delete_webhook(self, id):
143
+ return self._req("POST", "/v1/webhooks/delete", body={"id": id})
144
+
145
+ # federal contracts and spending (SAM.gov, USAspending)
146
+ def sam_opportunities(self, **filters):
147
+ return self._req("GET", "/v1/sam/opportunities", filters)
148
+
149
+ def sam_opportunity(self, notice_id):
150
+ return self._req("GET", "/v1/sam/opportunity", {"noticeId": notice_id})
151
+
152
+ def add_sam_alert(self, url, **filters):
153
+ return self._req("POST", "/v1/sam/alerts", body={"url": url, "filters": filters})
154
+
155
+ def list_sam_alerts(self):
156
+ return self._req("GET", "/v1/sam/alerts")
157
+
158
+ def delete_sam_alert(self, id):
159
+ return self._req("POST", "/v1/sam/alerts/delete", body={"id": id})
160
+
161
+ def sam_entity(self, uei=None, cage=None):
162
+ return self._req("GET", "/v1/sam/entity", {"uei": uei} if uei else {"cage": cage})
163
+
164
+ def sam_entities(self, **filters):
165
+ return self._req("GET", "/v1/sam/entities", filters)
166
+
167
+ # recompete radar (Developer plans and up; trial and free keys get a 402)
168
+ def recompetes(self, **filters):
169
+ return self._req("GET", "/v1/sam/recompetes", filters)
170
+
171
+ def recompete(self, award_key):
172
+ return self._req("GET", "/v1/sam/recompete", {"awardKey": award_key})
173
+
174
+ def add_recompete_alert(self, url, **filters):
175
+ return self._req("POST", "/v1/sam/recompete-alerts", body={"url": url, "filters": filters})
176
+
177
+ def list_recompete_alerts(self):
178
+ return self._req("GET", "/v1/sam/recompete-alerts")
179
+
180
+ def delete_recompete_alert(self, id):
181
+ return self._req("POST", "/v1/sam/recompete-alerts/delete", body={"id": id})
182
+
183
+ def federal_awards(self, **filters):
184
+ return self._req("GET", "/v1/usaspending/awards", filters)
185
+
186
+ def federal_award(self, id):
187
+ return self._req("GET", "/v1/usaspending/award", {"id": id})
188
+
189
+ def federal_recipients(self, q, size=10):
190
+ return self._req("GET", "/v1/usaspending/recipients", {"q": q, "size": size})
191
+
192
+ def federal_recipient(self, id):
193
+ return self._req("GET", "/v1/usaspending/recipient", {"id": id})
194
+
195
+ def federal_spending(self, by, **filters):
196
+ return self._req("GET", "/v1/usaspending/spending", {"by": by, **filters})
197
+
198
+ def company_federal_awards(self, ticker, **filters):
199
+ return self._req("GET", "/v1/companies/federal-awards", {"ticker": ticker, **filters})
200
+
201
+ # company data beyond filings: ratios, point in time, segments, customers, screener
202
+ # delistings and ticker history, WARN layoffs, comment letters, LEI, UK companies, economic data, private offerings, funds
203
+ def delistings(self, **filters):
204
+ return self._req("GET", "/v1/delistings", filters)
205
+
206
+ def ticker_history(self, **filters):
207
+ return self._req("GET", "/v1/ticker-history", filters)
208
+
209
+ def financial_ratios(self, ticker, **filters):
210
+ return self._req("GET", "/v1/financial-ratios", {"ticker": ticker, **filters})
211
+
212
+ def key_metrics(self, ticker, **filters):
213
+ return self._req("GET", "/v1/key-metrics", {"ticker": ticker, **filters})
214
+
215
+ def point_in_time(self, ticker, **filters):
216
+ return self._req("GET", "/v1/financials/point-in-time", {"ticker": ticker, **filters})
217
+
218
+ def restatements(self, ticker, **filters):
219
+ return self._req("GET", "/v1/financials/restatements", {"ticker": ticker, **filters})
220
+
221
+ def warn_notices(self, **filters):
222
+ return self._req("GET", "/v1/warn-notices", filters)
223
+
224
+ def company_warn_notices(self, ticker, **filters):
225
+ return self._req("GET", "/v1/companies/warn-notices", {"ticker": ticker, **filters})
226
+
227
+ def comment_letters(self, **filters):
228
+ return self._req("GET", "/v1/comment-letters", filters)
229
+
230
+ def comment_letter_thread(self, thread_id, **filters):
231
+ return self._req("GET", "/v1/comment-letters/thread", {"threadId": thread_id, **filters})
232
+
233
+ def lei(self, **filters):
234
+ return self._req("GET", "/v1/lei", filters)
235
+
236
+ def lei_parents(self, lei, **filters):
237
+ return self._req("GET", "/v1/lei/parents", {"lei": lei, **filters})
238
+
239
+ def economic_series(self, **filters):
240
+ return self._req("GET", "/v1/economic/series", filters)
241
+
242
+ def economic_observations(self, series, **filters):
243
+ return self._req("GET", "/v1/economic/observations", {"series": series, **filters})
244
+
245
+ def yield_curve(self, **filters):
246
+ return self._req("GET", "/v1/treasury/yield-curve", filters)
247
+
248
+ def private_offerings(self, **filters):
249
+ return self._req("GET", "/v1/private-offerings", filters)
250
+
251
+ def private_offerings_summary(self, **filters):
252
+ return self._req("GET", "/v1/private-offerings/summary", filters)
253
+
254
+ def screener(self, conditions, **filters):
255
+ return self._req("GET", "/v1/screener", {"conditions": conditions, **filters})
256
+
257
+ def screener_concepts(self, **filters):
258
+ return self._req("GET", "/v1/screener/concepts", filters)
259
+
260
+ def segments(self, ticker, **filters):
261
+ return self._req("GET", "/v1/segments", {"ticker": ticker, **filters})
262
+
263
+ def customer_concentration(self, ticker, **filters):
264
+ return self._req("GET", "/v1/customer-concentration", {"ticker": ticker, **filters})
265
+
266
+ def suppliers(self, ticker, **filters):
267
+ return self._req("GET", "/v1/customer-concentration/suppliers", {"ticker": ticker, **filters})
268
+
269
+ def fund_flows(self, **filters):
270
+ return self._req("GET", "/v1/fund-flows", filters)
271
+
272
+ def money_market_funds(self, **filters):
273
+ return self._req("GET", "/v1/money-market-funds", filters)
274
+
275
+ def money_market_holdings(self, **filters):
276
+ return self._req("GET", "/v1/money-market-funds/holdings", filters)
277
+
278
+ def uk_companies(self, **filters):
279
+ return self._req("GET", "/v1/uk/companies", filters)
280
+
281
+ def uk_company(self, number, **filters):
282
+ return self._req("GET", "/v1/uk/company", {"number": number, **filters})
283
+
284
+ def screen(self, conditions, **options): # POST form: conditions = [{"concept": "Revenue", "op": ">", "value": 1e9}, ...]
285
+ return self._req("POST", "/v1/screener", body={"conditions": conditions, **options})
286
+
287
+ # 13F ownership changes, class-period report, 10b5-1 plans, fails-to-deliver, alerts (2026-11-29)
288
+ def ownership_changes(self, ticker=None, period=None, **filters):
289
+ return self._req("GET", "/v1/form-13f/ownership-changes", {"ticker": ticker, "period": period, **filters})
290
+
291
+ def class_period_holders(self, ticker=None, start_date=None, end_date=None, **filters):
292
+ return self._req("GET", "/v1/reports/class-period-holders", {"ticker": ticker, "startDate": start_date, "endDate": end_date, **filters})
293
+
294
+ def trading_plans(self, **filters):
295
+ return self._req("GET", "/v1/trading-plans", filters)
296
+
297
+ def fails_to_deliver(self, **filters):
298
+ return self._req("GET", "/v1/fails-to-deliver", filters)
299
+
300
+ def watchlist(self):
301
+ return self._req("GET", "/v1/watchlist")
302
+
303
+ def watch(self, kind, target, **options): # sf.watch("insider_buy", "AAPL", minValue=100000)
304
+ return self._req("POST", "/v1/watchlist", body={"kind": kind, "target": target, **options})
305
+
306
+ def unwatch(self, item_id):
307
+ return self._req("POST", "/v1/watchlist/delete", body={"id": item_id})
308
+
309
+ def watch_events(self, **filters):
310
+ return self._req("GET", "/v1/watchlist/events", filters)
311
+
312
+
313
+ DATASETS = {
314
+ "director_compensation": "director-compensation", "executive_compensation_governance": "executive-compensation-governance",
315
+ "severance_change_in_control": "severance-change-in-control", "board_oversight": "board-oversight",
316
+ "shareholder_rights": "shareholder-rights", "esg_oversight": "esg-oversight", "compliance_signals": "compliance-signals",
317
+ "vote_standards": "vote-standards", "shareholder_proposals_proxy_contests": "shareholder-proposals-proxy-contests",
318
+ "insider_5pct_holder_ownership": "insider-5pct-holder-ownership", "fund_reorganizations": "fund-reorganizations",
319
+ "audit_reports_financial_statements": "audit-reports/financial-statements", "audit_reports_icfr": "audit-reports/icfr",
320
+ "enforcement_actions": "sec-enforcement-actions",
321
+ }
322
+ for _name, _path in DATASETS.items(): # sf.board_oversight(ticker="AAPL") and so on
323
+ setattr(Client, _name, lambda self, _p=_path, **filters: self.dataset(_p, **filters))
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.1
2
+ Name: secfeed
3
+ Version: 0.1.4
4
+ Summary: Python SDK for the SecFeed SEC EDGAR API
5
+ License: MIT
6
+ Project-URL: Homepage, https://secfeedapi.com
7
+ Project-URL: Documentation, https://secfeedapi.com/docs/
8
+ Keywords: sec,edgar,filings,xbrl,13f,insider trading,api
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+
12
+ # secfeed (Python)
13
+
14
+ Client for the [SecFeed](https://secfeedapi.com) SEC EDGAR API. No dependencies, Python 3.8+.
15
+
16
+ ```bash
17
+ pip install secfeed
18
+ ```
19
+
20
+ ```python
21
+ from secfeed import Client
22
+
23
+ sf = Client("sf_...") # free key at https://secfeedapi.com
24
+ sf.filings('ticker:AAPL AND formType:"10-K"', size=5)
25
+ sf.insider_trades(ticker="NVDA", code="P")
26
+ sf.financial_statements("AAPL")
27
+ sf.events_8k(item="5.02")
28
+ for filing in sf.stream(form_types=["8-K"]):
29
+ print(filing["companyName"], filing["formType"])
30
+ ```
31
+
32
+ Federal contracts use the same key: SAM.gov opportunities and entity registrations, USAspending awards, awards by ticker,
33
+ and the recompete radar (contracts ending in the next 24 months; Developer plans and up).
34
+
35
+ ```python
36
+ sf.sam_opportunities(naics="5415", setAside="SBA")
37
+ sf.sam_entity(cage="02GJ5")
38
+ sf.company_federal_awards("LMT")
39
+ sf.recompetes(naics="5415", setAside="SBA", hasNotice="true")
40
+ ```
41
+
42
+ Company data beyond the filings uses the same key: financial ratios, point-in-time fundamentals, revenue by segment,
43
+ customer concentration, a fundamentals screener, delistings and ticker history, WARN layoff notices, SEC comment
44
+ letters, LEI lookup, UK Companies House, Treasury yields and economic data, private offerings, money market funds
45
+ and fund flows.
46
+
47
+ ```python
48
+ sf.financial_ratios("AAPL")
49
+ sf.point_in_time("MSFT", concept="Revenues")
50
+ sf.segments("AAPL", type="product")
51
+ sf.suppliers("WMT")
52
+ sf.screener("Revenue>1e9,GrossProfit/Revenue>0.6", period="CY2025", size=3)
53
+ sf.delistings(ticker="SIVB")
54
+ sf.company_warn_notices("INTC")
55
+ sf.comment_letters(topic="non-GAAP", size=2)
56
+ sf.lei(ticker="AAPL")
57
+ sf.uk_companies(name="rolls-royce")
58
+ sf.yield_curve(size=5)
59
+ sf.private_offerings(source="form-d", minAmount=5000000, size=3)
60
+ sf.money_market_funds(category="government", size=5)
61
+ ```
62
+
63
+ Every endpoint in the [API docs](https://secfeedapi.com/docs/) has a method. Errors raise `SecFeedError`.
64
+
65
+ SecFeed is an independent service and is not affiliated with or endorsed by the U.S. Securities and Exchange Commission. Filing data comes from SEC EDGAR, which is public.
66
+
67
+ ### Ownership, trading and alerts (0.1.4)
68
+
69
+ ```python
70
+ sf.ownership_changes(ticker="AAPL", period="2026Q2", size=20) # 13F managers that bought, sold, opened, closed
71
+ sf.class_period_holders(ticker="AAPL", start_date="2024-01-15", end_date="2024-12-15")
72
+ sf.trading_plans(ticker="NVDA", action="adopted") # 10b5-1 plans (Item 408)
73
+ sf.fails_to_deliver(symbol="GME", startDate="2026-10-01", endDate="2026-10-31")
74
+ sf.watch("insider_buy", "AAPL", minValue=100000) # email alert; sf.watchlist(), sf.unwatch(id), sf.watch_events()
75
+ ```
secfeed-0.1.2/PKG-INFO DELETED
@@ -1,34 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: secfeed
3
- Version: 0.1.2
4
- Summary: Python SDK for the SecFeed SEC EDGAR API
5
- License: MIT
6
- Project-URL: Homepage, https://secfeedapi.com
7
- Project-URL: Documentation, https://secfeedapi.com/docs/
8
- Keywords: sec,edgar,filings,xbrl,13f,insider trading,api
9
- Requires-Python: >=3.8
10
- Description-Content-Type: text/markdown
11
-
12
- # secfeed (Python)
13
-
14
- Client for the [SecFeed](https://secfeedapi.com) SEC EDGAR API. No dependencies, Python 3.8+.
15
-
16
- ```bash
17
- pip install secfeed
18
- ```
19
-
20
- ```python
21
- from secfeed import Client
22
-
23
- sf = Client("sf_...") # free key at https://secfeedapi.com
24
- sf.filings('ticker:AAPL AND formType:"10-K"', size=5)
25
- sf.insider_trades(ticker="NVDA", code="P")
26
- sf.financial_statements("AAPL")
27
- sf.events_8k(item="5.02")
28
- for filing in sf.stream(form_types=["8-K"]):
29
- print(filing["companyName"], filing["formType"])
30
- ```
31
-
32
- Every endpoint in the [API docs](https://secfeedapi.com/docs/) has a method. Errors raise `SecFeedError`.
33
-
34
- SecFeed is an independent service and is not affiliated with or endorsed by the U.S. Securities and Exchange Commission. Filing data comes from SEC EDGAR, which is public.
secfeed-0.1.2/README.md DELETED
@@ -1,23 +0,0 @@
1
- # secfeed (Python)
2
-
3
- Client for the [SecFeed](https://secfeedapi.com) SEC EDGAR API. No dependencies, Python 3.8+.
4
-
5
- ```bash
6
- pip install secfeed
7
- ```
8
-
9
- ```python
10
- from secfeed import Client
11
-
12
- sf = Client("sf_...") # free key at https://secfeedapi.com
13
- sf.filings('ticker:AAPL AND formType:"10-K"', size=5)
14
- sf.insider_trades(ticker="NVDA", code="P")
15
- sf.financial_statements("AAPL")
16
- sf.events_8k(item="5.02")
17
- for filing in sf.stream(form_types=["8-K"]):
18
- print(filing["companyName"], filing["formType"])
19
- ```
20
-
21
- Every endpoint in the [API docs](https://secfeedapi.com/docs/) has a method. Errors raise `SecFeedError`.
22
-
23
- SecFeed is an independent service and is not affiliated with or endorsed by the U.S. Securities and Exchange Commission. Filing data comes from SEC EDGAR, which is public.
@@ -1,156 +0,0 @@
1
- """SecFeed Python SDK. Stdlib only.
2
-
3
- pip install secfeed
4
-
5
- from secfeed import Client
6
- sf = Client("sf_...")
7
- sf.filings('ticker:AAPL AND formType:"10-K"')
8
- sf.insider_trades(ticker="NVDA", code="P")
9
- for filing in sf.stream(form_types=["8-K"]): ...
10
- """
11
- import json
12
- import urllib.parse
13
- import urllib.request
14
-
15
- __all__ = ["Client", "SecFeedError"]
16
-
17
-
18
- class SecFeedError(Exception):
19
- pass
20
-
21
-
22
- class Client:
23
- def __init__(self, api_key, base_url="https://secfeedapi.com"):
24
- self.key, self.base = api_key, base_url.rstrip("/")
25
-
26
- def _req(self, method, path, params=None, body=None, raw=False):
27
- q = urllib.parse.urlencode({k: v for k, v in (params or {}).items() if v is not None})
28
- req = urllib.request.Request(f"{self.base}{path}{'?' + q if q else ''}", method=method,
29
- data=json.dumps(body).encode() if body is not None else None,
30
- headers={"Authorization": f"Bearer {self.key}", "Content-Type": "application/json"})
31
- try:
32
- with urllib.request.urlopen(req, timeout=120) as r:
33
- data = r.read()
34
- except urllib.error.HTTPError as e:
35
- raise SecFeedError(f"{e.code}: {e.read().decode(errors='replace')}") from None
36
- return data if raw else json.loads(data)
37
-
38
- # search
39
- def filings(self, query, start=0, size=50, sort="desc"):
40
- return self._req("POST", "/v1/filings", body={"query": query, "from": start, "size": size, "sort": sort})
41
-
42
- def full_text_search(self, query, form_types=None, start_date=None, end_date=None, page=1):
43
- return self._req("GET", "/v1/full-text-search", {"query": query, "formTypes": ",".join(form_types or []) or None,
44
- "startDate": start_date, "endDate": end_date, "page": page})
45
-
46
- # documents
47
- def files(self, cik, accession_no):
48
- return self._req("GET", "/v1/files", {"cik": cik, "accessionNo": accession_no})
49
-
50
- def download(self, url):
51
- return self._req("GET", "/v1/download", {"url": url}, raw=True)
52
-
53
- def pdf(self, url):
54
- return self._req("GET", "/v1/pdf", {"url": url}, raw=True)
55
-
56
- def extract(self, url, item, type="text"):
57
- return self._req("GET", "/v1/extractor", {"url": url, "item": item, "type": type}, raw=True).decode()
58
-
59
- # financials
60
- def xbrl_to_json(self, accession_no=None, htm_url=None, cik=None):
61
- return self._req("GET", "/v1/xbrl-to-json", {"accessionNo": accession_no, "htmUrl": htm_url, "cik": cik})
62
-
63
- def financial_statements(self, ticker, form_type="10-K", n=1):
64
- return self._req("GET", "/v1/financial-statements", {"ticker": ticker, "formType": form_type, "n": n})
65
-
66
- def company_facts(self, ticker):
67
- return self._req("GET", "/v1/xbrl/company-facts", {"ticker": ticker})
68
-
69
- def frames(self, concept, period, unit="USD"):
70
- return self._req("GET", "/v1/xbrl/frames", {"concept": concept, "period": period, "unit": unit})
71
-
72
- # ownership, events, forms
73
- def insider_trades(self, **filters):
74
- return self._req("GET", "/v1/insider-trading", filters)
75
-
76
- def holdings_13f(self, cusip=None, cik=None, period=None):
77
- return self._req("GET", "/v1/form-13f/holdings", {"cusip": cusip, "cik": cik, "period": period})
78
-
79
- def form(self, family, **filters):
80
- """family: form-144, form-13f, form-13d-13g, form-d, form-c, reg-a, n-port, n-cen, n-px"""
81
- return self._req("GET", f"/v1/{family}", filters)
82
-
83
- def events_8k(self, item=None, **filters):
84
- return self._req("GET", "/v1/form-8k", {"item": item, **filters})
85
-
86
- # company data & reference
87
- def entity(self, ticker_or_cik):
88
- return self._req("GET", "/v1/entities", {"cik": ticker_or_cik})
89
-
90
- def map_ticker(self, ticker):
91
- return self._req("GET", "/v1/mapping/ticker", {"ticker": ticker})
92
-
93
- def map_cusip(self, cusip):
94
- return self._req("GET", "/v1/mapping/cusip", {"cusip": cusip})
95
-
96
- def shares_outstanding(self, ticker):
97
- return self._req("GET", "/v1/shares-outstanding", {"ticker": ticker})
98
-
99
- def auditor(self, ticker):
100
- return self._req("GET", "/v1/auditor", {"ticker": ticker})
101
-
102
- def executive_compensation(self, ticker):
103
- return self._req("GET", "/v1/executive-compensation", {"ticker": ticker})
104
-
105
- def directors(self, ticker):
106
- return self._req("GET", "/v1/directors", {"ticker": ticker})
107
-
108
- def subsidiaries(self, ticker):
109
- return self._req("GET", "/v1/subsidiaries", {"ticker": ticker})
110
-
111
- # datasets extracted from proxy statements, audit reports and enforcement releases
112
- # filters: cik, ticker, accessionNo, startDate, endDate, from, size, and data.<path>=value
113
- def dataset(self, path, **filters):
114
- return self._req("GET", f"/v1/{path}", filters)
115
-
116
- def audit_report_content(self, id):
117
- return self._req("GET", "/v1/audit-reports/content", {"id": id}, raw=True).decode()
118
-
119
- def ipos(self, **filters):
120
- return self._req("GET", "/v1/ipo", filters)
121
-
122
- # enforcement
123
- def enforcement(self, kind="litigation-releases", page=0, details=False):
124
- return self._req("GET", f"/v1/enforcement/{kind}", {"page": page, "details": str(details).lower()})
125
-
126
- # real time
127
- def stream(self, form_types=None, ciks=None):
128
- """Yield each new filing as a dict, as soon as EDGAR publishes it."""
129
- q = urllib.parse.urlencode({"formTypes": ",".join(form_types or []), "ciks": ",".join(map(str, ciks or []))})
130
- req = urllib.request.Request(f"{self.base}/v1/stream?{q}", headers={"Authorization": f"Bearer {self.key}"})
131
- with urllib.request.urlopen(req) as r:
132
- for line in r:
133
- if line.startswith(b"data: "):
134
- yield json.loads(line[6:])
135
-
136
- def add_webhook(self, url, form_types=None, ciks=None):
137
- return self._req("POST", "/v1/webhooks", body={"url": url, "formTypes": form_types or [], "ciks": ciks or []})
138
-
139
- def list_webhooks(self):
140
- return self._req("GET", "/v1/webhooks")
141
-
142
- def delete_webhook(self, id):
143
- return self._req("POST", "/v1/webhooks/delete", body={"id": id})
144
-
145
-
146
- DATASETS = {
147
- "director_compensation": "director-compensation", "executive_compensation_governance": "executive-compensation-governance",
148
- "severance_change_in_control": "severance-change-in-control", "board_oversight": "board-oversight",
149
- "shareholder_rights": "shareholder-rights", "esg_oversight": "esg-oversight", "compliance_signals": "compliance-signals",
150
- "vote_standards": "vote-standards", "shareholder_proposals_proxy_contests": "shareholder-proposals-proxy-contests",
151
- "insider_5pct_holder_ownership": "insider-5pct-holder-ownership", "fund_reorganizations": "fund-reorganizations",
152
- "audit_reports_financial_statements": "audit-reports/financial-statements", "audit_reports_icfr": "audit-reports/icfr",
153
- "enforcement_actions": "sec-enforcement-actions",
154
- }
155
- for _name, _path in DATASETS.items(): # sf.board_oversight(ticker="AAPL") and so on
156
- setattr(Client, _name, lambda self, _p=_path, **filters: self.dataset(_p, **filters))
@@ -1,34 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: secfeed
3
- Version: 0.1.2
4
- Summary: Python SDK for the SecFeed SEC EDGAR API
5
- License: MIT
6
- Project-URL: Homepage, https://secfeedapi.com
7
- Project-URL: Documentation, https://secfeedapi.com/docs/
8
- Keywords: sec,edgar,filings,xbrl,13f,insider trading,api
9
- Requires-Python: >=3.8
10
- Description-Content-Type: text/markdown
11
-
12
- # secfeed (Python)
13
-
14
- Client for the [SecFeed](https://secfeedapi.com) SEC EDGAR API. No dependencies, Python 3.8+.
15
-
16
- ```bash
17
- pip install secfeed
18
- ```
19
-
20
- ```python
21
- from secfeed import Client
22
-
23
- sf = Client("sf_...") # free key at https://secfeedapi.com
24
- sf.filings('ticker:AAPL AND formType:"10-K"', size=5)
25
- sf.insider_trades(ticker="NVDA", code="P")
26
- sf.financial_statements("AAPL")
27
- sf.events_8k(item="5.02")
28
- for filing in sf.stream(form_types=["8-K"]):
29
- print(filing["companyName"], filing["formType"])
30
- ```
31
-
32
- Every endpoint in the [API docs](https://secfeedapi.com/docs/) has a method. Errors raise `SecFeedError`.
33
-
34
- SecFeed is an independent service and is not affiliated with or endorsed by the U.S. Securities and Exchange Commission. Filing data comes from SEC EDGAR, which is public.
File without changes