original_docstring: 
      Get ParionsSport odds from league id
      
docstring: Get ParionsSport odds from league id
docstring_tokens: Get ParionsSport odds from league id
code: def parse_parionssport_api(id_league):
      """
      Get ParionsSport odds from league id
      """
      url = ("https://www.enligne.parionssport.fdj.fr/lvs-api/next/50/{}?originId=3&lineId=1&breakdownEventsIntoDays=true"
             "&eType=G&showPromotions=true".format(id_league))
      req = urllib.request.Request(url, headers={'X-LVS-HSToken': sb.TOKENS["parionssport"]})
      content = urllib.request.urlopen(req).read()
      parsed = json.loads(content)
      odds_match = {}
      if "items" not in parsed:
          return odds_match
      items = parsed["items"]
      for item in items:
          if not item.startswith("o"):
              continue
          odd = items[item]
          market = items[odd["parent"]]
          if not market["style"] in ["WIN_DRAW_WIN", "TWO_OUTCOME_LONG"]:
              continue
          event = items[market["parent"]]
          name = event["a"] + " - " + event["b"]
          if event["code"] == "BASK":
              if name not in odds_match:
                  odds = parse_parionssport_match_basketball(market["parent"])
                  if odds:
                      odds_match[name] = odds
          else:
              if not name in odds_match:
                  odds_match[name] = {}
                  odds_match[name]["date"] = (datetime.datetime.strptime(event["start"], "%y%m%d%H%M")
                                              + datetime.timedelta(hours=2))
                  odds_match[name]["odds"] = {"parionssport":[]}
              odds_match[name]["odds"]["parionssport"].append(float(odd["price"].replace(",", ".")))
              odds_match[name]["id"] = {"parionssport":market["parent"]}
      return odds_match
code_tokens: def parse_parionssport_api ( id_league ) : url = ( "https://www.enligne.parionssport.fdj.fr/lvs-api/next/50/{}?originId=3&lineId=1&breakdownEventsIntoDays=true" "&eType=G&showPromotions=true" . format ( id_league ) ) req = urllib . request . Request ( url , headers = { 'X-LVS-HSToken' : sb . TOKENS [ "parionssport" ] } ) content = urllib . request . urlopen ( req ) . read ( ) parsed = json . loads ( content ) odds_match = { } if "items" not in parsed : return odds_match items = parsed [ "items" ] for item in items : if not item . startswith ( "o" ) : continue odd = items [ item ] market = items [ odd [ "parent" ] ] if not market [ "style" ] in [ "WIN_DRAW_WIN" , "TWO_OUTCOME_LONG" ] : continue event = items [ market [ "parent" ] ] name = event [ "a" ] + " - " + event [ "b" ] if event [ "code" ] == "BASK" : if name not in odds_match : odds = parse_parionssport_match_basketball ( market [ "parent" ] ) if odds : odds_match [ name ] = odds else : if not name in odds_match : odds_match [ name ] = { } odds_match [ name ] [ "date" ] = ( datetime . datetime . strptime ( event [ "start" ] , "%y%m%d%H%M" ) + datetime . timedelta ( hours = 2 ) ) odds_match [ name ] [ "odds" ] = { "parionssport" : [ ] } odds_match [ name ] [ "odds" ] [ "parionssport" ] . append ( float ( odd [ "price" ] . replace ( "," , "." ) ) ) odds_match [ name ] [ "id" ] = { "parionssport" : market [ "parent" ] } return odds_match
short_docstring: Get ParionsSport odds from league id
short_docstring_tokens: Get ParionsSport odds from league id
comment: """
      Get ParionsSport odds from league id
      """