Git Product home page Git Product logo

techin510-lab4's Introduction

TECHIN510-Lab4: Book Explorer App

The Book Explorer is a web application built with Streamlit, designed to query and display books stored in a PostgreSQL database. Users can search for books by name or description and can sort results by rating or price. This application is ideal for quickly accessing detailed information about books, including titles, descriptions, and purchasing details.

Features

  • Search Functionality: Allows users to search for books by title or description.
  • Sorting Options: Users can sort books by rating (numerically adjusted from textual representations) or price.
  • Responsive UI: Uses Streamlit's native components for a clean and responsive user interface.
  • Expandable Descriptions: Each book's details can be expanded in place to save space and improve navigation.

Installation

Prerequisites

Before you begin, ensure you have the following installed:

  • Python (3.6 and above)
  • pip (Python package installer)

User Guide

  • Search: Enter a keyword into the search bar to find books by title or description.
  • Sort: Select your sorting preference from the dropdown menus for both the sort category (rating or price) and the sort order (ascending or descending).
  • View Details: Click on the expander next to each book title to view detailed information about the book, such as the description and purchase URL.

Web screapper

The web scraper is built using Python and makes use of the requests and BeautifulSoup libraries to extract book information from the target website. It navigates through pages, extracts details such as title, description, rating, and pricing, and prepares this data for storage.

Storage

Data scraped from the web is stored in a PostgreSQL database. The database schema is designed to accommodate various book attributes including ratings, prices, and descriptions. This section ensures data integrity and provides a robust query interface.

Ensure your PostgreSQL database is set up with the required books table. Use the following SQL command to create the table if it does not exist:

CREATE TABLE books (
    id SERIAL PRIMARY KEY,
    title TEXT NOT NULL,
    price TEXT,
    rating TEXT,
    url TEXT,
    description TEXT,
    upc TEXT,
    product_type TEXT,
    price_excl_tax TEXT,
    price_incl_tax TEXT,
    tax TEXT,
    availability TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

App

The application layer is built using Streamlit, providing a user-friendly interface to interact with the data. It supports searching, filtering, and sorting functionalities, which enhance the user experience by making information retrieval straightforward and efficient.

techin510-lab4's People

Contributors

wmhst7 avatar

Watchers

 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.