Tags: luno/luno-python
Tags
feat: Add Streaming Client (#77) * Implement Streaming API client for python 3 * Refactor quotes * Fix runnable auth creds * Return stream errors * Bug Fix, out of order messages are now caught. And raised * ws.connect max_size increased to handle initial transfer * More concise sequence check As recommended by reviewer comment * improved general exceptions to be more specific * Clean coroutines * resolved indentation error * remove debug line * Address CodeRabbit review comments on PR #76 - Fix StateUpdate type alias to accept Optional[dict] for the callback's third parameter, since None is passed on initial snapshot - Skip keepalive frames received before the initial snapshot to prevent MarketInitialisationException on startup - Correct the pair parameter docstring from describing an amount to describing the currency pair code * Address CodeRabbit review comments on PR #77 - Skip keepalive frames unconditionally (not just before init) to avoid spamming callback with no-op updates - Replace TaskGroup with asyncio.wait(FIRST_COMPLETED) for broader Python version compat and clean shutdown when reader finishes - Support variable-length currency pairs (USDC, USDT) by using known 4-char currency codes to disambiguate pair splits * Fix grammar in docstring and handle parent cancellation - Fix "an StateUpdate" → "a StateUpdate" in docstring - Wrap task orchestration in try/finally to ensure reader and keepalive tasks are always cancelled and awaited, even if stream_market itself is cancelled externally * Tighten pair parsing and improve init error handling - Fail closed in _parse_pair for unrecognised pair shapes instead of guessing a 3+N split - Wrap _MarketStreamState init parsing in try/except to surface malformed snapshots as MarketInitialisationException - Raise MarketInitialisationException if stream closes before the initial snapshot is received * Use explicit task checks instead of iterating unordered done set Prioritise reader.result() over keepalive.result() so the more informative exception surfaces when both tasks fail simultaneously. --------- Co-authored-by: Adam Hicks <[email protected]> Co-authored-by: YinYin <[email protected]> Co-authored-by: YinYin-blip <[email protected]> Co-authored-by: Adam Hicks <[email protected]> Co-authored-by: John Groenewald <[email protected]>
precommit: Fix all pre-commit violations (#73) * precommit: Fix all pre-commit violations - Add module docstrings to all Python files - Add class and method docstrings where missing - Fix docstring formatting (imperative mood, periods) - Remove unused imports - Improve test error matching with pytest.raises - Configure bandit to skip B107 for empty credential defaults - All pre-commit hooks now pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * error: Add type params --------- Co-authored-by: Claude <[email protected]>
PreviousNext