Your task for today is to create a RESTful API for a book catalog system that reads data from a text file and serves it through HTTP endpoints. This project introduces you to API development, HTTP methods, and working with file-based data storage.
Project Task
Create a Book Catalog API that:
Reads book data from a text file (CSV
Implements RESTful API endpoints for CRUD operations:
GET /books - List all books
GET /books/{id} - Get a specific book by ID
POST /books - Add a new book
PUT /books/{id} - Update a book
DELETE /books/{id} - Delete a book
Returns data in JSON format
Handles common HTTP status codes (200, 201, 404, 400)
Persists changes back to the text file
Includes search and filter functionality
Bonus (optional):
Add pagination for large book lists
Implement filtering by author, genre, or year
Add basic authentication
Create API documentation
Add data validation for book entries
This project gives you hands-on practice with API development, HTTP protocols, file I/O, JSON handling, and RESTful design patterns — essential skills for backend development.
Expected Output
Once you build the API, you can make requests to the API endpoints and get back the data.
Getting all the books:
http://localhost:8000/books
Getting only the first book:
http://localhost:8000/books/1
Join the Python & AI Builders Skool Community
Got questions to ask the author about this project? Join our Python & AI Builders community for weekly Python & AI videos and discussions:
💻 Launch This Project in Colab
Open the interactive Google Colab notebook for today’s project — with full instructions, hints, and solutions.
Click the button below to start coding — no setup needed:
Keep reading with a 7-day free trial
Subscribe to Daily Python Projects to keep reading this post and get 7 days of free access to the full post archives.




