The Bookstore API is a Flask-based web service designed to serve as a virtual bookstore, allowing users to browse available books, retrieve specific book details, add new books, update existing book information, and delete books from the inventory. The API provides simple yet essential endpoints for interacting with book data via HTTP requests.
- Retrieve a list of available books with details such as title, author, and image.
- Add, update, and delete books from the inventory.
- Flexible endpoints for interacting with book data via HTTP requests.
- Flask
- JSON (JavaScript Object Notation)
- HTTP Methods (GET, POST, PUT, DELETE)
- Clone the repository to your local machine: git clone https://github.com/yourusername/bookstore-api.git
- Navigate to the project directory: cd bookstore-api
- Install dependencies: pip install -r requirements.txt
- Run the Flask application: python app.py
- Access the API endpoints using HTTP requests. See Endpoints Documentation for details.
Retrieve a list of all books in the bookstore.
{ "books": [ { "id": 1, "title": "Pride and Prejudice", "author": "Jane Austen", "image_url": "https://example.com/pride_and_prejudice.jpg", "book_name": "Pride and Prejudice" }, // Additional books... ] }
Retrieve details of a specific book by ID.
{ "book": { "id": 1, "title": "Pride and Prejudice", "author": "Jane Austen", "image_url": "https://example.com/pride_and_prejudice.jpg", "book_name": "Pride and Prejudice" } }
Create a new book entry.
{ "title": "New Book Title", "author": "Author Name", "image_url": "https://example.com/new_book.jpg", "book_name": "New Book" }
{ "message": "Book created", "book": { "id": 5, "title": "New Book Title", "author": "Author Name", "image_url": "https://example.com/new_book.jpg", "book_name": "New Book" } }
Update details of an existing book.
Same as POST /books
Same as POST /books
Delete a book from the inventory.
{ "message": "Book deleted", "book": { "id": 5, "title": "New Book Title", "author": "Author Name", "image_url": "https://example.com/new_book.jpg", "book_name": "New Book" } }
Contributions to the Bookstore API are welcome! Please see the contribution guidelines for details.
This project is licensed under the MIT License.
As contributors and maintainers of the Bookstore API project, we are committed to fostering an inclusive and respectful community. We value the participation of every individual and encourage open and constructive communication.
In the interest of promoting an open and welcoming environment, we pledge to:
-
Be respectful and considerate of differing viewpoints and experiences.
-
Welcome contributions from people of all backgrounds and identities.
-
Be mindful of our language and behavior, and avoid any form of harassment, discrimination, or disrespectful conduct.
-
Support each other in our efforts to learn, grow, and improve the Bookstore API project.
To ensure a positive and productive community experience, we expect all participants to adhere to the following standards:
-
Communicate respectfully and professionally, both online and in-person interactions.
-
Accept constructive feedback graciously and strive to improve based on it.
-
Refrain from engaging in any form of harassment, discrimination, or offensive behavior.
-
Be inclusive and considerate of diverse perspectives and experiences.
-
Respect the privacy and personal boundaries of others.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting me directly (if you know me personally you should know what my info is).
This Code of Conduct is adapted from the Contributor Covenant, version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
We appreciate your commitment to creating a welcoming and inclusive community environment. Together, we can build and maintain a positive and supportive community around the Bookstore API project.