Ejemplo n.º 1
0
def createSeasonStatsCSV2():
    allSeasonStats = fetchAllSeasonStats()
    seasonStatsRows = [
        seasonStats.__dict__ for seasonStats in allSeasonStats
        if seasonStats.year >= 2010
    ]
    csvUtils.saveAsCsv(DIST_CSV_FILEPATH_2, DIST_CSV_HEADERS, seasonStatsRows)
Ejemplo n.º 2
0
def createCharacterCSV():
    allCharacters = fetchAllCharacters()
    characterRows = [
        character.__dict__ for character in allCharacters
        if character.firstName != ""
    ]

    csvUtils.saveAsCsv(DIST_CSV_FILEPATH, DIST_CSV_HEADERS, characterRows)
Ejemplo n.º 3
0
def createCharacterCSV():
    allCharacters = fetchAllCharacters()
    characterRows = [
        character.__dict__ for character in allCharacters
        if isValidCharacter(character)
    ]

    csvUtils.saveAsCsv(DIST_CSV_FILEPATH, DIST_CSV_HEADERS, characterRows)
Ejemplo n.º 4
0
def createPlayerCSV2():
    players = fetchPlayersWithSeasonStats()
    players.sort(key=getYearOfBirth)
    playerRows = [extractFieldsForCSV2(player) for player in players]
    csvUtils.saveAsCsv(DIST_CSV_FILEPATH_2, DIST_CSV_HEADERS_2, playerRows)
Ejemplo n.º 5
0
def createPlayerCSV1():
    players = fetchPlayersWithSeasonStats()
    players.sort(key=getName)
    playerRows = [extractFieldsForCSV1(player) for player in players]
    csvUtils.saveAsCsv(DIST_CSV_FILEPATH_1, DIST_CSV_HEADERS_1, playerRows)
Ejemplo n.º 6
0
def createPlanetCSV():
    allPlanets = fetchAllPlanets()
    planetRows = [planet.__dict__ for planet in allPlanets]
    # planetRows = [planet.__dict__ for planet in allPlanets if isValidPlanet(planet)]

    csvUtils.saveAsCsv(DIST_CSV_FILEPATH, DIST_CSV_HEADERS, planetRows)
Ejemplo n.º 7
0
def createMovieCSV2():
    allMovies = fetchAllMovies()
    sortedMovies = sorted(allMovies, key=getTitle)
    movieRows = [extractFieldsForCSV2(movie) for movie in sortedMovies]
    csvUtils.saveAsCsv(DIST_CSV_FILEPATH_2, DIST_CSV_HEADERS_2, movieRows)
Ejemplo n.º 8
0
def createMovieCSV1():
    allMovies = fetchAllMovies()
    movieRows = [extractFieldsForCSV1(movie) for movie in allMovies]
    csvUtils.saveAsCsv(DIST_CSV_FILEPATH_1, DIST_CSV_HEADERS_1, movieRows)
Ejemplo n.º 9
0
def createMovieCSV():
    allMovies = fetchAllMovies()
    movieRows = [movie.__dict__ for movie in allMovies]

    csvUtils.saveAsCsv(DIST_CSV_FILEPATH, DIST_CSV_HEADERS, movieRows)