API Calls Timing Out

What I’m trying to do:
I am attempting to create a dashboard that pulls in and displays a variety of NBA data. I am using the nba_api Python package to accomplish this. All code has been tested locally and works, but the calls are timing out.

What I’ve tried and what’s not working:
I’ve installed nba_api onto the server through PyPi. I’ve tried making the calls a background task in addition to obviously already having them in a server module and not the client code. Whether its a background task or not, it will ultimately fail on a timeout. Any ideas as to why this is happening? I am new to Anvil so hoping I’m just making a rookie mistake and its not something to do with the package (nba_api is listed as supported on Anvil)

When the function is a regular callable, the error is: anvil.server.TimeoutError: Server code took too long

Code Sample:

    games = anvil.server.call('getScoreboard')
    for game in games:
      b = Button(text=game, tag=game[0:2])
      b.set_event_handler('click', self.click_handler)`` 
def getScoreboard():
    print("Entering getScoreboard...")
    temp = scoreboardv2.ScoreboardV2().get_dict()
    print("Scoreboard acquired...")
    matchups = []
    for i in range(0, (len(temp["resultSets"][1]["rowSet"]) // 2)):
        matchups.append(temp["resultSets"][1]["rowSet"][2*i][4] + ' vs. ' + temp["resultSets"][1]["rowSet"][(2*i)+1][4])
    return matchup 

Note that I never reach the second print on my testing, so it is assuredly failing on the api call

Clone link:

In your clone, I don’t see aI see that you are making server calls but I don’t see any Server modules.
Not sure how this is even working.

With out a full clone it might be a bit difficult to diagnose.

A couple of questions come to mind. Have you tried calling the server functions using a button.
This would allow you to set up and initialise the app and then run the server code separately.

Second, how have you logic tested the server functions?

EDIT: When I checked the API endpoint, it seemed to time out - maybe the problem is actually with the package rather than using the endpoint

I have it working now by uplinking the server module from my own machine. I just could not run functions for this directly in the server module.