This is the first version of the airbnb clone. It is comprised of a command line interpreter and models.
The interpreter is tasked with interpretation of commands that will allow one to create model objects, interact with them and save them to a file when done. The saved objects can be reloaded once the user logs in to the command line again later on.
The parent class is the BaseModel
. All the other models will extend it.
Other classes that will be implemented are Review
, User
, Place
, Amenity
, PlaceAmenity
, State
and City
Command | Sample Usage | Functionality |
---|---|---|
help |
help |
displays all commands available |
create |
create <class> |
creates new object (ex. a new User, Place) |
update |
User.update('123', {'name' : 'Sam'}) |
updates attribute of an object |
destroy |
User.destroy('123') |
destroys specified object |
show |
User.show('123') |
retrieve an object from a file, a database |
all |
User.all() |
display all objects in class |
count |
User.count() |
returns count of objects in specified class |
quit |
quit |
exit the shell |
Interactive Mode
$ ./console.py
(hbnb) help
Documented commands (type help <topic>):
========================================
EOF help quit
(hbnb)
(hbnb)
(hbnb) quit
$
Non-Interactive Mode
$ echo "help" | ./console.py
(hbnb)
Documented commands (type help <topic>):
========================================
EOF help quit
(hbnb)
$
$ cat test_help
help
$
$ cat test_help | ./console.py
(hbnb)
Documented commands (type help <topic>):
========================================
EOF help quit
(hbnb)
$
- Operating System: Ubuntu 20.04 LTS
- Language: Python 3.8.10
- Style guidelines:
- pycodestyle 2.8.0
- google python style guidelines
- w3c validator(implementation is in web_static/w3c_validator.py) which uses the w3c api for w3c standards conformity checking
./web_static/w3c_validator.py <html file>