Skip to content

debonx/book-rating-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Book Rating System

A simple python software to analyse books and users who have read them. Thanks to addubinski

Classes

User(name, email)

Creates a user object with the following methods:

  • get_email(): returns email address
  • change_email(address): changes user email
  • read_book(book, rating=None): adds book to user and assigns a rating
  • get_average_rating(): returns the user average rating given to books
  • repr(): returns representaiton string
  • eq(other_user): checks for doubled user objects

Book(title: str, isbn: int)

Creates a book object with the following methods:

  • get_title(): returns book title
  • get_isbn(): returns book's isbn
  • set_isbn(): set book's isbn
  • add_rating(rating): assigns rating to the book
  • get_average_rating(): gets average rating given to this book
  • eq(other_book): checks if the book already exists
  • hash(): makes object hashable

Fiction(author)

Subclass of Book() with the following methods:

  • get_author(): returns author of Fiction()
  • repr(): representation of Fiction() object

Non_Fiction(subject, level)

Subclass of Book() with the following methods:

  • get_subject(): returns subject of Non Fiction
  • get_level(): returns level of Non Fiction
  • repr(): representation of Non_Fiction() object

TomeRater()

Class to analyse everything so far. Methods:

  • create_book(title, isbn): creates Book() and returns it
  • create_novel(title, author, isbn): creates Fiction() and returns it
  • create_non_fiction(title, subject, level, isbn): creates Non_Fiction() and returns it
  • add_book_to_user(book, email, rating=None): adds book to a user and gives a rating
  • add_user(name, email, user_books=None): adds a user
  • print_catalog(): prints all books added so far
  • print_users(): prints all users added so far
  • get_most_read_book(): gets the book read more times
  • highest_rated_book(): gets the highest rated book
  • most_positive_user(): returns the users with the most generous ratings

About

Simple book rating system in Python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages