{"id":24462362,"url":"https://github.com/tsohledev/airbnb_clone","last_synced_at":"2025-03-14T10:24:31.603Z","repository":{"id":67884056,"uuid":"600950651","full_name":"tsohleDev/AirBnB_clone","owner":"tsohleDev","description":"Alx project to re-create AirBnB","archived":false,"fork":false,"pushed_at":"2024-03-16T02:29:42.000Z","size":88,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T04:32:19.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsohleDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-02-13T03:15:02.000Z","updated_at":"2024-01-15T03:18:34.000Z","dependencies_parsed_at":"2024-03-22T09:30:53.292Z","dependency_job_id":null,"html_url":"https://github.com/tsohleDev/AirBnB_clone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsohleDev%2FAirBnB_clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsohleDev%2FAirBnB_clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsohleDev%2FAirBnB_clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsohleDev%2FAirBnB_clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsohleDev","download_url":"https://codeload.github.com/tsohleDev/AirBnB_clone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243559959,"owners_count":20310827,"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":[],"created_at":"2025-01-21T04:32:16.637Z","updated_at":"2025-03-14T10:24:31.572Z","avatar_url":"https://github.com/tsohleDev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AirBnB clone\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://i.imgur.com/JOhaZ5m.png\"\u003e\n\u003c/p\u003e\n\n## Description\n\nThis team project is part of the Alx accelerator program.\nThis first step consists of a custom command-line interface for data management, and the base classes for the storage of this data.\n\n## Usage\n\nThe console works both in interactive mode and non-interactive mode, much like a Unix shell.\nIt prints a prompt **(hbnb)** and waits for the user for input.\n\nCommand | Example\n------- | -------\nRun the console | ```./console.py```\nQuit the console | ```(hbnb) quit```\nDisplay the help for a command | ```(hbnb) help \u003ccommand\u003e```\nCreate an object (prints its id)| ```(hbnb) create \u003cclass\u003e```\nShow an object | ```(hbnb) show \u003cclass\u003e \u003cid\u003e``` or ```(hbnb) \u003cclass\u003e.show(\u003cid\u003e)```\nDestroy an object | ```(hbnb) destroy \u003cclass\u003e \u003cid\u003e``` or ```(hbnb) \u003cclass\u003e.destroy(\u003cid\u003e)```\nShow all objects, or all instances of a class | ```(hbnb) all``` or ```(hbnb) all \u003cclass\u003e```\nUpdate an attribute of an object | ```(hbnb) update \u003cclass\u003e \u003cid\u003e \u003cattribute name\u003e \"\u003cattribute value\u003e\"``` or ```(hbnb) \u003cclass\u003e.update(\u003cid\u003e, \u003cattribute name\u003e, \"\u003cattribute value\u003e\")```\n\nNon-interactive mode example\n\n```bash\n$ echo \"help\" | ./console.py\n(hbnb)\n\nDocumented commands (type help \u003ctopic\u003e):\n========================================\nEOF  all  count  create  destroy  help  quit  show  update\n```\n\n## Models\n\nThe folder [models](./models/) contains all the classes used in this project.\n\nFile | Description | Attributes\n---- | ----------- | ----------\n[base_model.py](./models/base_model.py) | BaseModel class for all the other classes | id, created_at, updated_at\n[user.py](./models/user.py) | User class for future user information | email, password, first_name, last_name\n[amenity.py](./models/amenity.py) | Amenity class for future amenity information | name\n[city.py](./models/city.py) | City class for future location information | state_id, name\n[state.py](./models/state.py) | State class for future location information | name\n[place.py](./models/place.py) | Place class for future accomodation information | city_id, user_id, name, description, number_rooms, number_bathrooms, max_guest, price_by_night, latitude, longitude, amenity_ids\n[review.py](./models/review.py) | Review class for future user/host review information | place_id, user_id, text\n\n## File storage\n\nThe folder [engine](./models/engine/) manages the serialization and deserialization of all the data, following a JSON format.\n\nA FileStorage class is defined in [file_storage.py](./models/engine/file_storage.py) with methods to follow this flow:\n```\u003cobject\u003e -\u003e to_dict() -\u003e \u003cdictionary\u003e -\u003e JSON dump -\u003e \u003cjson string\u003e -\u003e FILE -\u003e \u003cjson string\u003e -\u003e JSON load -\u003e \u003cdictionary\u003e -\u003e \u003cobject\u003e```\n\nThe [__init__.py](./models/__init__.py) file contains the instantiation of the FileStorage class called **storage**, followed by a call to the method reload() on that instance.\nThis allows the storage to be reloaded automatically at initialization, which recovers the serialized data.\n\n## Tests\n\nAll the code is tested with the **unittest** module.\nThe test for the classes are in the [test_models](./tests/test_models/) folder.\n\n## Authors\n- [Tsohle Mokhemisi](https://github.com/tsohledev) \n\n~ [LinkedIn](https://www.linkedin.com/in/tsohle) \n\n~ [Twitter](https://twitter.com/Realtsohle)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsohledev%2Fairbnb_clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsohledev%2Fairbnb_clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsohledev%2Fairbnb_clone/lists"}