The console is the initial part of the AirBnB project at Holberton School, focusing on higher-level programming. The project's goal is to eventually deploy a simplified AirBnB website (HBnB). This console acts as a command interpreter to manage objects for the HBnB site.
- Create new objects (e.g., User, Place)
- Retrieve objects from storage
- Perform operations on objects (e.g., count, compute stats)
- Update object attributes
- Destroy objects
Tested on Ubuntu 14.04 LTS using Python 3.4.3.
- Clone this repository:
git clone "https://github.com/alexaorrico/AirBnB_clone.git"
- Navigate to the directory:
cd AirBnB_clone
- Run interactively:
./console
- Run non-interactively:
echo "<command>" | ./console.py
-
console.py: Entry point for the command interpreter.
- Commands:
EOF
,quit
,<emptyline>
,create
,destroy
,show
,all
,update
- Commands:
-
models/: Contains classes for this project.
- base_model.py: BaseModel class (foundation for other classes)
- Derived classes: amenity.py, city.py, place.py, review.py, state.py, user.py
-
models/engine: Handles JSON serialization and deserialization.
- file_storage.py: Manages storage and retrieval of objects.
-
tests/: Contains unit tests for the project.
- Example: test_base_model.py
$ ./console.py
(hbnb) help
Documented commands (type help <topic>):
========================================
EOF all create destroy help quit show update
(hbnb) create BaseModel
7da56403-cc45-4f1c-ad32-bfafeb2bb050
(hbnb) all BaseModel
[[BaseModel] (7da56403-cc45-4f1c-ad32-bfafeb2bb050) {...}]
(hbnb) quit
No known bugs.
Author
- Dagmawi Yohannes
License