{"id":25253295,"url":"https://github.com/tydev01/hng12_stage_1","last_synced_at":"2025-04-05T22:29:53.285Z","repository":{"id":276131272,"uuid":"928313624","full_name":"TYDev01/HNG12_Stage_1","owner":"TYDev01","description":"Number Classification API","archived":false,"fork":false,"pushed_at":"2025-02-06T12:57:46.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T13:44:58.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/TYDev01.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":"2025-02-06T12:36:21.000Z","updated_at":"2025-02-06T12:57:49.000Z","dependencies_parsed_at":"2025-02-06T13:44:59.645Z","dependency_job_id":"f4f7ec68-4cc8-4304-b873-77c139763e27","html_url":"https://github.com/TYDev01/HNG12_Stage_1","commit_stats":null,"previous_names":["tydev01/hng12_stage_1"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TYDev01%2FHNG12_Stage_1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TYDev01%2FHNG12_Stage_1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TYDev01%2FHNG12_Stage_1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TYDev01%2FHNG12_Stage_1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TYDev01","download_url":"https://codeload.github.com/TYDev01/HNG12_Stage_1/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411240,"owners_count":20934650,"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":[],"created_at":"2025-02-12T04:58:58.049Z","updated_at":"2025-04-05T22:29:53.265Z","avatar_url":"https://github.com/TYDev01.png","language":"Python","readme":"# Number Classification API\n\n## Overview\nThis is a FastAPI-powered **Number Classification API** that takes an integer as input and returns mathematical properties of the number along with a fun fact.\n\n## Features\n- Determines whether the number is **prime**.\n- Checks if the number is an **Armstrong number**.\n- Identifies if the number is **perfect**.\n- Classifies the number as **odd** or **even**.\n- Calculates the **sum of digits**.\n- Retrieves a **fun fact** about the number from [Numbers API](http://numbersapi.com/).\n\n## API Endpoint\n### **GET** `/api/classify-number`\n**Query Parameter:**\n- `number` (integer) - The number to classify.\n\n### **Example Requests \u0026 Responses**\n#### ✅ **Successful Response (200 OK)**\n**Request:**\n```http\nGET /api/classify-number?number=371\n```\n**Response:**\n```json\n{\n    \"number\": 371,\n    \"is_prime\": false,\n    \"is_perfect\": false,\n    \"properties\": [\"armstrong\", \"odd\"],\n    \"digit_sum\": 11,\n    \"fun_fact\": \"371 is an Armstrong number because 3^3 + 7^3 + 1^3 = 371\"\n}\n```\n\n#### ❌ **Invalid Input (400 Bad Request)**\n**Request:**\n```http\nGET /api/classify-number?number=abc\n```\n**Response:**\n```json\n{\n    \"number\": \"abc\",\n    \"error\": true\n}\n```\n\n## Setup \u0026 Installation\n### 1️⃣ Clone the Repository\n```bash\ngit clone https://github.com/TYDev01/HNG12_Stage_1.git\ncd HNG12_Stage_1\n```\n\n### 2️⃣ Create a Virtual Environment\n```bash\npython -m venv venv\nsource venv/bin/activate  # On macOS/Linux\nvenv\\Scripts\\activate  # On Windows\n```\n\n### 3️⃣ Install Dependencies\n```bash\npip install -r requirements.txt\n```\n\n### 4️⃣ Run the API Locally\n```bash\nuvicorn main:app --reload\n```\n\n### 5️⃣ Test the API\nOpen your browser or use Postman to visit:\n```\nhttp://127.0.0.1:8000/api/classify-number?number=371\n```\n\n## Deployment\nTo deploy this API, you can use **Render, Railway, Vercel, or DigitalOcean**. Ensure the API is **publicly accessible**.\n\n## Technologies Used\n- **Python** 🐍\n- **FastAPI** 🚀\n- **Uvicorn**\n- **Numbers API**\n\n## License\nMIT License © 2025 [TYDev](https://github.com/TYDev01)\n\n---\n### 🚀 **Contributions \u0026 Issues**\nFeel free to **fork**, submit PRs, or open issues if you have suggestions or find bugs! 🎉\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftydev01%2Fhng12_stage_1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftydev01%2Fhng12_stage_1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftydev01%2Fhng12_stage_1/lists"}