How to use the oasislmf.utils.peril.PERILS.keys function in oasislmf

To help you get started, we’ve selected a few oasislmf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OasisLMF / OasisPlatform / src / server / oasisapi / oed_info / views.py View on Github external
def get(self, request):
        peril_codes = {PERILS[p]['id']: {'desc': PERILS[p]['desc']} for p in PERILS.keys()}
        peril_groups = {
            PERIL_GROUPS[g]['id']: {
                'desc': PERIL_GROUPS[g]['desc'],
                'peril_ids': PERIL_GROUPS[g]['peril_ids']
            } for g in PERIL_GROUPS.keys()
        }

        return Response({
            'oasislmf_version': oasislmf_package_ver,
            'peril_codes': peril_codes,
            'peril_groups': peril_groups
        })