python-benedict/benedict/serializers/toml.py

21 lines
397 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
2020-01-20 16:03:59 +00:00
from __future__ import absolute_import
from benedict.serializers.abstract import AbstractSerializer
import toml
class TOMLSerializer(AbstractSerializer):
@staticmethod
def decode(s, **kwargs):
data = toml.loads(s, **kwargs)
return data
@staticmethod
def encode(d, **kwargs):
data = toml.dumps(d, **kwargs)
return data