Giter Club home page Giter Club logo

pyp-u2-c2-football-csv-iterators's Introduction

Football Iterators

Today we will be building a custom iterator. We are going to create a program for searching football(soccer) statistics from within a CSV(comma separated values) file. We will be using Python's builtin CSV module for handling file processing duties, documentation available here: https://docs.python.org/3/library/csv.html Note: There is an example for basic csv reading listed under the reader method.

Your code will reside in the #explorer.py file, the models.py file is provided for you and does not need to be altered.

The public interface to your program will be the FootballExplorer class. The __init__ for this class takes a single parameter, the filename for the csv file to read. The class should also have two methods as part of its public interface: all and search

all takes no parameters and should return an iterator that contains all the records from the csv file as Player objects.

search four optional parameters: country, year, age, and position If none of these parameters are given it should raise a ValueError. The search method should return an iterator that contains all the records from the csv file that match the given parameters as Player objects.

It may make things easier to create a base iterator class for returning all records and then have a child class inherit from that for handling filtering search results.

pyp-u2-c2-football-csv-iterators's People

Contributors

santiagobasulto avatar ivanzugnoni avatar jsymons avatar naveeda11 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.