in this project a console of the Airbnb web application is recreated, the tools used for the completion of the project were:
python3
json files where a database is simulated and also serves to translate data between languages
PyCodeStyle
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.
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.
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 |
$ ./console.py
$ ./console.py
(hbnb) help
Documented commands (type help <topic>):
========================================
EOF help quit
(hbnb)
(hbnb)
(hbnb) quit
$
$./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"
- Charline Mosquera: char951144@gmail.com
- Andres Solarte: andressolarte2021@gmail.com