Skip to content
This repository has been archived by the owner on Jul 4, 2022. It is now read-only.

Filter by bookie functionality not working?(We found just bookie name field incorrect due to sister sites/old names) #2

Closed
jeremyjpj0916 opened this issue Jan 20, 2021 · 3 comments

Comments

@jeremyjpj0916
Copy link
Contributor

jeremyjpj0916 commented Jan 20, 2021

Based on this snippit of code:

   # Example options found here: https://github.com/JeMorriso/PySBR/blob/main/pysbr/config/sportsbooks.yaml
    bookie_list = ['BetOnline', 'Bovada']
    game_type = ['moneyline']

    ### END OF Configurable variables ###

    dt = datetime.strptime(datetime.today().strftime('%Y-%m-%d'), '%Y-%m-%d')
    nfl = NFL()
    nba = NBA()
    sb = Sportsbook()
    e_nfl = EventsByDate(nfl.league_id, dt)
    e_nba = EventsByDate(nba.league_id, dt)
    cl_nfl = CurrentLines(e_nfl.ids(), nfl.market_ids(game_type), sb.ids(bookie_list))
    cl_nba = CurrentLines(e_nba.ids(), nba.market_ids(game_type), sb.ids(bookie_list))

I should not get getting match results like so from NBA:

        elif game.league == "NBA":
            print("NBA LEAGUE GAME PROCESSING")
            for match in cl_nba.list(e_nba):
                if match['event'].lower().find(str(game.team_chosen).lower()):  # match found
                    if match['american odds'] >= int(game.american_odds):
                        if isinstance(game.bookie_odds, int):  # If another bookie has better value replace again
                            if match['american odds'] > game.bookie_odds:
                                game.bookie = match['sportsbook']
                                game.bookie_odds = match['american odds']
                        else:
                            game.bookie = match['sportsbook']
                            game.bookie_odds = match['american odds']

image

Where SportsBetting is still in the list when I specifically filter for only ['BetOnline', 'Bovada']

Version Used: 0.2.1
Python Version: 3.9

@jemorriso
Copy link
Owner

Just looked into this and found that SportsBeting and BetOnline have the same ID because BetOnline was acquired by SportsBetting. So the lines should be the same, but the code needs to be fixed to return the correct name.

Same problem with Bodog and Bovada

@jeremyjpj0916
Copy link
Contributor Author

jeremyjpj0916 commented Jan 20, 2021

Ahh interesting. I can't say I have studied both sites(I know they are sibling sites) to see if the odds are identical between SportsBetting and BetOnline. WIll take a look around now just to confirm it.

Edit - Based on NFL and NBA I am going to say they are the same. Those pages they were identical.

@jeremyjpj0916 jeremyjpj0916 changed the title Filter by bookie functionality not working? Filter by bookie functionality not working?(We found just bookie name field incorrect due to sister sites/old names) Jan 20, 2021
@jemorriso
Copy link
Owner

Added 'sportsbook alias' key for duplicate ids.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants