DelfiniItem¶
- class pydelfini.collections.DelfiniItem(collection, in_folder, model, core)[source]¶
Bases:
object
Represents an item within a collection.
Attributes
Item column definitions
Datetime item was created
Item internal ID
Item metadata
Item name
Item parser settings
Item fully qualified path
Item type (
file
,folder
,dataview
, etc.)Collection that contains this item
Folder that contains this item
- Parameters:
collection (DelfiniCollection)
in_folder (FolderMixin)
model (Item)
core (AuthenticatedClient)
- Return type:
- collection: DelfiniCollection¶
Collection that contains this item
- property columns: list[ItemColumn] | None¶
Item column definitions
- in_folder: FolderMixin¶
Folder that contains this item
- open(mode: Literal['rb', 'wb']) BinaryIO [source]¶
- open(mode: Literal['r', 'w']) TextIO
Open this item for reading or writing.
When writing an item, it is important to use the returned file-like object either in a context manager or else call its
close()
method when writing is complete, otherwise the full contents of the file may not be written.Suggested usage:
with item.open('wb') as fp: fp.write(b'my item content, as much as I have\n')
- Parameters:
mode –
One of the following values, depending on the desired interaction mode:
r
- reading, text moderb
- reading, binary modew
- writing, text modewb
- writing, binary mode
- Returns:
A file-like interface, either
BinaryIO
orTextIO
depending on whether the file was to be opened in binary or text mode. When writing, the return will be an instance ofitem_io.DelfiniItemWriterBinary
oritem_io.DelfiniItemWriterText
.
- property parser: ItemParser | None¶
Item parser settings