This FastAPI-based Bookstore API provides endpoints to manage a collection of books. The API allows users to perform CRUD (Create, Read, Update, Delete) operations on books in the inventory. It supports features like fetching all books, fetching books by title, author, or category, creating new books, updating existing books, and deleting books.
Fetches all books available in the inventory.
Fetches a specific book by its title.
Fetches books by a specified category.
Fetches books by a specified author and category.
Creates a new book in the inventory. Expects a JSON payload with book details.
Updates an existing book in the inventory. Expects a JSON payload with updated book details.
Deletes a book from the inventory based on its title.
Fetches all books from a specific author.
The book data is stored in memory using a Python list named BOOKS
. Each book is represented as a dictionary with the following keys:
title
: Title of the bookauthor
: Author of the bookcategory
: Category of the bookISBN
: ISBN number of the bookprice
: Price of the bookquantity
: Quantity of the book available in the inventory
- Clone the repository.
- Install the required dependencies using
pip install -r requirements.txt
. - Run the FastAPI application using
uvicorn main:app --reload
. - Access the API endpoints using a tool like Postman or by sending HTTP requests directly.
The provided assessment endpoint GET /Books/{author}/
fetches all books from a specific author. It takes the author's name as a path parameter and returns a list of books authored by that author.