tickerdb 0.2.0__tar.gz → 0.2.1__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 (31) hide show
  1. tickerdb-0.2.1/CHANGELOG.md +48 -0
  2. {tickerdb-0.2.0 → tickerdb-0.2.1}/PKG-INFO +32 -63
  3. {tickerdb-0.2.0 → tickerdb-0.2.1}/README.md +30 -62
  4. {tickerdb-0.2.0 → tickerdb-0.2.1}/pyproject.toml +1 -0
  5. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/__init__.py +0 -22
  6. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/_endpoints.py +0 -129
  7. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/_version.py +1 -1
  8. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/async_client.py +0 -305
  9. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/client.py +0 -297
  10. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/types/__init__.py +0 -34
  11. {tickerdb-0.2.0 → tickerdb-0.2.1}/tests/test_client.py +0 -10
  12. {tickerdb-0.2.0 → tickerdb-0.2.1}/tests/test_endpoints.py +0 -43
  13. tickerdb-0.2.0/src/tickerdb/types/screeners.py +0 -64
  14. tickerdb-0.2.0/src/tickerdb/types/teams.py +0 -66
  15. tickerdb-0.2.0/src/tickerdb/types/webhooks.py +0 -31
  16. {tickerdb-0.2.0 → tickerdb-0.2.1}/.claude/settings.local.json +0 -0
  17. {tickerdb-0.2.0 → tickerdb-0.2.1}/.gitattributes +0 -0
  18. {tickerdb-0.2.0 → tickerdb-0.2.1}/.gitignore +0 -0
  19. {tickerdb-0.2.0 → tickerdb-0.2.1}/examples/smoke_test.py +0 -0
  20. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/_transport.py +0 -0
  21. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/exceptions.py +0 -0
  22. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/py.typed +0 -0
  23. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/query.py +0 -0
  24. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/types/account.py +0 -0
  25. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/types/common.py +0 -0
  26. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/types/ohlcv.py +0 -0
  27. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/types/search.py +0 -0
  28. {tickerdb-0.2.0 → tickerdb-0.2.1}/src/tickerdb/types/summary.py +0 -0
  29. {tickerdb-0.2.0 → tickerdb-0.2.1}/tests/conftest.py +0 -0
  30. {tickerdb-0.2.0 → tickerdb-0.2.1}/tests/test_query.py +0 -0
  31. {tickerdb-0.2.0 → tickerdb-0.2.1}/tests/test_transport.py +0 -0
