Categories
Mastering Development

How to remove quotes for json keys in json string using regex in jq

Trying to convert json payload to graphql and having some troubles. I need to convert string like "{ \"entity\":{ \"id\":\"7fbe7e65-0f01-4934-a2a9-dcc6d81a5b95\", \"type\":\"Products\", \"status\":\"pending\", \"services\":[ { \"id\":\"1e05737e-754b-4d19-b872-5a0135d99cf4\", \"type\":\"Services\", \"status\":\"active\" },{ \"id\":\"2238fe75-3d1a-4768-8464-be7d48037215\", \"type\":\"Services\", \"status\":\"active\" } ] } }" to string where no quotes for keys: "{ entity:{ id:\"7fbe7e65-0f01-4934-a2a9-dcc6d81a5b95\", type:\"Products\", status:\"pending\", services:[ { id:\"1e05737e-754b-4d19-b872-5a0135d99cf4\", type:\"Services\", status:\"active\" },{ id:\"2238fe75-3d1a-4768-8464-be7d48037215\", type:\"Services\", […]

Categories
Development

Setting csv table into a dictionary using pandas dataframe

I am new to python and trying to solve a problem below. I have a table in csv format that look like this: csv table I want to convert into a dictionary that looks this: {‘Issue ID’ : ‘1’, ‘Title’:’Create SAL rule for Advisors Asset Mgmt Inc’, ‘Status’:’Pending’, ‘Owner’:’John Smith’, ‘Created_Date’:’1/12/2020′, ‘Issue ID’ : ‘2’, […]