comparison env/lib/python3.9/site-packages/prov/serializers/provn.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
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