{"id":23293551,"url":"https://github.com/geekidharsh/sample-flask-api","last_synced_at":"2025-04-06T18:47:55.009Z","repository":{"id":184546705,"uuid":"672083499","full_name":"geekidharsh/sample-flask-api","owner":"geekidharsh","description":"testing python flask for api design","archived":false,"fork":false,"pushed_at":"2024-06-12T21:19:22.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T00:46:42.659Z","etag":null,"topics":["flask-api","python"],"latest_commit_sha":null,"homepage":"","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/geekidharsh.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":"2023-07-28T22:06:39.000Z","updated_at":"2024-06-21T23:48:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"405dc4e5-2698-4af6-8174-07e1ff67e9fb","html_url":"https://github.com/geekidharsh/sample-flask-api","commit_stats":null,"previous_names":["geekidharsh/flask-api-for-experian","geekidharsh/sample-flask-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekidharsh%2Fsample-flask-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekidharsh%2Fsample-flask-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekidharsh%2Fsample-flask-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekidharsh%2Fsample-flask-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geekidharsh","download_url":"https://codeload.github.com/geekidharsh/sample-flask-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247535469,"owners_count":20954574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["flask-api","python"],"created_at":"2024-12-20T06:16:10.089Z","updated_at":"2025-04-06T18:47:54.981Z","avatar_url":"https://github.com/geekidharsh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask API\n\n## Gene Data Processor. \nA Flask based API that provides two endpoints for data processing and health checks. \nIt processes data from a CSV file based on the specified timestamp and performs a health check to ensure that the API is running fine.\n\n\n## Endpoints\n\n### Health Check - GET\n\n- **URL**: `/health`\n- **HTTP Method**: GET\n- **Description**: This endpoint is used to verify if the API is running fine. \n\n- **Response**:\n  - Status: `200 OK`\n  - Content: JSON object containing the following keys:\n    - `status`: Status of the API (`\"success\"`)\n    - `message`: A message indicating the health status of the API.\n\n### Get Data - POST\n\n- **URL**: `/getData`\n- **HTTP Method**: POST\n- **Description**: The API expects a JSON payload containing the timestamp to filter the data.\n- **Request Payload**:\n  - Content: JSON object containing the following key:\n    - `timestamp`: A string in the format `\"MM-DD-YYYY\"`\n    - Sample:\n    -   `{\"timestamp\": \"07-02-2023\"}`\n- **Response**:\n  - If the data structure is valid and the timestamp is correct, the API responds with a success message and the processed data.\n    - Status: `200 OK`\n    - Content: JSON object containing the following keys:\n      - `status`: Status of the response \n      - `message`: A message indicating the processing status (`\"Data processed successfully.\"`)\n      - `data`: A list of dictionaries representing the processed data for the specified timestamp.\n\n  - If the request payload is invalid or the timestamp format is incorrect, the API responds with an error message.\n    - Status: `400 Bad Request`\n    - Content: JSON object containing the following keys:\n      - `status`: `\"error\"`\n      - `message`: `\"Invalid data structure\"`\n\n## How to Use\n\n1. Install dependencies: `flask`, `pandas`, `request`\n\n2. Run the API: To start the API server, run the following command in the terminal:\n`python api-server.py`\n\n3. Once the flask app is running, following are the two end points:\n  - `http://127.0.0.1:5000/health - GET`\n  - `http://127.0.0.1:5000/getData - POST`\n4. An export of postman collection is included in the project for easy set up\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekidharsh%2Fsample-flask-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeekidharsh%2Fsample-flask-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekidharsh%2Fsample-flask-api/lists"}