{"id":21666989,"url":"https://github.com/princexz/airbnb_clone_v3","last_synced_at":"2026-05-05T19:32:21.279Z","repository":{"id":174658238,"uuid":"652572706","full_name":"Princexz/AirBnB_clone_v3","owner":"Princexz","description":"🗃️ The AirBnB clone MySQL","archived":false,"fork":false,"pushed_at":"2023-06-20T08:36:35.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T06:48:01.752Z","etag":null,"topics":["clone","css-grid","puppet-modules-internal","python-script","shell-script"],"latest_commit_sha":null,"homepage":"https://princexz.github.io/me/","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/Princexz.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":"2023-06-12T10:50:41.000Z","updated_at":"2024-11-10T17:32:15.000Z","dependencies_parsed_at":"2023-07-30T04:46:14.392Z","dependency_job_id":null,"html_url":"https://github.com/Princexz/AirBnB_clone_v3","commit_stats":null,"previous_names":["princexz/airbnb_clone_v2","princexz/airbnb_clone_v3"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Princexz%2FAirBnB_clone_v3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Princexz%2FAirBnB_clone_v3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Princexz%2FAirBnB_clone_v3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Princexz%2FAirBnB_clone_v3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Princexz","download_url":"https://codeload.github.com/Princexz/AirBnB_clone_v3/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244566931,"owners_count":20473451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["clone","css-grid","puppet-modules-internal","python-script","shell-script"],"created_at":"2024-11-25T11:31:52.284Z","updated_at":"2025-10-03T13:11:26.128Z","avatar_url":"https://github.com/Princexz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project 0x02. AirBnB clone - MySQL :computer:\n\n## :page_facing_up: In this project we created version 2 of the Airbnb Clone where we will connect with the databases to continue with the advancement of it.\n\n### 📋 Requirements\n***\n#### Python Scripts\n\n* Allowed editors: `vi`, `vim`, `emacs`.\n* Files will be interpreted/compiled on Ubuntu 20.04 LTS using python3 (version 3.8.5).\n* Files must be executable.\n* The length of your files will be tested using `wc`.\n\n#### Python Unit Tests\n\n* All your test files should be inside a folder `tests`.\n* You have to use the unittest module.\n* All your test files should be python files (extension: `.py`).\n* All your test files and folders should start by `test_`.\n* Your file organization in the tests folder should be the same as your project: ex: for `models/base_model.py`, unit tests must be in: `tests/test_models/test_base_model.py`.\n\n#### SQL Scripts\n\n* Files will be executed on Ubuntu 20.04 LTS using `MySQL 8.0`.\n* Files will be executed with `SQLAlchemy` version `1.4.x`.\n* All SQL keywords should be in uppercase (`SELECT`, `WHERE`…).\n* The length of your files will be tested using `wc`.\n\n### 🎨 Style\n***\n* Code should use the PEP 8 style (version 2.7.*).\n\n#### Comments for your SQL file:\n\n```SQL\n$ cat my_script.sql\n-- first 3 students in the Batch ID=3\n-- because Batch 3 is the best!\nSELECT id, name FROM students WHERE batch_id = 3 ORDER BY created_at DESC LIMIT 3;\n$\n```\n\n\u003ccenter\u003e \u003ch1\u003eHBNB - The Console\u003c/h1\u003e \u003c/center\u003e\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/justinmajetich/AirBnB_clone/blob/dev/AUTHORS) | Project authors |\n| 1: Pep8 | N/A | All code is pep8 compliant|\n| 2: Unit Testing | [/tests](https://github.com/justinmajetich/AirBnB_clone/tree/dev/tests) | All class-defining modules are unittested |\n| 3. Make BaseModel | [/models/base_model.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/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/justinmajetich/AirBnB_clone/blob/dev/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/justinmajetich/AirBnB_clone/blob/dev/models/engine/file_storage.py) [/models/_ _init_ _.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/models/__init__.py) [/models/base_model.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/models/base_model.py) | Defines a class to manage persistent file storage system|\n| 6. Console 0.0.1 | [console.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/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/justinmajetich/AirBnB_clone/blob/dev/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/justinmajetich/AirBnB_clone/blob/dev/console.py) [/models/engine/file_storage.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/models/engine/file_storage.py) [/models/user.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/models/user.py) | Dynamically implements a user class |\n| 9. More Classes | [/models/user.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/models/user.py) [/models/place.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/models/place.py) [/models/city.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/models/city.py) [/models/amenity.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/models/amenity.py) [/models/state.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/models/state.py) [/models/review.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/models/review.py) | Dynamically implements more classes |\n| 10. Console 1.0 | [console.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/console.py) [/models/engine/file_storage.py](https://github.com/justinmajetich/AirBnB_clone/blob/dev/models/engine/file_storage.py) | Update the console and file storage system to work dynamically with all  classes update file storage |\n\u003cbr\u003e\n\u003cbr\u003e\n\u003ccenter\u003e \u003ch2\u003eGeneral Use\u003c/h2\u003e \u003c/center\u003e\n\n1. First clone this repository.\n\n3. Once the repository is cloned locate the \"console.py\" file and run it as follows:\n```\n/AirBnB_clone$ ./console.py\n```\n4. When this command is run the following prompt should appear:\n```\n(hbnb)\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    * create - Creates an instance based on given class\n\n    * destroy - Destroys an object based on class and UUID\n\n    * show - Shows an object based on class and UUID\n\n    * all - Shows all objects the program has access to, or all objects of a given class\n\n    * update - Updates existing attributes an object based on class name and UUID\n\n    * quit - Exits the program (EOF will as well)\n\n\n##### Alternative Syntax\nUsers are able to issue a number of console command using an alternative syntax:\n\n\tUsage: \u003cclass_name\u003e.\u003ccommand\u003e([\u003cid\u003e[name_arg value_arg]|[kwargs]])\nAdvanced syntax is implemented for the following commands: \n\n    * all - Shows all objects the program has access to, or all objects of a given class\n\n\t* count - Return number of object instances by class\n\n    * show - Shows an object based on class and UUID\n\n\t* destroy - Destroys an object based on class and UUID\n\n    * update - Updates existing attributes an object based on class name and UUID\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003ccenter\u003e \u003ch2\u003eExamples\u003c/h2\u003e \u003c/center\u003e\n\u003ch3\u003ePrimary Command Syntax\u003c/h3\u003e\n\n###### Example 0: Create an object\nUsage: create \u003cclass_name\u003e\n```\n(hbnb) create BaseModel\n```\n```\n(hbnb) create BaseModel\n3aa5babc-efb6-4041-bfe9-3cc9727588f8\n(hbnb)                   \n```\n###### Example 1: Show an object\nUsage: show \u003cclass_name\u003e \u003c_id\u003e\n\n```\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###### Example 2: Destroy an object\nUsage: destroy \u003cclass_name\u003e \u003c_id\u003e\n```\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###### Example 3: Update an object\nUsage: update \u003cclass_name\u003e \u003c_id\u003e\n```\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\u003ch3\u003eAlternative Syntax\u003c/h3\u003e\n\n###### Example 0: Show all User objects\nUsage: \u003cclass_name\u003e.all()\n```\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\nUsage: \u003cclass_name\u003e.destroy(\u003c_id\u003e)\n```\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###### Example 2: Update User (by attribute)\nUsage: \u003cclass_name\u003e.update(\u003c_id\u003e, \u003cattribute_name\u003e, \u003cattribute_value\u003e)\n```\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###### Example 3: Update User (by dictionary)\nUsage: \u003cclass_name\u003e.update(\u003c_id\u003e, \u003cdictionary\u003e)\n```\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\u003cbr\u003e\n\t\n\t\n## Author: :black_nib:\n\n* [ShadowP] [ShadowP2066](https://github.com/ShadowP2066)\n\n## Acknowledgements :pray:\n\nAll work contained in this project was completed as part of the curriculum for the ALX-SE programme. ALX Africa is an online full-stack software engineering program that prepares students for careers in the tech industry using project-based peer learning. For more information, visit [this link](https://www.alxafrica.com//):\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"http://www.alxafrica.com/wp-content/uploads/2022/01/header-logo.png\"\n    alt=\"ALX Africa Logo\"\n  \u003e\n  \u003c/p\u003e\n\n\t\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincexz%2Fairbnb_clone_v3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprincexz%2Fairbnb_clone_v3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincexz%2Fairbnb_clone_v3/lists"}