examples: tennis markets grounded in live match state - #6
Open
bensynapse wants to merge 1 commit into
Open
Conversation
…tch state Searches tennis markets via pmxt_search, then pairs each market with the live match state (score, server, status) from the Live Tennis API before interpreting any quote -- the same grounding argument the package makes for prices, applied to the event itself. Degrades gracefully when LIVETENNIS_API_KEY is unset or pmxt is unavailable. Contributed by the Live Tennis API team (disclosed in the example docstring), free keyed tier only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Disclosure up front: I run the Live Tennis API (livetennisapi.com), so this contribution is vendor-authored — judge accordingly. It only uses our free keyed tier, and the example's docstring discloses the same.
What
examples/tennis_live_markets.py, following the structure andpp()style ofexamples/demo.py: search tennis markets on Polymarket viapmxt_search, then pair each market with the live state of its underlying match (score line, who is serving, status) fetched with stdliburllib— no new dependency — before any quote is interpreted. Plus one line in the README repo-structure tree.The motivation is the package's own pitch: "instead of hallucinating probabilities, the agent checks actual market prices." For in-play sports markets the same argument extends to the event — an agent shouldn't reason about a tennis market without knowing the actual score.
Honest limits
LIVETENNIS_API_KEYis unset (prints a note, still demos the market half). Free keys: https://livetennisapi.com/subscribe/free — 30 req/min / 100 req/day, which suits developing and testing or ~15-minute checks, not continuous in-play polling. The docstring says exactly that.How I tested
ruff checkpasses (line-length 100 per pyproject).pmxtinstalled: the Polymarket search currently returns a 422 through pmxt in my environment (same fordemo.py'sbitcoinquery, so it's environmental/upstream, not this example); the example handles it and exits cleanly.pmxt: raises the package's standard helpful ImportError at call time, same asdemo.py.score_line,match_market_to_live, no-key path) unit-exercised directly.AI-assisted (Claude), reviewed and understood before submitting. If examples aren't where you want vendor-adjacent material, happy to rework or close.