unreal.DataTable
¶
- class unreal.DataTable(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
Object
Imported spreadsheet table.
C++ Source:
Module: Engine
File: DataTable.h
Editor Properties: (see get_editor_property/set_editor_property)
asset_import_data
(AssetImportData): [Read-Only] The file this data table was imported from, may be emptyignore_extra_fields
(bool): [Read-Write] Set to true to ignore extra fields in the import data, if false it will warn about themignore_missing_fields
(bool): [Read-Write] Set to true to ignore any fields that are expected but missing, if false it will warn about themimport_key_field
(str): [Read-Write] Explicit field in import data to use as key. If this is empty it uses Name for JSON and the first field found for CSVrow_struct
(ScriptStruct): [Read-Only] Structure to use for each row of the table, must inherit from FTableRowBasestrip_from_client_builds
(bool): [Read-Write] Set to true to not cook this data table into client builds. Useful for sensitive tables that only servers should know about.
- export_to_csv_string() str or None ¶
Export a Data Table to CSV string.
- Returns:
True if the operation succeeds, check the log for errors if it didn’t succeed.
out_csv_string (str): Output representing the contents of a CSV file.
- Return type:
str or None
- export_to_json_string() str or None ¶
Export a Data Table to JSON string.
- Returns:
True if the operation succeeds, check the log for errors if it didn’t succeed.
out_json_string (str): Output representing the contents of a JSON file.
- Return type:
str or None
- fill_from_csv_file(csv_file_path, import_row_struct=None) bool ¶
Empty and fill a Data Table from CSV file.
- Parameters:
csv_file_path (str) – The file path of the CSV file.
import_row_struct (ScriptStruct) – Optional row struct to apply on import. If set will also force the import to run automated (no questions or dialogs).
- Returns:
True if the operation succeeds, check the log for errors if it didn’t succeed.
- Return type:
- fill_from_csv_string(csv_string, import_row_struct=None) bool ¶
Empty and fill a Data Table from CSV string.
- Parameters:
csv_string (str) – The Data that representing the contents of a CSV file.
import_row_struct (ScriptStruct) – Optional row struct to apply on import. If set will also force the import to run automated (no questions or dialogs).
- Returns:
True if the operation succeeds, check the log for errors if it didn’t succeed.
- Return type:
- fill_from_json_file(json_file_path, import_row_struct=None) bool ¶
Empty and fill a Data Table from JSON file.
- Parameters:
json_file_path (str) – The file path of the JSON file.
import_row_struct (ScriptStruct) – Optional row struct to apply on import. If set will also force the import to run automated (no questions or dialogs).
- Returns:
True if the operation succeeds, check the log for errors if it didn’t succeed.
- Return type:
- fill_from_json_string(json_string, import_row_struct=None) bool ¶
Empty and fill a Data Table from JSON string.
- Parameters:
json_string (str) – The Data that representing the contents of a JSON file.
import_row_struct (ScriptStruct) – Optional row struct to apply on import. If set will also force the import to run automated (no questions or dialogs).
- Returns:
True if the operation succeeds, check the log for errors if it didn’t succeed.
- Return type:
- get_column_as_string(property_name) Array[str] ¶
Export from the DataTable all the row for one column. Export it as string. The row name is not included. see: GetDataTableColumnNames. see: GetDataTableColumnNameFromExportName.
- get_column_export_names() Array[str] ¶
Get the friendly export name of each column in this Data Table. see: GetDataTableColumnNameFromExportName.
- get_column_name_from_export_name(column_export_name) Name or None ¶
Get the raw property name of a data table column from its friendly export name.
- get_column_names() Array[Name] ¶
Get the name of each column in this Data Table. note: These are always the raw property names ( see: GetDataTableColumnAsString) rather than the friendly export name that would be used in a CSV/JSON export ( see: GetDataTableColumnNameFromExportName).
- get_row_struct() ScriptStruct ¶
Get the row struct used by the given Data Table, if any
- Return type: