{"id":19337210,"url":"https://github.com/mohdsaif-1807/pythonassignment","last_synced_at":"2026-05-02T08:34:30.055Z","repository":{"id":253940506,"uuid":"844824043","full_name":"MohdSaif-1807/PythonAssignment","owner":"MohdSaif-1807","description":"A FastAPI Application which demonstrate the use of API's","archived":false,"fork":false,"pushed_at":"2024-08-20T11:35:35.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T08:14:21.523Z","etag":null,"topics":["api","api-rest","fastapi","pytest","python","test-suite"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/saif0786/python-assignment","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MohdSaif-1807.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-20T03:27:21.000Z","updated_at":"2024-08-20T11:35:39.000Z","dependencies_parsed_at":"2024-08-20T13:53:37.188Z","dependency_job_id":null,"html_url":"https://github.com/MohdSaif-1807/PythonAssignment","commit_stats":null,"previous_names":["mohdsaif-1807/pythonassignment"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MohdSaif-1807/PythonAssignment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohdSaif-1807%2FPythonAssignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohdSaif-1807%2FPythonAssignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohdSaif-1807%2FPythonAssignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohdSaif-1807%2FPythonAssignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MohdSaif-1807","download_url":"https://codeload.github.com/MohdSaif-1807/PythonAssignment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohdSaif-1807%2FPythonAssignment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32528337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-rest","fastapi","pytest","python","test-suite"],"created_at":"2024-11-10T03:13:43.123Z","updated_at":"2026-05-02T08:34:30.041Z","avatar_url":"https://github.com/MohdSaif-1807.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI Application with MongoDB Atlas Integration\n\nThis project demonstrate the use FlaskAPI with API endpoints, with a test suite.\n\n### Accessing the Application\n\n**In order to view docker image can visit the below link provided:**\n\n https://hub.docker.com/r/saif0786/python-assignment\n\n\n\n\n**In order to run the FastAPI application on the local system:**\n  1. we need to clone the repository with the command:\n\n  \n    git clone 'https://github.com/MohdSaif-1807/PythonAssignment'\n\n  2. Create a .env file and  mongodb url with variable in the following way\n     ```\n     MONGO_URL = \"\u003cvalid mongo url\u003e\"\n     ```\n  3. Also we have to Uncomment the below code from main.py to parse and insert data into MongoDB:\n     ```\n     parse_courses(courses)\n     ```\n    \n  4. In order to start the FlaskAPI application we need to type the command as follows:\n     \n  ```\n    fastapi dev main.py\n  ```\n\nOnce we start the application, we can access the FastAPI application at:\n\n```\nhttp://localhost:8000\n```\n\nYou can explore the API documentation and interact with the endpoints directly from your browser using FastAPI's interactive Swagger UI.\n\n## API Endpoints\n\n1. **Get All Courses**\n\n   ```\n   GET /fetch-all-courses/\n   ```\n\n   **Query Parameters:**\n   - `domain` (optional): Filter courses by domain.\n  \n  **Screenshot to fetch all records:**\n\n  ![Screenshot (3)](https://github.com/user-attachments/assets/f285d227-79ab-472d-aa8d-8699cda34760)\n\n  **Screenshot to fetch records based on domain:**\n  \n  ![Screenshot (4)](https://github.com/user-attachments/assets/f5c685c7-99d4-4ab9-84e6-cfafa84dc894)\n\n\n2. **Get Course Overview**\n\n   ```\n   GET /fetch-specific-record/{course_id}/\n   ```\n\n   **Path Parameters:**\n   - `course_id`: The ID of the course to retrieve.\n\n  **Screenshot to fetch specific course:**\n\n  ![Screenshot (5)](https://github.com/user-attachments/assets/f3b748fd-11eb-441e-a9b2-282bff99870c)\n\n\n3. **Get Chapter Information**\n\n   ```\n   GET /fetch-specific-chapter-from-record/{chapter_id}/\n   ```\n\n   **Path Parameters:**\n   - `chapter_id`: The ID of the chapter.\n\n  **Screenshot to get specific chapter information:**\n  \n  ![Screenshot (6)](https://github.com/user-attachments/assets/b34d53c3-02e4-49a4-ab26-02c51794a276)\n\n\n4. **Rate a Chapter**\n\n   ```\n   POST /add-rating/{chapter_id}/\n   ```\n\n   **Path Parameters:**\n   - `chapter_id`: The ID of the chapter.\n\n   **Request Body:**\n\n   ```json\n   {\n     \"rating_value\": integer\n   }\n   ```\n\n   **screenshot to give ratings to a specific chapter:**\n   \n   ![Screenshot (7)](https://github.com/user-attachments/assets/b6c8153b-f40b-4545-8d93-53655acdc50a)\n\n\n**Testing the Application**\n\nIn order to run the Test script for API's we need to run the command as follows:\n\n  ```\n  pytest test.py\n  ```\n**screenshot for the result of the TestScript**\n\n![Screenshot (8)](https://github.com/user-attachments/assets/e483fcc0-7b5f-45fc-a19a-7eb6af0555ad)\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohdsaif-1807%2Fpythonassignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohdsaif-1807%2Fpythonassignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohdsaif-1807%2Fpythonassignment/lists"}