GithubHelp home page GithubHelp logo

airbnb_clone's Introduction

AirBnB_clone

The AirBnB clone utilizes higher level programming skills to deploy a copy of the AirBnB website.

Web Static

The web static starts building the front end of the AirBnB clone website through simple HTML static pages and style guides.

Console

The console is a command interpreter that manages all AirBnB objects.

Using the Console

Interactive Mode

Starting on Interactive Mode

Run ./console.pyto begin a session.

A prompt (hbnb) should appear where you can type commands followed by a new line. After the command is run, you will be reprompted. Empty lines also reprompt the user. Type help to get a list of available commands. Type quit to end the session.

$ ./console.py
(hbnb) help

Documented commands (type help <topic>):
========================================
EOF  help  quit

(hbnb)
(hbnb)
(hbnb) quit

Non-Interactive Mode

You can also use the console non-interactively.

Starting by using "echo"

You can "pipe" an input into the command by using echo, as seen below:

$ echo "help" | ./console.py
(hbnb)

Documented commands (type help <topic>):
========================================
EOF  help  quit
(hbnb)
Starting with a file of commands

You can also pipe in a file with one command per line, as seen below:

$ cat test_help
help
$
$ cat test_help | ./console.py
(hbnb)

Documented commands (type help <topic>):
========================================
EOF  help  quit
(hbnb)

Console Commands

Typing help <command> or ?<command> will print information on how to utilize each command.

Below is a brief description of each command:

command description
all or all <class> Prints all existing objects. If class_name is specified, prints all existing objects of that class
create <class> Creates a new instance of class_name
show <class> <id> Prints the string representation of the instance by class_name with ID object_id
update <class> <id> <attr_name> <attr_val> Update the attribute attr_name with value attr_val for instance of class_name with ID id
destroy <cls_name> <id> Delete instance of cls_name with ID id
quit Exit the console
EOF Exit the console

Some commands can also be run by calling on the class directly:

command description
<class>.all() Prints all existing objects of that class name
<class>.count() Counts all existing objects of that class
<class>.show("<id>") Prints the string representation of the instance by class_name with ID object_id
<class>.update("<id>", "<attr_name>", "<attr_val>") Update the attribute attr_name with value attr_val for instance of class_name with ID id
<class>.update("<id>", {'<attr_name1>': '<attr_val1>', '<attr_name2>': '<attr_val2>'}) Updates multiple attributes with key/value pairs for instance of class_name with ID id using dictionary representation
<cls_name>.destroy("<id>") Delete instance of cls_name with ID id

Available Classes

The console works with the following classes to manage AirBnB objects:

User
Review
City
Place
State
Amenity

All objects are accessed via storage, an instance of the FileStorage Class, for the above commands to be run. FileStorage Class manages the dictionary of all objects as well as serialization/deserialization of objects to JSON file.

Questions, Comments, Sugestions

If you have questions or suggestions, contact J.I. Cruz at [email protected] or Kelsie Merchant at [email protected]

airbnb_clone's People

Contributors

kmerchan avatar jicruz96 avatar

Watchers

James Cloos 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.