Skip to content

FatChicken277/AirBnB_clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

:feelsgood: AirBnB Clone - Console 👹

This project is the console part of a soon to be fully functional AirBnB clone for the Holberton School academy of coding

🌋 Usage

./console.py # Use this to run the console, after that:
quit # Use this command to quit the console
help <command> # This will display information about the command
create <class> # This will create a new object of the available classes
<class>.<command>(<Optional: id> <Optional: attribute/Dictionary> <Optional: Value>
# This format will allow the user to choose an available class and command while passing parameters  to it
<command> <class> <Optional> #This is an alternative for the previous format to input an available command

👻 Non Interactive example

echo "help" | ./console.py
(hbnb)
Documented commands (type help <topic>):
========================================
EOF  help  quit
(hbnb)

🔍 Avaiable classes (models) and commands

🔑 Commands:

show Displays information about an specific instance of a class: show <class> <id>

all Displays information about all available instances or all instances from an specific class: all <Optional: class>

update Updates the attributes from an specific instance: update <class> <id> <Name of attribute or dictionary -Only available in the other format> <Not necessary in case of dictionary: Value of attribute

destroy Eliminates an instance: destroy <class> <id>

count Displays how many instances of a class are available: count <class>

📚 Classes

BaseModel
User
City
Amenity
State
Place
Review

💾 File Storage

Flow of serialization-deserialization is the following:

<class 'BaseModel'> -> to_dict() -> <class 'dict'> -> JSON dump -> <class 'str'> -> FILE -> <class 'str'> -> JSON load -> <class 'dict'> -> <class 'BaseModel'>

Handled in the engine folder.

📈 Tests

All the tests were made with the module unittest, these are stored in the folder test_models

:shipit: Authors

Alejandro Ramirez

Sebastian Escobar

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published