MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / hstore_decoder

Method hstore_decoder

tests/test_codecs.py:1238–1245  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

1236 ''')
1237
1238 def hstore_decoder(data):
1239 result = {}
1240 items = data.split(',')
1241 for item in items:
1242 k, _, v = item.partition('=>')
1243 result[k.strip('"')] = v.strip('"')
1244
1245 return result
1246
1247 def hstore_encoder(obj):
1248 return ','.join('{}=>{}'.format(k, v) for k, v in obj.items())

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected