This console application is designed for managing a library of books. The application allows you to add, remove, search, and display books, as well as change their status.
- Add a Book: Enter the title, author, and year of publication.
- Remove a Book: Remove a book by its unique identifier.
- Search for a Book: Search by title, author, or year of publication.
- Display All Books: Display a list of all books with detailed information.
- Change Book Status: Update the status of a book to "available" or "checked out".
- Data Storage: Data is stored in JSON format.
- Error Handling: Proper handling of exceptions and errors.
- Object-Oriented Approach: Code is organized according to SOLID principles and Clean Architecture.
-
Clone the repository:
git clone https://github.com/sixtis1/test-task.git
-
Navigate to the project directory:
cd test-task -
Create a virtual environment (recommended):
python -m venv venv
-
Activate the virtual environment:
-
On Windows:
venv\Scripts\activate
-
On Unix or MacOS:
source venv/bin/activate
-
python main.pylibrary-management-system/
├── entities/
│ └── book.py
├── use_cases/
│ └── library.py
├── interfaces/
│ └── console_interface.py
├── tests/
│ └── test_library.py
├── library.json
├── main.py
└── README.md- entities: Contains domain entities (the Book class).
- use_cases: Contains the business logic of the application (the Library class).
- interfaces: Contains interfaces for user interaction.
- tests: Contains unit tests for the application.
- library.json: File for storing book data.
- main.py: Entry point of the application.
To run the tests, execute:
python -m unittest discover -s tests