Python MongoDB

Complete Python & MongoDB Syllabus (Pure Python REST API – No Flask/Django)

Python & MongoDB with Pure Python REST API – Syllabus

Module 1: Python Foundations (1.5–2 weeks)

  • βœ… Python installation & setup (pip, venv)
  • βœ… Data types & variables
  • βœ… Lists, dicts, sets, tuples
  • βœ… Control structures (if, loops)
  • βœ… Functions, modules, imports
  • βœ… Exception handling
  • βœ… File handling (JSON, CSV)
  • βœ… Basic OOP in Python

Module 2: MongoDB Basics (1.5 weeks)

  • βœ… NoSQL vs SQL, when to use MongoDB
  • βœ… Installing MongoDB (local & Atlas)
  • βœ… Databases, collections, documents
  • βœ… CRUD in Mongo shell
  • βœ… MongoDB data types
  • βœ… Query operators ($in, $gt, $lt, $or, $and)
  • βœ… Indexing basics

Module 3: Python–MongoDB Integration (2 weeks)

  • βœ… Install pymongo
  • βœ… Connect Python app to MongoDB (local & Atlas)
  • βœ… Insert, find, update, delete documents
  • βœ… Handling ObjectId in Python
  • βœ… Working with nested documents
  • βœ… Aggregation pipeline with Python
  • βœ… Error handling in DB operations

Module 4: REST API in Pure Python (2.5 weeks)

  • βœ… Introduction to HTTP & REST principles
  • βœ… Python’s built-in http.server & BaseHTTPRequestHandler
  • βœ… Parsing requests (GET, POST, PUT, DELETE)
  • βœ… Sending JSON responses using json module
  • βœ… Connecting API routes with MongoDB CRUD operations
  • βœ… Implement API Endpoints:
    • POST /users β†’ Create user
    • GET /users β†’ Fetch all users
    • GET /users/{id} β†’ Fetch single user
    • PUT /users/{id} β†’ Update user
    • DELETE /users/{id} β†’ Delete user
  • βœ… Testing APIs with Postman

Module 5: Advanced Topics (2 weeks)

  • βœ… Input validation in APIs
  • βœ… JWT Authentication in pure Python
  • βœ… Pagination & filtering queries
  • βœ… File upload β†’ store file path / GridFS in MongoDB
  • βœ… Async requests with aiohttp + motor (async Mongo driver)
  • βœ… Organizing project with MVC-like folder structure

Final Project (1–1.5 weeks)

  • βœ… Build a complete User Management REST API in pure Python with MongoDB
  • βœ… User signup/login (JWT-based auth)
  • βœ… Profile CRUD operations
  • βœ… List/search users with filters
  • βœ… Aggregation endpoint (e.g., count users by role)
  • βœ… API documentation (Markdown / OpenAPI spec manually)

Leave a Reply

Your email address will not be published. Required fields are marked *