{"id":19267949,"url":"https://github.com/abhimanyuhk/jangli","last_synced_at":"2026-05-08T16:43:46.129Z","repository":{"id":62572088,"uuid":"188975077","full_name":"AbhimanyuHK/Jangli","owner":"AbhimanyuHK","description":"Convert json to python object and vice versa ","archived":false,"fork":false,"pushed_at":"2020-08-20T07:46:07.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-05T12:28:30.631Z","etag":null,"topics":["json","object","python"],"latest_commit_sha":null,"homepage":"","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/AbhimanyuHK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-28T07:16:28.000Z","updated_at":"2020-08-20T07:44:13.000Z","dependencies_parsed_at":"2022-11-03T18:26:46.840Z","dependency_job_id":null,"html_url":"https://github.com/AbhimanyuHK/Jangli","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbhimanyuHK%2FJangli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbhimanyuHK%2FJangli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbhimanyuHK%2FJangli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbhimanyuHK%2FJangli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AbhimanyuHK","download_url":"https://codeload.github.com/AbhimanyuHK/Jangli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240371741,"owners_count":19790888,"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":["json","object","python"],"created_at":"2024-11-09T20:14:34.728Z","updated_at":"2026-05-08T16:43:46.050Z","avatar_url":"https://github.com/AbhimanyuHK.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `Jangli`\n\n### Scope\n\n* Data Definition\n* Data mapping  \n\n### Convert json to python object\n\nConvert json or dict to model object.\n\n#### Supports \n* dict\n* json\n* json dumps\n\n```\nfrom jangli.json_to_object import json_to_obj\n\ndata = '{\"password\": \"123456\", \"id\": 1, \"name\": \"john\"}'\n\n\n\nclass Student:\n    def __init__(self):\n        self.id = None\n        self.name = None\n        self.password = None\n\n\ns = json_to_obj(data, Student)\nprint(s.name)\n```\n\n\n### Convert json to python object with static variable\n\nConvert json or dict to model object. Class containing static variables\n\n#### Supports \n* dict\n* json\n* json dumps\n\n```\nfrom jangli.json_to_object import json_to_obj\n\ndata_2 = '{\"password\": \"123456\", \"id\": 1, \"name\": \"john\", \"school\" : \"SOHS\"}'\n\n\nclass Student:\n    school = None\n\n    def __init__(self):\n        self.id = None\n        self.name = None\n        self.password = None\n\n\ns2 = json_to_obj(data_2, Student)\nprint(s2.school)\n\n```\n\n### Custom object list\nCreate list of similar object. Pass a model which you want create a list.\nIt only allows model objects which model passed whle creating list of objects.\n  \n```\nfrom jangli.list_of_object import ListObject\n\n\nclass A:\n    def __init__(self, b):\n        self.b = b\n\n\nlt = ListObject(A)\nlt.append(A(7))\nlt.insert(1, A(8))\n\nprint(lt)\n\nOutput : [\u003c__main__.A object at 0x00CA3730\u003e, \u003c__main__.A object at 0x00CC6E10\u003e]\n```\n\n### Case Change to CamelCase\n\nConverter snack case to camel case. \n\n```\nfrom jangli.case_type import CamelCase\n\n\n@CamelCase\nclass NewClass:\n\n    def __init__(self):\n        self.a = 7\n        self.b = \"hi\"\n        self.c = True\n        self._from = None\n\n\nnew = NewClass()\n\nprint(new.__dict__)\n\n```\n\n### String of None to None\n\nChange string of None to None,\n\nEX : \n\nString of None is : x = 'None'\n\nAfter change : x = None\n\n\n```\nfrom jangli.checker.none_checker import NoneChecker\n\n@NoneChecker\nclass A:\n\n    def __init__(self):\n        self.b = 8\n        self.c = \"None\"\n        self.d = True\n\n\nprint(A().__dict__)\n\u003e\u003e\u003e {'b': 8, 'c': None, 'd': True}\n\n```\n\n### Re-Try Function\n\nIf a function failed one or many times, you can retry N no. of times just by passing retry_value = ?. \n\n#### If retry_value = 1 \n\nA function will execute ones, mean while any error any occurring function will through exception.\n\n```\n@Retry(retry_value=1)\ndef x_fun():\n    print(\"Function is executing ones\")\n\n```\n\n#### If retry_value = 2\n\nA function will execute twice if first execution fails else only ones.\n\n```\n@Retry(retry_value=2)\ndef x_fun():\n    print(\"raise exception\")\n    raise Exception(\"Try twice\")\n\n```\n\n#### If  retry_value = 0\n\nA function is disabled and could not execute the function.\n\n```\n@Retry(retry_value=0)\ndef x_fun():\n    print(\"Function is disabled\")\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhimanyuhk%2Fjangli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhimanyuhk%2Fjangli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhimanyuhk%2Fjangli/lists"}