@@ -0,0 +1,48 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.2.0] - 2026-07-10
11
+
12
+ Full parity with the TickerDB `/v1` API plus an internal refactor. **No breaking
13
+ changes** — every existing method, argument, and the `{"data", "rate_limits"}`
14
+ result shape is unchanged, so upgrading from 0.1.x is drop-in.
15
+
16
+ ### Added
17
+
18
+ - `account()` — plan tier, limits, usage, and credit balance (does not consume
19
+ the monthly quota).
20
+ - `ohlcv()` and `iter_ohlcv()` — daily OHLCV bars (split/dividend-adjusted for
21
+ equities, unadjusted for crypto), cursor-paginated and credit-metered;
22
+ `iter_ohlcv()` streams every bar across pages.
23
+ - `search(date=...)` and a `.date()` method on the query builder for
24
+ point-in-time snapshot searches.
25
+ - `summary(offset=...)` for paging history/sample ranges.
26
+ - `InsufficientCreditsError` — raised by credit-metered calls (e.g. OHLCV) that
27
+ would exceed the account's credit balance. Subclasses `RateLimitError` and
28
+ carries `credits_required` / `credits_remaining`.
29
+ - Typed models for every new endpoint, exported from the package root.
30
+ - Test suite (pytest, mocked transport), a read-only `examples/smoke_test.py`,
31
+ and a `dev` optional-dependencies group.
32
+
33
+ ### Changed
34
+
35
+ - Internal refactor (no user-facing impact): shared transport layer
36
+ (`_transport`), pure request builders (`_endpoints`), a unified
37
+ `BaseSearchQuery`, a `src/` layout, and a domain-split `types/` package.
38
+ - Version is now a single source of truth in `_version.py`, read dynamically by
39
+ the build backend; the `User-Agent` header derives from it.
40
+
41
+ ## [0.1.18] and earlier
42
+
43
+ See the [git history](https://github.com/tickerdb/tickerdb-python/commits/main)
44
+ and [PyPI release history](https://pypi.org/project/tickerdb/#history) for
45
+ releases prior to this changelog.
46
+
47
+ [Unreleased]: https://github.com/tickerdb/tickerdb-python/compare/v0.2.0...HEAD
48
+ [0.2.0]: https://github.com/tickerdb/tickerdb-python/compare/v0.1.18...v0.2.0
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tickerdb
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Connect your agent to pre-computed market context that improves reasoning and reduces token usage.
5
5
  Project-URL: Homepage, https://tickerdb.com
6
6
  Project-URL: Documentation, https://tickerdb.com/docs
7
7
  Project-URL: Repository, https://github.com/tickerdb/tickerdb-python
8
+ Project-URL: Changelog, https://github.com/tickerdb/tickerdb-python/blob/main/CHANGELOG.md
8
9
  Project-URL: Issues, https://github.com/tickerdb/tickerdb-python/issues
9
10
  Author-email: TickerDB <support@tickerdb.com>
10
11
  License-Expression: MIT
@@ -30,17 +31,18 @@ Requires-Dist: pytest>=7.0; extra == 'dev'
30
31
  Requires-Dist: ruff>=0.1; extra == 'dev'
31
32
  Description-Content-Type: text/markdown
32
33
 
33
- # TickerDB - Market context for agents.
34
+ # TickerDB - Pre-computed market data for agents.
34
35
 
35
36
  [![PyPI version](https://img.shields.io/pypi/v/tickerdb.svg)](https://pypi.org/project/tickerdb/)
36
37
  [![Python versions](https://img.shields.io/pypi/pyversions/tickerdb.svg)](https://pypi.org/project/tickerdb/)
37
38
 
38
- Connect your agent to pre-computed market context that improves reasoning and reduces token usage.
39
+ Connect your agent to hundreds of indicators like trend_direction, support_level, and analyst_consensus to improve reasoning and reduce token usage.
39
40
 
40
41
  - Sync and async clients
41
42
  - Full type hints for IDE autocompletion
42
43
  - Typed exceptions for every error class
43
44
  - Rate limit information on every response
45
+ - Covers the full v1 API: summaries, search, OHLCV, and watchlists
44
46
 
45
47
  **Full API documentation:** [https://tickerdb.com/docs](https://tickerdb.com/docs)
46
48
 
@@ -281,66 +283,6 @@ for bar in client.iter_ohlcv("AAPL", start="2025-01-01"):
281
283
 
282
284
  If a request would exceed your credit balance, `InsufficientCreditsError` is raised with `credits_required` and `credits_remaining` attributes.
283
285
 
284
- ### Screeners
285
-
286
- List, create, update, and delete saved screeners. Built-in "default" screeners and your saved "custom" screeners are returned together.
287
-
288
- ```python
289
- result = client.list_screeners()
290
- print(result["data"]["screeners"])
291
-
292
- created = client.create_screener(
293
- name="Oversold tech",
294
- filters=[
295
- {"field": "momentum_rsi_zone", "op": "in", "value": ["deep_oversold", "oversold"]},
296
- {"field": "sector", "op": "eq", "value": "Technology"},
297
- ],
298
- sort={"field": "market_cap", "direction": "desc"},
299
- )
300
- screener_id = created["data"]["screener"]["id"]
301
-
302
- client.update_screener(screener_id, name="Oversold tech (updated)")
303
- client.delete_screener(screener_id) # delete a custom screener
304
- client.delete_screener("oversold", kind="default") # hide a built-in screener
305
- ```
306
-
307
- Filters support value operators (`eq`, `neq`, `in`, `gt`, `gte`, `lt`, `lte`, `exists`) and change filters (`{"type": "change", "field": ..., "from": ..., "to": ...}`).
308
-
309
- ### Webhooks
310
-
311
- Manage webhooks and inspect their delivery history.
312
-
313
- ```python
314
- hooks = client.list_webhooks()
315
- created = client.create_webhook("https://example.com/hook", events={"daily": True})
316
- webhook_id = created["data"]["id"]
317
-
318
- client.update_webhook(webhook_id, active=False)
319
- client.delete_webhook(webhook_id)
320
-
321
- # Recent delivery attempts (status, retries, HTTP status, errors)
322
- deliveries = client.webhook_deliveries(limit=20)
323
- deliveries = client.webhook_deliveries(webhook_id=webhook_id)
324
- ```
325
-
326
- ### Teams
327
-
328
- View teams and manage members (most write actions require a business plan and owner/admin role).
329
-
330
- ```python
331
- teams = client.get_teams()
332
-
333
- team_id = client.create_team("Research")["data"]["team"]["id"]
334
- client.invite_member(team_id, "analyst@example.com", role="member")
335
- client.promote_member(team_id, user_id, role="admin")
336
- client.set_seats(team_id, total_seats=10)
337
- client.rename_team(team_id, "Research & Strategy")
338
-
339
- # Also: remove_member, cancel_invite, resend_invite, leave_team
340
- ```
341
-
342
- All team methods are also available on `AsyncTickerDB` with `await`.
343
-
344
286
  ## Error Handling
345
287
 
346
288
  The SDK raises typed exceptions for all API errors:
@@ -392,6 +334,33 @@ print(limits["hourly_request_limit"]) # Hourly limit
392
334
  print(limits["hourly_requests_remaining"]) # Hourly remaining
393
335
  ```
394
336
 
337
+ ## Development
338
+
339
+ Requires Python 3.8+.
340
+
341
+ ```bash
342
+ git clone https://github.com/tickerdb/tickerdb-python
343
+ cd tickerdb-python
344
+
345
+ python -m venv .venv
346
+ source .venv/bin/activate # Windows (PowerShell): .venv\Scripts\Activate.ps1
347
+
348
+ pip install -e ".[dev]" # editable install + dev tools
349
+ ```
350
+
351
+ Run the checks (no API key required — the suite uses a mocked transport):
352
+
353
+ ```bash
354
+ pytest
355
+ ruff check src tests
356
+ ```
357
+
358
+ `examples/smoke_test.py` runs a read-only check against the live API using your key:
359
+
360
+ ```bash
361
+ TICKERDB_API_KEY=tdb_your_key python examples/smoke_test.py
362
+ ```
363
+
395
364
  ## Links
396
365
 
397
366
  - [TickerDB Website](https://tickerdb.com)
@@ -1,14 +1,15 @@
1
- # TickerDB - Market context for agents.
1
+ # TickerDB - Pre-computed market data for agents.
2
2
 
3
3
  [![PyPI version](https://img.shields.io/pypi/v/tickerdb.svg)](https://pypi.org/project/tickerdb/)
4
4
  [![Python versions](https://img.shields.io/pypi/pyversions/tickerdb.svg)](https://pypi.org/project/tickerdb/)
5
5
 
6
- Connect your agent to pre-computed market context that improves reasoning and reduces token usage.
6
+ Connect your agent to hundreds of indicators like trend_direction, support_level, and analyst_consensus to improve reasoning and reduce token usage.
7
7
 
8
8
  - Sync and async clients
9
9
  - Full type hints for IDE autocompletion
10
10
  - Typed exceptions for every error class
11
11
  - Rate limit information on every response
12
+ - Covers the full v1 API: summaries, search, OHLCV, and watchlists
12
13
 
13
14
  **Full API documentation:** [https://tickerdb.com/docs](https://tickerdb.com/docs)
14
15
 
@@ -249,66 +250,6 @@ for bar in client.iter_ohlcv("AAPL", start="2025-01-01"):
249
250
 
250
251
  If a request would exceed your credit balance, `InsufficientCreditsError` is raised with `credits_required` and `credits_remaining` attributes.
251
252
 
252
- ### Screeners
253
-
254
- List, create, update, and delete saved screeners. Built-in "default" screeners and your saved "custom" screeners are returned together.
255
-
256
- ```python
257
- result = client.list_screeners()
258
- print(result["data"]["screeners"])
259
-
260
- created = client.create_screener(
261
- name="Oversold tech",
262
- filters=[
263
- {"field": "momentum_rsi_zone", "op": "in", "value": ["deep_oversold", "oversold"]},
264
- {"field": "sector", "op": "eq", "value": "Technology"},
265
- ],
266
- sort={"field": "market_cap", "direction": "desc"},
267
- )
268
- screener_id = created["data"]["screener"]["id"]
269
-
270
- client.update_screener(screener_id, name="Oversold tech (updated)")
271
- client.delete_screener(screener_id) # delete a custom screener
272
- client.delete_screener("oversold", kind="default") # hide a built-in screener
273
- ```
274
-
275
- Filters support value operators (`eq`, `neq`, `in`, `gt`, `gte`, `lt`, `lte`, `exists`) and change filters (`{"type": "change", "field": ..., "from": ..., "to": ...}`).
276
-
277
- ### Webhooks
278
-
279
- Manage webhooks and inspect their delivery history.
280
-
281
- ```python
282
- hooks = client.list_webhooks()
283
- created = client.create_webhook("https://example.com/hook", events={"daily": True})
284
- webhook_id = created["data"]["id"]
285
-
286
- client.update_webhook(webhook_id, active=False)
287
- client.delete_webhook(webhook_id)
288
-
289
- # Recent delivery attempts (status, retries, HTTP status, errors)
290
- deliveries = client.webhook_deliveries(limit=20)
291
- deliveries = client.webhook_deliveries(webhook_id=webhook_id)
292
- ```
293
-
294
- ### Teams
295
-
296
- View teams and manage members (most write actions require a business plan and owner/admin role).
297
-
298
- ```python
299
- teams = client.get_teams()
300
-
301
- team_id = client.create_team("Research")["data"]["team"]["id"]
302
- client.invite_member(team_id, "analyst@example.com", role="member")
303
- client.promote_member(team_id, user_id, role="admin")
304
- client.set_seats(team_id, total_seats=10)
305
- client.rename_team(team_id, "Research & Strategy")
306
-
307
- # Also: remove_member, cancel_invite, resend_invite, leave_team
308
- ```
309
-
310
- All team methods are also available on `AsyncTickerDB` with `await`.
311
-
312
253
  ## Error Handling
313
254
 
314
255
  The SDK raises typed exceptions for all API errors:
@@ -360,6 +301,33 @@ print(limits["hourly_request_limit"]) # Hourly limit
360
301
  print(limits["hourly_requests_remaining"]) # Hourly remaining
361
302
  ```
362
303
 
304
+ ## Development
305
+
306
+ Requires Python 3.8+.
307
+
308
+ ```bash
309
+ git clone https://github.com/tickerdb/tickerdb-python
310
+ cd tickerdb-python
311
+
312
+ python -m venv .venv
313
+ source .venv/bin/activate # Windows (PowerShell): .venv\Scripts\Activate.ps1
314
+
315
+ pip install -e ".[dev]" # editable install + dev tools
316
+ ```
317
+
318
+ Run the checks (no API key required — the suite uses a mocked transport):
319
+
320
+ ```bash
321
+ pytest
322
+ ruff check src tests
323
+ ```
324
+
325
+ `examples/smoke_test.py` runs a read-only check against the live API using your key:
326
+
327
+ ```bash
328
+ TICKERDB_API_KEY=tdb_your_key python examples/smoke_test.py
329
+ ```
330
+
363
331
  ## Links
364
332
 
365
333
  - [TickerDB Website](https://tickerdb.com)
@@ -49,6 +49,7 @@ dev = [
49
49
  Homepage = "https://tickerdb.com"
50
50
  Documentation = "https://tickerdb.com/docs"
51
51
  Repository = "https://github.com/tickerdb/tickerdb-python"
52
+ Changelog = "https://github.com/tickerdb/tickerdb-python/blob/main/CHANGELOG.md"
52
53
  Issues = "https://github.com/tickerdb/tickerdb-python/issues"
53
54
 
54
55
  [tool.pytest.ini_options]
@@ -40,20 +40,9 @@ from .types import (
40
40
  OhlcvResponse,
41
41
  RateLimits,
42
42
  SchemaResponse,
43
- Screener,
44
- ScreenerFilter,
45
- ScreenersResponse,
46
- ScreenerSort,
47
43
  SearchParams,
48
44
  SearchResponse,
49
45
  Stability,
50
- Team,
51
- TeamInvite,
52
- TeamMember,
53
- TeamPendingInvite,
54
- TeamsResponse,
55
- WebhookDeliveriesResponse,
56
- WebhookDelivery,
57
46
  )
58
47
 
59
48
  __all__ = [
@@ -80,19 +69,8 @@ __all__ = [
80
69
  "OhlcvResponse",
81
70
  "RateLimits",
82
71
  "SchemaResponse",
83
- "Screener",
84
- "ScreenerFilter",
85
- "ScreenersResponse",
86
- "ScreenerSort",
87
72
  "SearchParams",
88
73
  "SearchResponse",
89
74
  "Stability",
90
- "Team",
91
- "TeamInvite",
92
- "TeamMember",
93
- "TeamPendingInvite",
94
- "TeamsResponse",
95
- "WebhookDeliveriesResponse",
96
- "WebhookDelivery",
97
75
  "__version__",
98
76
  ]
@@ -17,29 +17,6 @@ def _normalize_tickers(tickers: List[str]) -> List[str]:
17
17
  return [str(t).strip().upper() for t in tickers]
18
18
 
19
19
 
20
- def _screener_body(
21
- *,
22
- filters: Optional[List[Dict[str, Any]]] = None,
23
- name: Optional[str] = None,
24
- timeframe: Optional[str] = None,
25
- sort: Optional[Dict[str, Any]] = None,
26
- limit_count: Optional[int] = None,
27
- ) -> Dict[str, Any]:
28
- """Build the shared screener create/update body, omitting unset fields."""
29
- body: Dict[str, Any] = {}
30
- if filters is not None:
31
- body["filters"] = filters
32
- if name is not None:
33
- body["name"] = name
34
- if timeframe is not None:
35
- body["timeframe"] = timeframe
36
- if sort is not None:
37
- body["sort"] = sort
38
- if limit_count is not None:
39
- body["limit_count"] = limit_count
40
- return body
41
-
42
-
43
20
  # ---------------------------------------------------------------------------
44
21
  # Summary / search / schema
45
22
  # ---------------------------------------------------------------------------
@@ -174,109 +151,3 @@ def watchlist_changes(*, timeframe: Optional[str] = None) -> RequestSpec:
174
151
  return RequestSpec("GET", "/watchlist/changes", params={"timeframe": timeframe})
175
152
 
176
153
 
177
- # ---------------------------------------------------------------------------
178
- # Screeners
179
- # ---------------------------------------------------------------------------
180
-
181
-
182
- def list_screeners() -> RequestSpec:
183
- return RequestSpec("GET", "/screeners")
184
-
185
-
186
- def create_screener(
187
- *,
188
- filters: List[Dict[str, Any]],
189
- name: Optional[str] = None,
190
- timeframe: Optional[str] = None,
191
- sort: Optional[Dict[str, Any]] = None,
192
- limit_count: Optional[int] = None,
193
- ) -> RequestSpec:
194
- body = _screener_body(
195
- filters=filters, name=name, timeframe=timeframe, sort=sort, limit_count=limit_count
196
- )
197
- return RequestSpec("POST", "/screeners", json=body)
198
-
199
-
200
- def update_screener(
201
- id: str,
202
- *,
203
- filters: Optional[List[Dict[str, Any]]] = None,
204
- name: Optional[str] = None,
205
- timeframe: Optional[str] = None,
206
- sort: Optional[Dict[str, Any]] = None,
207
- limit_count: Optional[int] = None,
208
- ) -> RequestSpec:
209
- body: Dict[str, Any] = {"id": id}
210
- body.update(
211
- _screener_body(
212
- filters=filters, name=name, timeframe=timeframe, sort=sort, limit_count=limit_count
213
- )
214
- )
215
- return RequestSpec("PUT", "/screeners", json=body)
216
-
217
-
218
- def delete_screener(id: str, *, kind: str = "custom") -> RequestSpec:
219
- return RequestSpec("DELETE", "/screeners", json={"id": id, "kind": kind})
220
-
221
-
222
- # ---------------------------------------------------------------------------
223
- # Webhooks
224
- # ---------------------------------------------------------------------------
225
-
226
-
227
- def list_webhooks() -> RequestSpec:
228
- return RequestSpec("GET", "/webhooks")
229
-
230
-
231
- def create_webhook(url: str, events: Optional[Dict[str, bool]] = None) -> RequestSpec:
232
- body: Dict[str, Any] = {"url": url}
233
- if events is not None:
234
- body["events"] = events
235
- return RequestSpec("POST", "/webhooks", json=body)
236
-
237
-
238
- def update_webhook(
239
- id: str,
240
- *,
241
- url: Optional[str] = None,
242
- events: Optional[Dict[str, bool]] = None,
243
- active: Optional[bool] = None,
244
- ) -> RequestSpec:
245
- body: Dict[str, Any] = {"id": id}
246
- if url is not None:
247
- body["url"] = url
248
- if events is not None:
249
- body["events"] = events
250
- if active is not None:
251
- body["active"] = active
252
- return RequestSpec("PUT", "/webhooks", json=body)
253
-
254
-
255
- def delete_webhook(id: str) -> RequestSpec:
256
- return RequestSpec("DELETE", "/webhooks", json={"id": id})
257
-
258
-
259
- def webhook_deliveries(
260
- *, webhook_id: Optional[str] = None, limit: Optional[int] = None
261
- ) -> RequestSpec:
262
- return RequestSpec(
263
- "GET",
264
- "/webhooks/deliveries",
265
- params={"webhook_id": webhook_id, "limit": limit},
266
- )
267
-
268
-
269
- # ---------------------------------------------------------------------------
270
- # Teams
271
- # ---------------------------------------------------------------------------
272
-
273
-
274
- def get_teams() -> RequestSpec:
275
- return RequestSpec("GET", "/team")
276
-
277
-
278
- def team_action(action: str, **body: Any) -> RequestSpec:
279
- """Build a POST /team action body, dropping ``None`` values."""
280
- payload: Dict[str, Any] = {"action": action}
281
- payload.update({k: v for k, v in body.items() if v is not None})
282
- return RequestSpec("POST", "/team", json=payload)
@@ -1,3 +1,3 @@
1
1
  """Single source of truth for the package version."""
2
2
 
3
- __version__ = "0.2.0"
3
+ __version__ = "0.2.1"