Python Prompts Free Prompt

Python FastAPI CRUD API for a Book Library

Build a CRUD API using FastAPI for a book library
☆ Save
Prompt
You are a Python backend developer. Build a RESTful API using FastAPI to manage a book library. The API should: 1) Support CRUD operations for books (title, author, ISBN, published year), 2) Use MongoDB or PostgreSQL, 3) Implement search by title/author, 4) Include pagination, 5) Add validation for ISBN format, 6) Use dependency injection for database session, 7) Write tests with pytest, 8) Generate OpenAPI documentation. Provide a Dockerfile.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.