'0x00. AirBnB clone - The console' group project.
First step: Write a command interpreter to manage your AirBnB objects.
The first step towards building our first full web application: the AirBnB clone: - HTML/CSS templating, database storage, API, front-end integration…
Each tasks are linked and will help to:
- put in place a parent class (called BaseModel) to take care of the initialization, serialization and deserialization of your future instances
- create a simple flow of serialization/deserialization: Instance <-> Dictionary <-> JSON string <-> file
- create all classes used for AirBnB (User, State, City, Place…) that inherit from BaseModel
- create the first abstracted storage engine of the project: File storage.
- create all unittests to validate all our classes and storage engine
To use this application:
- Clone this repo
- cd into it and make console.py executable
cd AirBnB_clone; chmod u+x console.py
- Check below commands for more help
Command | Description |
---|---|
./console.py |
Opens the (hbnb) interpreter |
all |
Prints all string representation of all instances |
create |
Creates a new instance of BaseModel |
destroy |
Deletes an instance based on the class name and id |
show |
Prints the string representation of an instance |
update |
Updates an instance based on the class name and id |
quit |
QUIT command that exits the program |
Launching console.py, checking available commands, and creating a User
$ ./console.py
(hbnb) help
Documented commands (type help <topic>):
========================================
EOF all count create destroy help quit show update
(hbnb) create User
11dff8b8-f77f-4eb0-8535-42553d6155e8
(hbnb)
File | Description |
---|---|
console.py |
Creates the command line intepreter |
models/base_model.py |
Contains a class defining attributes and methods for other classes |
models/engine/file_storage.py |
Contains the class for JSON serialization and deserialization |
tests/ |
All test files to test files, classes, functions with unit tests |
- No known bugs
AUTHOR | ||
---|---|---|
Mahlet Seifu |
[email protected] | @Mahlet Seifu |
@gmail.com |
No special licenses needed