Skip to content

feat: Add streaming API support and documentation - #20

Merged
mad4ms merged 5 commits into
mainfrom
feat/streaming-api
Aug 1, 2026
Merged

feat: Add streaming API support and documentation#20
mad4ms merged 5 commits into
mainfrom
feat/streaming-api

Conversation

@mad4ms

@mad4ms mad4ms commented Mar 21, 2026

Copy link
Copy Markdown
Owner

Introduce streaming support and a more predictable REST client architecture for the Sportradar DataCore API.

Streaming API

  • streaming.py provides HandballStreamClient and HandballStreamingAPI for MQTT access grants and fixture or venue streams.
  • stream_models.py defines typed stream grants, messages, and publish results.
  • stream_utils.py handles topic and payload decoding, including compressed payloads.
  • The stream extra keeps paho-mqtt optional and imports it lazily.

REST configuration and lifecycle

  • REST authentication is lazy: constructing DataCoreAPI performs no network request.
  • connect() remains available for explicit initialization, while the first endpoint call authenticates automatically.
  • DataCoreSettings provides typed configuration and HandballAPI.from_env() supports environment variables plus optional .env loading.
  • Existing explicit constructor configuration remains supported.

Generated client and codegen

  • The generated OpenAPI client now has one package location: src/datacore_client/.
  • The _vendor import indirection was removed to improve packaging and IDE/type-checker resolution.
  • Bash and PowerShell codegen use the same prepare_openapi_spec.py preprocessing path.
  • The prepared spec is validated before generation, and openapi-python-client==0.26.1 is pinned for reproducibility.

Documentation and tests

  • README and architecture, development, API, and error documentation were updated.
  • Agent instructions document generated-client boundaries and the supported configuration flow.
  • Focused configuration tests were added.

Verification

  • pytest test -q: 14 passed, 1 skipped because STREAM_FIXTURE_ID is not set.
  • Ruff: passed.
  • Mypy: passed.
  • OpenAPI preprocessor smoke test: passed.

The generated client remains build output and should only be changed through the codegen scripts.

mad4ms and others added 5 commits March 21, 2026 09:37
Documents all eight environment variables the package and test suite
actually read: the five required REST credentials, the two optional
streaming settings, and the test log toggle. Contains placeholders only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mad4ms
mad4ms merged commit 042068e into main Aug 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant