comparison env/lib/python3.7/site-packages/prov/serializers/provn.py @ 2:6af9afd405e9 draft

"planemo upload commit 0a63dd5f4d38a1f6944587f52a8cd79874177fc1"
author shellac
date Thu, 14 May 2020 14:56:58 -0400
parents 26e78fe6e8c4
children
comparison
equal deleted inserted replaced
1:75ca89e9b81c 2:6af9afd405e9
1 from __future__ import (absolute_import, division, print_function,
2 unicode_literals)
3
4 __author__ = 'Trung Dong Huynh'
5 __email__ = 'trungdong@donggiang.com'
6
7 import io
8 import logging
9 logger = logging.getLogger(__name__)
10
11 from prov.serializers import Serializer
12
13
14 class ProvNSerializer(Serializer):
15 """PROV-N serializer for ProvDocument
16
17 """
18 def serialize(self, stream, **kwargs):
19 """
20 Serializes a :class:`prov.model.ProvDocument` instance to a
21 `PROV-N <http://www.w3.org/TR/prov-n/>`_.
22
23 :param stream: Where to save the output.
24 """
25 provn_content = self.document.get_provn()
26 if isinstance(stream, io.BytesIO):
27 provn_content = provn_content.encode('utf-8')
28 stream.write(provn_content)
29
30 def deserialize(self, stream, **kwargs):
31 raise NotImplementedError