DelfiniItemCreatorText¶
- class pydelfini.item_io.DelfiniItemCreatorText(collection_id, version_id, item_name, client, folder_id='ROOT', type='file', columns=None, metadata=None, parser=None, storage=None)[source]¶
Bases:
DelfiniItemCreatorCore
,DelfiniItemWriterText
File-like interface for creating a new item in text mode.
It is important to either use this in a context manager or else call the
close()
method when writing is complete, otherwise the full contents of the file may not be written.Suggested usage:
with collection.open('new-item', 'w') as fp: fp.write('my item content, as much as I have\n')
Attributes
buffer
closed
encoding
errors
line_buffering
mode
name
newlines
- Parameters:
collection_id (str)
version_id (str)
item_name (str)
client (AuthenticatedClient)
folder_id (str)
type (Literal['file', 'dataview', 'dictionary'])
columns (list[ItemColumn] | None)
parser (ItemParser | None)
storage (ItemStorage | None)
- close()¶
Close and flush the stream, completing the file write.
- Return type:
None
- readline(limit=-1)¶
N/A - cannot read
- readlines(hint=-1)¶
N/A - cannot read
- seek(offset, whence=0)¶
N/A - not a real file
- truncate(size=None)¶
N/A - not a real file
- write(s)¶
Write to the stream.