Lines Matching refs:stream

29 def scan(stream, Loader=Loader):
31 Scan a YAML stream and produce scanning tokens.
33 loader = Loader(stream)
40 def parse(stream, Loader=Loader):
42 Parse a YAML stream and produce parsing events.
44 loader = Loader(stream)
51 def compose(stream, Loader=Loader):
53 Parse the first YAML document in a stream
56 loader = Loader(stream)
62 def compose_all(stream, Loader=Loader):
64 Parse all YAML documents in a stream
67 loader = Loader(stream)
74 def load(stream, Loader):
76 Parse the first YAML document in a stream
79 loader = Loader(stream)
85 def load_all(stream, Loader):
87 Parse all YAML documents in a stream
90 loader = Loader(stream)
97 def full_load(stream):
99 Parse the first YAML document in a stream
105 return load(stream, FullLoader)
107 def full_load_all(stream):
109 Parse all YAML documents in a stream
115 return load_all(stream, FullLoader)
117 def safe_load(stream):
119 Parse the first YAML document in a stream
125 return load(stream, SafeLoader)
127 def safe_load_all(stream):
129 Parse all YAML documents in a stream
135 return load_all(stream, SafeLoader)
137 def unsafe_load(stream):
139 Parse the first YAML document in a stream
145 return load(stream, UnsafeLoader)
147 def unsafe_load_all(stream):
149 Parse all YAML documents in a stream
155 return load_all(stream, UnsafeLoader)
157 def emit(events, stream=None, Dumper=Dumper,
161 Emit YAML parsing events into a stream.
162 If stream is None, return the produced string instead.
165 if stream is None:
166 stream = io.StringIO()
167 getvalue = stream.getvalue
168 dumper = Dumper(stream, canonical=canonical, indent=indent, width=width,
178 def serialize_all(nodes, stream=None, Dumper=Dumper,
184 Serialize a sequence of representation trees into a YAML stream.
185 If stream is None, return the produced string instead.
188 if stream is None:
190 stream = io.StringIO()
192 stream = io.BytesIO()
193 getvalue = stream.getvalue
194 dumper = Dumper(stream, canonical=canonical, indent=indent, width=width,
208 def serialize(node, stream=None, Dumper=Dumper, **kwds):
210 Serialize a representation tree into a YAML stream.
211 If stream is None, return the produced string instead.
213 return serialize_all([node], stream, Dumper=Dumper, **kwds)
215 def dump_all(documents, stream=None, Dumper=Dumper,
222 Serialize a sequence of Python objects into a YAML stream.
223 If stream is None, return the produced string instead.
226 if stream is None:
228 stream = io.StringIO()
230 stream = io.BytesIO()
231 getvalue = stream.getvalue
232 dumper = Dumper(stream, default_style=default_style,
248 def dump(data, stream=None, Dumper=Dumper, **kwds):
250 Serialize a Python object into a YAML stream.
251 If stream is None, return the produced string instead.
253 return dump_all([data], stream, Dumper=Dumper, **kwds)
255 def safe_dump_all(documents, stream=None, **kwds):
257 Serialize a sequence of Python objects into a YAML stream.
259 If stream is None, return the produced string instead.
261 return dump_all(documents, stream, Dumper=SafeDumper, **kwds)
263 def safe_dump(data, stream=None, **kwds):
265 Serialize a Python object into a YAML stream.
267 If stream is None, return the produced string instead.
269 return dump_all([data], stream, Dumper=SafeDumper, **kwds)
364 An object that can dump itself to a YAML stream
365 and load itself from a YAML stream.