walsh06 / python_rugby

Python api for querying rugby data
18 stars 6 forks source link

Expand the database with historical data #37

Open walsh06 opened 5 years ago

walsh06 commented 5 years ago

The database is constantly being expanded with new data but it is also extremely useful to add older data to the database from previous seasons so that it can be queried for more in depth analysis.

The steps to update are:

  1. Identify match and league ids on espn website. These are easily found in the url for a match http://www.espn.com/rugby/match?gameId=293566&league=271937. Matches in a common league and season tend to be sequential.
  2. Update variables.py dictionary with the new values. This may involve adding a new league, season or just extending the range of matches.
  3. Run the database update. The script below is a quick example using the RugbyDBReadWrite to update the database
    
    from python_rugby import rugbydb

db = rugbydb.RugbyDBReadWrite()

db.updateDbFromWeb('289234', 'november18', False) # internationals


4. Copy the files into the rugby_database folder. After running updateDbFromWeb() new database files get written into a folder with the days date. You must manually copy these into the rugby_database folder for it to take effect. This is to avoid breaking any of the files accidentally
5. Commit, Push and merge