+
    j                     (    R t ^ RIt^ RItRtRR ltR# )u  
Shared TMX Money GraphQL quote fetcher.

Single source of truth for talking to the TMX API — fetch_prices.py and
generate_retrospective.py both import get_quote() from here instead of each
keeping their own copy, so the query/parsing logic can't drift between them.
Nz!https://app-money.tmx.com/graphqlc           	        V P                  4       p RpV F+  pV P                  V4      '       g   K  V R\        V4      )  p  M	  T p\        P                  ! RRRRVRR/RR	/4      P                  4       p\        P                  P                  \        VR
RRR/RR7      p \        P                  P                  WaR7      ;_uu_ 4       p\        P                  ! VP                  4       4      pRRR4       XP                  R/ 4      P                  R/ 4      p	V	P                  R4      p
V	P                  R4      pV
f   R# R\        V
4      RVe   \        V4      /# R/#   + '       g   i     Ly; i  \         d     R# i ; i)zFetch {'price': float, 'changePct': float|None} for a TSX ticker like 'SU.TO'.
Returns None if the ticker can't be resolved or the request fails.NoperationNamegetQuoteBySymbol	variablessymbollocaleenqueryzquery getQuoteBySymbol($symbol:String,$locale:String){getQuoteBySymbol(symbol:$symbol,locale:$locale){symbol price percentChange}}zContent-Typezapplication/jsonAcceptPOST)dataheadersmethod)timeoutr   pricepercentChange	changePct)z.TOz.Vz.CNz.NE)upperendswithlenjsondumpsencodeurllibrequestRequestTMX_URLurlopenloadsreadgetfloat	Exception)tickerr   _EXCHANGE_SUFFIXESsuffixsymbodyreqresprawqr   chgs   &&          ,/media/raid/rshare/SwingTrader/tmx_quotes.py	get_quoter.      sq    \\^F4$??6""Mc&k\*F % C::+(C48  ^  vx	 	
 ..
 
 !3X?QR	 ! C
^^##C#99T**TYY[)C :#''(:B?go&=u{#/E#J\\W[\\ :9  s7    (E1 %E-AE1 ?E1 E1 E.	)E1 1F ?F )
   )__doc__r   urllib.requestr   r   r.        r-   <module>r4      s     
-r3   