Giter Club home page Giter Club logo

nbascrape's Introduction

PLAY BY PLAY AND BOX SCORE SCRAPING LIBRARY

Requirements

This library was created on a Mac, so the setup instructions are geared toward a *nix environment (sorry Windows users)

  • Python 2.5 or greater
  • MySQL
  • MySQLdb - Python's API to the MySQL database

TODO: Add postgres, sqlite support

Instructions

  • Clone the repository to your local machine (change your_folder_path to whatever folder you want to put the repo)
cd your_folder_path
git clone [email protected]:kpascual/nbascrape.git
  • Add this new directory to your PYTHONPATH in ~/.bash_profile
PYTHONPATH="/your_folder_path/nbascrape:$PYTHONPATH"
export PYTHONPATH
  • Go to the libscrape/config
  • Copy constants_example.py to constants.py, and edit rows 3-8 in constants.py with the path containing this repo.
cd libscrape/config
cp constants_example.py constants.py
  • Copy db_example.py to db.py
cp db_example.py db.py
  • In config.py, enter your MySQL database credentials
vi db.py

  4 dbconn_prod_nba = {
  5     'user': 'username_for_database',
  6     'passwd': 'password__for_database',
  7     'db': 'production_database_name'
  8 }
  • Finally, load the database with the required tables and data
cd your_path_here/schema
mysql -u user_name -p database_name < core_schema.sql
mysql -u user_name -p database_name < core_data.sql
mysql -u user_name -p database_name < game_data.sql

To actually do scraping, run the master.py file within the libscrape directory, and enter the date (YYYY-MM-DD) of the games that you want to scrape.

cd your_path_here/libscrape
python master.py 2012-10-30

nbascrape's People

Contributors

ahwolf avatar kpascual avatar

Watchers

 avatar  avatar

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.