{"id":22741814,"url":"https://github.com/http-apis/creditrisk-poc","last_synced_at":"2025-04-14T07:22:36.967Z","repository":{"id":43339469,"uuid":"371432062","full_name":"HTTP-APIs/creditrisk-poc","owner":"HTTP-APIs","description":null,"archived":false,"fork":false,"pushed_at":"2022-03-07T11:07:29.000Z","size":92,"stargazers_count":1,"open_issues_count":3,"forks_count":6,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-11T21:25:12.553Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HTTP-APIs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-27T16:06:49.000Z","updated_at":"2023-08-21T15:45:22.000Z","dependencies_parsed_at":"2022-09-03T02:41:52.469Z","dependency_job_id":null,"html_url":"https://github.com/HTTP-APIs/creditrisk-poc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HTTP-APIs%2Fcreditrisk-poc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HTTP-APIs%2Fcreditrisk-poc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HTTP-APIs%2Fcreditrisk-poc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HTTP-APIs%2Fcreditrisk-poc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HTTP-APIs","download_url":"https://codeload.github.com/HTTP-APIs/creditrisk-poc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837400,"owners_count":21169423,"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":"2024-12-11T00:17:58.905Z","updated_at":"2025-04-14T07:22:36.934Z","avatar_url":"https://github.com/HTTP-APIs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# creditrisk-poc [![Build Status](https://travis-ci.com/HTTP-APIs/creditrisk-poc.svg?branch=main)](https://travis-ci.com/HTTP-APIs/creditrisk-poc)\n\nCreditrisk-poc is a Hydra powered API which serves loan portfolio data using EBA NPL Template.\n\n\u003cdiv  align=\"center\"\u003e\n  \n  ![Creditrisk-poc](https://user-images.githubusercontent.com/49719371/130111451-5c06ce06-012e-44df-986c-b736bb21b191.png)\n  \u003c/div\u003e\n\n## Working Project\n\nAPI is live @ **http://34.145.188.116:8080/**\n\n## Features\n\ncreditrisk-poc consist following features:\n\n- ResidentialMortgage, PrivateBorrower, Collateral, Portfolio \u0026 manymore classes.\n- Portfolio class collection.\n- classes are linked with each other using `foreign keys`.\n- All the classes can perform all the CRUD operations ( GET, PUT, POST, DELETE).\n- Portfolio class collection can perform all the CRUD operations.\n\n## Classes are linked in the following manner:\n\n[Here's](https://drive.google.com/file/d/1HWd72JVtf13P7DdTF3Er2870FVx7c9BM/view) the Database schema for the classes.\n\n## NonPerformingLoan.jsonld\n\nThe `NonPerformingLoan.jsonld` is a subset vocabulary for NonPerformingLoan portfolios,\nvocabulary is generated automatically using `vocab_generator.py` from `NonperformingLoan.owl` ontology.\n\n```bash\npython npl_vocab/vocab_generator.py\n```\n\nIt will generate the JSON-LD vocabulary which can be used to create ApiDoc.\n\n## API_DOC\n\nAPI_Doc is generated through hydra-python-core module `doc_writer` and `nplvoac_parse.py` which automates the creation\nof classes and properties from JSON-LD vocabulary.\n\nAPI_Doc, doc_writer \u0026 `nplvocab_parser.py` files can be found here :\n\n```\napi_doc\n|\n|___ ApiDoc.jsonld\n|___ api_docwriter.py\n|___ nplvocab_parser.py\n```\n\n**nplvocab_parser** parse all the classes \u0026 properties from `NonPerformingLoan.jsonld` and provide functions for converting\nthem to HydraClass \u0026 HydraClassProp.\n\n`ApiDoc` is a JSON serialized object, It can be accessed as follows:\n\n```python\nimport json\n\nApiDoc_file = open(\"creditrisk_poc/api_doc/ApiDoc.json\",\"r\")\ndoc = json.load(ApiDoc_file)\n```\n\nyou will get the doc in `python dict` format.\n\n### ApiDoc is generated with this flow:\n\n![Automation_structure](https://user-images.githubusercontent.com/49719371/130113828-f4241ac7-08fb-4a14-aa64-a2c85b549d37.png)\n\n## Repository Structure\n\n```python\ncreditrisk_poc\n|\n|____api_doc\n|    |\n|    |_____api_docwriter.py\n|    |_____ApiDoc.jsonld\n|    |_____nplvocab_generator.py\n|\n|____npl_vocab\n|    |\n|    |____NonPerformingLoan.jsonld\n|    |____NonPerformingLoan.owl\n|    |____nplo.jsonld\n|    |____vocab_generator.py\n|\n|____\"__main.py__\"\n```\n\n## Demo\n\nTo run hydra powered creditrisk-poc API, just do the following:\n\n1. Clone creditrisk-poc\n\n```bash\ngit clone https://github.com/HTTP-APIs/creditrisk-poc.git\ncd creditrisk-poc\n```\n\n2. Install a [_Python virtual environment_](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/) using:\n\n```bash\npython3.7 -m venv .venv\n```\n\nor:\n\n```bash\nvirtualenv -p python3.7 .venv\n```\n\n3. Install requirements:\n\n```bash\nsource .venv/bin/activate\npip install -r requirements.txt\n```\n\n3. Run hydrus server\n\n```bash\ncd creditrisk_poc\npython __main__.py\n```\n\nThe hydrus should be up \u0026 running on `http://localhost:8080/creditrisk_api/`\n\n### API can be tested using Mock_portfolio_generator\n\n```bash\npython examples/mock_portfolio_generator.py\n```\n\n\u003e Mock_portfolio_generator is a mock client which can populate the database with the more realistic data, It automatically creates the object of the classes on the basis of ApiDocumentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttp-apis%2Fcreditrisk-poc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhttp-apis%2Fcreditrisk-poc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttp-apis%2Fcreditrisk-poc/lists"}