AirBnB logo AirBnB clone

holberton logo

Description 💬

in this project a console of the Airbnb web application is recreated, the tools used for the completion of the project were:
AirBnB logo python3
AirBnB logo json files where a database is simulated and also serves to translate data between languages
AirBnB logo PyCodeStyle

📃 Storage

Storage is defined as an instance of FileStorage, it is in charge of loading and reloading a class instance that is stored in a json file that works as a database.

💻 Console

the console is the first version of a web application, we use it to interact with the Back-End and to manage a database that is in json file format.

👨🏻‍💻 command interpreter

Commands Usage
help displays all commands
quit and EOF exit the program
create Creates a new instance
show displays the dictionary of the json file
destroy Deletes an instance based on the class name and id
all returns the dictionary that is stored in the json file
update add or update attributes in the json file

AirBnB logo Design Hbnb v.1

Execution

$ ./console.py

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

(hbnb) 
(hbnb) 
(hbnb) quit
$

How use it

$./console.py

(hbnb) create BaseModel
49faff9a-6318-451f-87b6-910505c55907
(hbnb) all BaseModel
["[BaseModel] (49faff9a-6318-451f-87b6-910505c55907) {'created_at': datetime.datetime(2017, 10, 2, 3, 10, 25, 903293), 'id': '49faff9a-6318-451f-87b6-910505c55907', 'updated_at': datetime.datetime(2017, 10, 2, 3, 10, 25, 903300)}"]
(hbnb) show BaseModel 49faff9a-6318-451f-87b6-910505c55907

[BaseModel] (49faff9a-6318-451f-87b6-910505c55907) {'created_at': datetime.datetime(2017, 10, 2, 3, 10, 25, 903293), 'id': '49faff9a-6318-451f-87b6-910505c55907', 'updated_at': datetime.datetime(2017, 10, 2, 3, 10, 25, 903300)}
(hbnb) update BaseModel 49faff9a-6318-451f-87b6-910505c55907 first_name "Betty"
(hbnb) update BaseModel 49faff9a-6318-451f-87b6-910505c55907 first_name "Betty"

Authors