Giter Site home page Giter Site logo

hotel-parser's Introduction

Hotel Parser

About

Simple command-line application to processes CSV files with hotel reviews and output useful statistics for them.

$> py main.py hotel-reviews.csv

   Global Statistics                  Individual Statistics

  ╭───────────────────────────────╮  ╭─────── Bellagio ───────╮ ╭────── Caesars Palace ───────╮ ╭── Circus Circus ───╮
  │ 20 unique hotel(s)            │  │ Score: 4.17/5          │ │ Score: 4.1/5                │ │ Score: 3.23/5      │
  │                               │  │ Stars: 5/5             │ │ Stars: 5/5                  │ │ Stars: 3/5         │
  │ Highest rated hotel(s):       │  │ Reviews: 23            │ │ Reviews: 22                 │ │ Reviews: 22        │
  │         Wynn                  │  │ Rooms: 3933            │ │ Rooms: 3348                 │ │ Rooms: 3773        │
  │                               │  ╰────────────────────────╯ ╰─────────────────────────────╯ ╰────────────────────╯
  │ Number of five-star hotels: 7 │  ╭──────── Encore ────────╮ ╭───────── Excalibur ─────────╮ ╭───── Flamingo ─────╮
  │                               │  │ Score: 4.54/5          │ │ Score: 3.75/5               │ │ Score: 3.96/5      │
  │ Number of hotels w/(a)        │  │ Stars: 5/5             │ │ Stars: 3/5                  │ │ Stars: 3/5         │
  │         Casino: 18            │  │ Reviews: 24            │ │ Reviews: 20                 │ │ Reviews: 24        │
  │         Free internet: 19     │  │ Rooms: 2034            │ │ Rooms: 3981                 │ │ Rooms: 315         │
  │         Gym: 19               │  ╰────────────────────────╯ ╰─────────────────────────────╯ ╰────────────────────╯
  │         Pool: 19              │  ╭───── Hilton Grand ─────╮ ╭───────── Marriott ──────────╮ ╭─── Monte Carlo ────╮
  │         Spa: 15               │  │ Score: 4.17/5          │ │ Score: 4.54/5               │ │ Score: 3.35/5      │
  │         Tennis court: 5       │  │ Stars: 3/5             │ │ Stars: 3/5                  │ │ Stars: 4/5         │
  ╰───────────────────────────────╯  │ Reviews: 24            │ │ Reviews: 24                 │ │ Reviews: 23        │
                                     │ Rooms: 5               │ │ Rooms: 5                    │ │ Rooms: 3003        │
                                     ╰────────────────────────╯ ╰─────────────────────────────╯ ╰────────────────────╯
                                     ╭──────── Paris ─────────╮ ╭───── The Cosmopolitan ──────╮ ╭─── The Cromwell ───╮
                                     │ Score: 4.1/5           │ │ Score: 4.39/5               │ │ Score: 4.08/5      │
                                     │ Stars: 4/5             │ │ Stars: 5/5                  │ │ Stars: 4/5         │
                                     │ Reviews: 21            │ │ Reviews: 23                 │ │ Reviews: 24        │
                                     │ Rooms: 2916            │ │ Rooms: 2959                 │ │ Rooms: 5           │
                                     ╰────────────────────────╯ ╰─────────────────────────────╯ ╰────────────────────╯
                                     ╭───── The Palazzo ──────╮ ╭─────── The Venetian ────────╮ ╭──── The Westin ────╮
                                     │ Score: 4.37/5          │ │ Score: 4.58/5               │ │ Score: 4.05/5      │
                                     │ Stars: 5/5             │ │ Stars: 5/5                  │ │ Stars: 4/5         │
                                     │ Reviews: 19            │ │ Reviews: 24                 │ │ Reviews: 21        │
                                     │ Rooms: 3025            │ │ Rooms: 4027                 │ │ Rooms: 826         │
                                     ╰────────────────────────╯ ╰─────────────────────────────╯ ╰────────────────────╯
                                     ╭─── Treasure Island ────╮ ╭──── Tropicana Las Vegas ────╮ ╭───── Tuscany ──────╮
                                     │ Score: 3.96/5          │ │ Score: 3.9/5                │ │ Score: 4.21/5      │
                                     │ Stars: 4/5             │ │ Stars: 4/5                  │ │ Stars: 3/5         │
                                     │ Reviews: 23            │ │ Reviews: 21                 │ │ Reviews: 24        │
                                     │ Rooms: 2884            │ │ Rooms: 1467                 │ │ Rooms: 716         │
                                     ╰────────────────────────╯ ╰─────────────────────────────╯ ╰────────────────────╯
                                     ╭─────── Wyndham ────────╮ ╭─────────── Wynn ────────────╮
                                     │ Score: 4.38/5          │ │ Score: 4.73/5               │
                                     │ Stars: 3/5             │ │ Stars: 5/5                  │
                                     │ Reviews: 24            │ │ Reviews: 22                 │
                                     │ Rooms: 5               │ │ Rooms: 2700                 │
                                     ╰────────────────────────╯ ╰─────────────────────────────╯

Dependencies

Requires rich and pandas, and their respective dependencies.

Install with:

pip install rich pandas

Usage

main.py [-h] [-a AMENITIES [AMENITIES ...]] [-s SORT] [-desc] path

Positional arguments:

  • path: Path to the CSV file to process. Use quotes "" if it contains spaces.

Options:

  • -h, --help: Show a help message
  • -a, --amenities: List of amenities to display information about. Separate each amenity with spaces and surround with quotes if necessary, e.g.: -a Casino "Free internet" Pool.
  • -s, --sort: Name of a column to sort by. Will sort in ascending order by default. If column is not found, it'll sort by name.
  • -desc, --descending: Sorts in descending order. Without this, it'll sort in ascending order.

hotel-parser's People

Contributors

github-classroom[bot] avatar marsnebulasoup avatar

Watchers

 avatar  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.