{"id":19290873,"url":"https://github.com/jaimemosg/census_api_challenge","last_synced_at":"2026-05-13T21:33:37.201Z","repository":{"id":170419521,"uuid":"357945988","full_name":"Jaimemosg/census_api_challenge","owner":"Jaimemosg","description":"This is just my first fastAPI","archived":false,"fork":false,"pushed_at":"2021-04-16T00:02:59.000Z","size":26580,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-16T12:29:52.798Z","etag":null,"topics":["fastapi","jupyter-notebook"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/Jaimemosg.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":"2021-04-14T15:04:16.000Z","updated_at":"2021-04-17T16:44:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5b86117-50a2-49d4-a31b-64e3100c1d0e","html_url":"https://github.com/Jaimemosg/census_api_challenge","commit_stats":null,"previous_names":["jaimemosg/census_api_challenge"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jaimemosg/census_api_challenge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaimemosg%2Fcensus_api_challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaimemosg%2Fcensus_api_challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaimemosg%2Fcensus_api_challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaimemosg%2Fcensus_api_challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jaimemosg","download_url":"https://codeload.github.com/Jaimemosg/census_api_challenge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaimemosg%2Fcensus_api_challenge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33001004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["fastapi","jupyter-notebook"],"created_at":"2024-11-09T22:22:40.976Z","updated_at":"2026-05-13T21:33:37.181Z","avatar_url":"https://github.com/Jaimemosg.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Challenge: API for census-income data base\n\nThis API returns filters the `census-income + (KDD)` data set and computes the mean, minumum  and maximum wage per hour, the minumum and maximum weeks worked by an employee, the number of employees whose income is greater than 50k and the total number of employees filtered.\n\n## Info\n\nIn this repo you can find:\n\n- `documentation/census_BD.pdf`: the entity-raletion diagram.\n- `EDA_census.ipnb`: Jupyter notebook cwith EDA (Exploratory Data Analysis and Analytics).\n- `RDB_creation.ipynb`: Jupyter notebook for data base creation.\n\n## Remote\n This API was deployed at Heroku where you can also test it from the docs endpoint\n\n[https://fastapi-census.herokuapp.com/docs](https://fastapi-census.herokuapp.com/docs)\n\n## Local use\n\n### 1. Install requirements\n```\npip install -r requirements.txt --no-cache-dir\n```\n\n### 2. Change to app folder\n```\ncd census_api_challenge\n```\n\n### 3. Run de app\n* Use --reload only in dev environment\n```\nuvicorn app:app --reload --port 8000\n```\n\n### 4. Go to localhost\nhttp://127.0.0.1:8000/docs\n\n### 5. Stop the server\n```\nctrl + c\n```\n\n## Usage (example)\n\n### Example 1\nYou could perform a query such the following\n\n```\n{\n  \"age\": 31,\n  \"class_of_worker\": \"Private\",\n  \"industry_code\": 43,\n  \"occupation_code\": 7,\n  \"marital_status\": \"Never married\",\n  \"major_industry_code\": \"Education\",\n  \"major_occupation_code\": \"Professional specialty\",\n  \"hispanic_origin\": \"Mexican (Mexicano)\",\n  \"sex\": \"Female\"\n}\n```\n\nYou should obtain the following response:\n\n```\n[\n  {\n    \"mean_wage\": 0,\n    \"mean_weeks_worked\": 46.666666666666664,\n    \"min_wage\": 0,\n    \"min_weeks_worked\": 12,\n    \"max_wage\": 0,\n    \"max_weeks_worked\": 52,\n    \"person_50k_plus\": 4,\n    \"num_person\": 12\n  }\n]\n```\n\n### Example 2\nAnother possible query is the following\n\n```\n{\n  \"age\": 43,\n  \"class_of_worker\": \"Private\",\n  \"industry_code\": 43,\n  \"occupation_code\": 7\n}\n```\n\nWhat was the answer?\n\n---\n\nBy **Jaime Mosquera Gútiérrez** - [Jaimemosg](https://github.com/Jaimemosg)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaimemosg%2Fcensus_api_challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaimemosg%2Fcensus_api_challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaimemosg%2Fcensus_api_challenge/lists"}