Giter Site home page Giter Site logo

baller-stats-stack's People

Contributors

borozcod avatar

Watchers

 avatar  avatar

baller-stats-stack's Issues

Develop python script for exctracting game week data

Update Needed

Build upon the current python function to get the data from each game week

Lambda function: ./lib/lambda/python/app.py

Running the function

# from inside ./lib/lambda/python/
pip install -r requirements.txt
python app.py

I'm using Python 3.9.13 and pip 22.2.2, for reference. Should work with Python โ‰ฅ 3.5

Additional Notes

I was thinking we could just make another function called getGameWeek() and add it here

def handler(event, context):
getLeagueLeaders()

This function gets the data in csv format from google sheets

def getCSV(sheet_name):
google_sheet = {
"id": os.environ.get('BS_SHEET_ID'),
"sheet": sheet_name
}
# Get the sheet as csv
google_sheet_url = "https://docs.google.com/spreadsheets/d/" + google_sheet["id"] +"/gviz/tq?tqx=out:csv&sheet=" + google_sheet['sheet']
res = requests.get(google_sheet_url)
csvStringIO = StringIO(res.text)
return csvStringIO

For developing locally this should create the files in your local machine

#local development
if(os.environ.get('LOCAL_PATH')):
abs_path = os.path.abspath(os.environ.get('LOCAL_PATH') + file_path)
file = abs_path + "/" + file_name
os.makedirs(abs_path, exist_ok=True)
with open(file, "w") as f:
f.write(body)
return

Note that this directory is ignored for testing purposes

lib/lambda/python/test-data

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.