{"id":20560332,"url":"https://github.com/ahmadyousif89/airbnb_clone_v4","last_synced_at":"2026-04-18T17:36:08.758Z","repository":{"id":242606729,"uuid":"809516686","full_name":"AhmadYousif89/AirBnB_clone_v4","owner":"AhmadYousif89","description":"ALX | Airbnb Clone Project","archived":false,"fork":false,"pushed_at":"2024-11-15T16:09:35.000Z","size":1463,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T07:47:27.038Z","etag":null,"topics":["airbnb","flask","mysql","sqlalchemy","unittest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AhmadYousif89.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-02T22:46:44.000Z","updated_at":"2024-11-15T16:09:40.000Z","dependencies_parsed_at":"2024-06-04T01:44:27.257Z","dependency_job_id":"95acb3e6-3c65-4625-b7b6-b527e4102d6e","html_url":"https://github.com/AhmadYousif89/AirBnB_clone_v4","commit_stats":null,"previous_names":["ahmadyousif89/airbnb_clone_v4"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AhmadYousif89/AirBnB_clone_v4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmadYousif89%2FAirBnB_clone_v4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmadYousif89%2FAirBnB_clone_v4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmadYousif89%2FAirBnB_clone_v4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmadYousif89%2FAirBnB_clone_v4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AhmadYousif89","download_url":"https://codeload.github.com/AhmadYousif89/AirBnB_clone_v4/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AhmadYousif89%2FAirBnB_clone_v4/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31978421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T17:30:12.329Z","status":"ssl_error","status_checked_at":"2026-04-18T17:29:59.069Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airbnb","flask","mysql","sqlalchemy","unittest"],"created_at":"2024-11-16T03:54:15.315Z","updated_at":"2026-04-18T17:36:08.721Z","avatar_url":"https://github.com/AhmadYousif89.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ccenter\u003e \u003ch1\u003eHBNB - The Console\u003c/h1\u003e \u003c/center\u003e\n\n![project_logo](./assets/hbnb.png)\n\n## Introduction\n\nThe AirBnB clone is a full-stack web application that integrats a database storage, a back-end API, and a front-end interface.\nThis project is part of the (Alx) Holberton School Software Engineering program.\n\nThis repository contains the initial stage of a student project to build a clone of the AirBnB website. This stage implements a backend interface, or console, to manage program data. Console commands allow the user to create, update, and destroy objects, as well as manage file storage. Using a system of JSON serialization/deserialization, storage is persistent between sessions.\n\n---\n\n\u003ccenter\u003e\u003ch3\u003eRepository Contents by Project Task\u003c/h3\u003e \u003c/center\u003e\n\n| Tasks                         | Files                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Description                                                                                         |\n| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |\n| 0: Authors/README File        | [AUTHORS](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/AUTHORS)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Project authors                                                                                     |\n| 1: Pep8                       | N/A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | All code is pep8 compliant                                                                          |\n| 2: Unit Testing               | [/tests](https://github.com/AhmadYousif89/AirBnB_clone_v2/tree/main/tests)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | All class-defining modules are unittested                                                           |\n| 3. Make BaseModel             | [/models/base_model.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/base_model.py)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Defines a parent class to be inherited by all model classes                                         |\n| 4. Update BaseModel w/ kwargs | [/models/base_model.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/base_model.py)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Add functionality to recreate an instance of a class from a dictionary representation               |\n| 5. Create FileStorage class   | [/models/engine/file_storage.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/engine/file_storage.py) [/models/\\_ _init_ \\_.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/__init__.py) [/models/base_model.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/base_model.py)                                                                                                                                                                                                                                                | Defines a class to manage persistent file storage system                                            |\n| 6. Console 0.0.1              | [console.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/console.py)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Add basic functionality to console program, allowing it to quit, handle empty lines and ^D          |\n| 7. Console 0.1                | [console.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/console.py)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Update the console with methods allowing the user to create, destroy, show, and update stored data  |\n| 8. Create User class          | [console.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/console.py) [/models/engine/file_storage.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/engine/file_storage.py) [/models/user.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/user.py)                                                                                                                                                                                                                                                                                 | Dynamically implements a user class                                                                 |\n| 9. More Classes               | [/models/user.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/user.py) [/models/place.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/place.py) [/models/city.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/city.py) [/models/amenity.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/amenity.py) [/models/state.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/state.py) [/models/review.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/review.py) | Dynamically implements more classes                                                                 |\n| 10. Console 1.0               | [console.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/console.py) [/models/engine/file_storage.py](https://github.com/AhmadYousif89/AirBnB_clone_v2/blob/main/models/engine/file_storage.py)                                                                                                                                                                                                                                                                                                                                                                              | Update the console and file storage system to work dynamically with all classes update file storage |\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Get Started\n\n\u003cbr\u003e\n\n1. Start by cloning this project:\n\n```sh\ngit clone https://github.com/AhmadYousif89/AirBnB_clone.git\ncd AirBnB_clone\n```\n\n2. Once the repository is cloned locate the \"console.py\" file and run it as follows:\n\n```sh\n/AirBnB_clone$ ./console.py\n```\n\n4. When this command is run the following prompt should appear:\n\n```sh\nWelcome to Airbnb console.  Type help or ? to list commands.\n\n(hbnb)\n```\n\n5. This prompt designates you are in the \"**hbnb**\" console. There are a variety of commands available within the console program.\n\n##### Commands\n\n    -\u003e create - Creates an instance based on given class\n\n    -\u003e show - Shows an object based on class and UUID\n\n    -\u003e all - Shows all objects the program has access to, or all objects of a given class\n\n    -\u003e update - Updates existing attributes or adds new to an object based on its class name and id\n\n    -\u003e destroy - Destroys an object based on class and UUID\n\n    -\u003e count - Counts the number of created objects for a given class or all classes\n\n    -\u003e quit - Exits the program (EOF will as well)\n\n##### Alternative Syntax\n\nUsers are able to issue a number of console command using an alternative syntax:\n\n    Usage: \u003cclass_name\u003e.\u003ccommand\u003e([\u003cid\u003e[name_arg value_arg]|[kwargs]])\n\nAdvanced syntax is implemented for the following commands:\n\n    * create\n    * all\n    * count\n    * show\n    * destroy\n    * update\n\n\u003cbr\u003e\n\n## Project Overview\n\n\u003cbr\u003e\n\nThis is an overview diagram representing the project workflow.\n\n![diagram](./assets/diagram.png)\n\n\u003cbr\u003e\n\n\u003ccenter\u003e \u003ch2\u003eExamples\u003c/h2\u003e \u003c/center\u003e\n\nExamples of using the console both interactively and non-interactively:\n\n- Interactive mode:\n\n```sh\n$ ./console.py\nWelcome to the airbnb console.  Type help or ? to list commands.\n\n(hbnb) help\n\nDocumented commands (type help \u003ctopic\u003e):\n========================================\nEOF  all count  create  destroy  help  quit  show  update\n\n(hbnb) help create\nCreates a class of any type\n[Usage]: create \u003cclassName\u003e\n\n(hbnb) quit\n$\n```\n\n- Non-interactive mode:\n\n```sh\n$ echo 'help' | ./console.py\nWelcome to the airbnb console.  Type help or ? to list commands.\n\n(hbnb)\nDocumented commands (type help \u003ctopic\u003e):\n========================================\nEOF  all count  create  destroy  help  quit  show  update\n\n(hbnb)\n$\n```\n\n```sh\n$ echo 'help create' | ./console.py\nWelcome to the airbnb console.  Type help or ? to list commands.\n\nCreates a class of any type\n[Usage]: create \u003cclassName\u003e\n\n(hbnb)\n$\n```\n\n\u003cbr\u003e\n\n\u003ch3\u003ePrimary Command Syntax\u003c/h3\u003e\n\n###### Example 0: Create an object\n\nUsage: create \u003cclass_name\u003e\n\n```sh\n(hbnb) create BaseModel\n```\n\n```sh\n(hbnb) create BaseModel\n3aa5babc-efb6-4041-bfe9-3cc9727588f8\n(hbnb)\n```\n\n###### Example 1: Show an object\n\nUsage: show \u003cclass_name\u003e \u003c\\_id\u003e\n\n```sh\n(hbnb) show BaseModel 3aa5babc-efb6-4041-bfe9-3cc9727588f8\n[BaseModel] (3aa5babc-efb6-4041-bfe9-3cc9727588f8) {'id': '3aa5babc-efb6-4041-bfe9-3cc9727588f8', 'created_at': datetime.datetime(2020, 2, 18, 14, 21, 12, 96959),\n'updated_at': datetime.datetime(2020, 2, 18, 14, 21, 12, 96971)}\n(hbnb)\n```\n\n###### Example 2: Destroy an object\n\nUsage: destroy \u003cclass_name\u003e \u003c\\_id\u003e\n\n```sh\n(hbnb) destroy BaseModel 3aa5babc-efb6-4041-bfe9-3cc9727588f8\n(hbnb) show BaseModel 3aa5babc-efb6-4041-bfe9-3cc9727588f8\n** no instance found **\n(hbnb)\n```\n\n###### Example 3: Update an object\n\nUsage: update \u003cclass_name\u003e \u003c\\_id\u003e\n\n```sh\n(hbnb) update BaseModel b405fc64-9724-498f-b405-e4071c3d857f first_name \"person\"\n(hbnb) show BaseModel b405fc64-9724-498f-b405-e4071c3d857f\n[BaseModel] (b405fc64-9724-498f-b405-e4071c3d857f) {'id': 'b405fc64-9724-498f-b405-e4071c3d857f', 'created_at': datetime.datetime(2020, 2, 18, 14, 33, 45, 729889),\n'updated_at': datetime.datetime(2020, 2, 18, 14, 33, 45, 729907), 'first_name': 'person'}\n(hbnb)\n```\n\n\u003ch3\u003eAlternative Syntax\u003c/h3\u003e\n\n###### Example 0: Show all User objects\n\nUsage: \u003cclass_name\u003e.all()\n\n```sh\n(hbnb) User.all()\n[\"[User] (99f45908-1d17-46d1-9dd2-b7571128115b) {'updated_at': datetime.datetime(2020, 2, 19, 21, 47, 34, 92071), 'id': '99f45908-1d17-46d1-9dd2-b7571128115b', 'created_at': datetime.datetime(2020, 2, 19, 21, 47, 34, 92056)}\", \"[User] (98bea5de-9cb0-4d78-8a9d-c4de03521c30) {'updated_at': datetime.datetime(2020, 2, 19, 21, 47, 29, 134362), 'id': '98bea5de-9cb0-4d78-8a9d-c4de03521c30', 'created_at': datetime.datetime(2020, 2, 19, 21, 47, 29, 134343)}\"]\n```\n\n###### Example 1: Destroy a User\n\nUsage: \u003cclass_name\u003e.destroy(\u003c\\_id\u003e)\n\n```sh\n(hbnb) User.destroy(\"99f45908-1d17-46d1-9dd2-b7571128115b\")\n(hbnb)\n(hbnb) User.all()\n(hbnb) [\"[User] (98bea5de-9cb0-4d78-8a9d-c4de03521c30) {'updated_at': datetime.datetime(2020, 2, 19, 21, 47, 29, 134362), 'id': '98bea5de-9cb0-4d78-8a9d-c4de03521c30', 'created_at': datetime.datetime(2020, 2, 19, 21, 47, 29, 134343)}\"]\n```\n\n###### Example 2: Update User (by attribute)\n\nUsage: \u003cclass_name\u003e.update(\u003c\\_id\u003e, \u003cattribute_name\u003e, \u003cattribute_value\u003e)\n\n```sh\n(hbnb) User.update(\"98bea5de-9cb0-4d78-8a9d-c4de03521c30\", name \"Todd the Toad\")\n(hbnb)\n(hbnb) User.all()\n(hbnb) [\"[User] (98bea5de-9cb0-4d78-8a9d-c4de03521c30) {'updated_at': datetime.datetime(2020, 2, 19, 21, 47, 29, 134362), 'id': '98bea5de-9cb0-4d78-8a9d-c4de03521c30', 'name': 'Todd the Toad', 'created_at': datetime.datetime(2020, 2, 19, 21, 47, 29, 134343)}\"]\n```\n\n###### Example 3: Update User (by dictionary)\n\nUsage: \u003cclass_name\u003e.update(\u003c\\_id\u003e, \u003cdictionary\u003e)\n\n```sh\n(hbnb) User.update(\"98bea5de-9cb0-4d78-8a9d-c4de03521c30\", {'name': 'Fred the Frog', 'age': 9})\n(hbnb)\n(hbnb) User.all()\n(hbnb) [\"[User] (98bea5de-9cb0-4d78-8a9d-c4de03521c30) {'updated_at': datetime.datetime(2020, 2, 19, 21, 47, 29, 134362), 'name': 'Fred the Frog', 'age': 9, 'id': '98bea5de-9cb0-4d78-8a9d-c4de03521c30', 'created_at': datetime.datetime(2020, 2, 19, 21, 47, 29, 134343)}\"]\n```\n\n\u003cbr\u003e\n\n## Testing\n\n\u003cbr\u003e\n\n```sh\n$ python3 -m unittest discover tests/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmadyousif89%2Fairbnb_clone_v4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmadyousif89%2Fairbnb_clone_v4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmadyousif89%2Fairbnb_clone_v4/lists"}