Welcome to the AirBnB-clone project, the AirBnB Clone! This project focuses on creating a backend system for an AirBnB-like application, complete with a command-line interface for managing objects, data serialization, and a file-based storage system. The primary goals include building a Python package, creating a command interpreter, implementing unit testing, and mastering serialization and deserialization techniques.
The project consists of the following key components:
- A base class for object management.
- Initializes instance attributes and handles data serialization and deserialization.
- Defines a serialization flow to set up data serialization and deserialization.
- Uses a file-based storage system to persistently store data in JSON format.
- Implements a storage engine for efficient handling of instances.
- Utilizes a JSON file for storing and retrieving object data.
- Ensures code quality through comprehensive unit testing.
- Verifies the functionality of various components and classes.
- Acts as a custom command-line tool for handling objects.
- Supports commands for creating, retrieving, updating, and deleting objects.
- Enables various operations on objects through a user-friendly interface.
Throughout this project, you will:
- Build a Python package and create a command interpreter.
- Understand the importance of unit testing in ensuring code reliability.
- Master serialization and deserialization techniques using JSON data.
- Work with dates, UUIDs, and function arguments effectively.
To set up the project on your local machine for development and testing purposes, follow these steps:
-
Clone the repository from GitHub:
git clone https://github.com/Perpet98Sofia/AirBnB_clone.git
-
Navigate to the cloned directory:
cd AirBnB_clone
Run the console in interactive mode, allowing you to input commands directly:
$ ./console.py
(hbnb) help
Documented commands (type help <topic>):
========================================
EOF help quit
(hbnb)
(hbnb)
(hbnb) quit
$
$ echo "help" | ./console.py
(hbnb)
Documented commands (type help <topic>):
========================================
EOF help quit
(hbnb)
$
$ cat test_help
help
$
$ cat test_help | ./console.py
(hbnb)
Documented commands (type help <topic>):
========================================
EOF help quit
(hbnb)
$
quit or EOF: Exits the program. Usage: By itself.
help: Provides information on how to use a command. Usage: By itself or help .
create: Creates a new instance of a valid class, saves it to the JSON file, and prints the ID. Usage: create .
show: Prints the string representation of an instance based on the class name and ID. Usage: show or .show().
destroy: Deletes an instance based on the class name and ID, saving the change to the JSON file. Usage: destroy or .destroy().
all: Prints all string representations of instances based on the class name. Usage: By itself or all or .all().
update: Updates an instance based on the class name and ID by adding or updating attributes, saving the changes to the JSON file. Usage: update "" or .update(, , ) or .update(, ).
count: Retrieves the number of instances of a class. Usage: .count().
Perpetua Akwiri Otieno | Email: [email protected]
Peter Brian Mwangi | Email: [email protected]