File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 * New ` _repr_html_() ` method on ` LabeledEnum ` class for formatted display of enum values with labels
1010 * CSS styling with ` .guidata-dataset-table ` class for consistent visual appearance
1111 * Automatically called by Jupyter when displaying objects as cell output
12+ * HTML representation now includes attribute names in a third column for easier programmatic access
13+
14+ * ** Interactive Python experience** : Improved DataSet representation in Python interpreters
15+ * New ` __repr__() ` method on ` DataSet ` class shows attribute names instead of labels
16+ * Makes it easy to discover attribute names when working interactively in a Python shell or notebook
17+ * ` print(dataset) ` still shows user-friendly labels, while ` repr(dataset) ` or just typing the variable shows attribute names
1218
1319* ** Secure build utility** : Added ` --prebuild ` option to run commands before package build
1420 * New ` --prebuild ` command-line argument for ` guidata.utils.securebuild `
Original file line number Diff line number Diff line change @@ -1606,6 +1606,14 @@ def __str__(self) -> str:
16061606 """Return string representation of the data set"""
16071607 return self .to_string (debug = False )
16081608
1609+ def __repr__ (self ) -> str :
1610+ """Return detailed representation showing attribute names.
1611+
1612+ This is useful in interactive Python sessions to discover
1613+ the attribute names needed to access/modify dataset items.
1614+ """
1615+ return self .to_string (debug = True )
1616+
16091617 def check (self ) -> list [str ]:
16101618 """Check the dataset item values
16111619
@@ -1858,12 +1866,19 @@ def to_html(self) -> str:
18581866 # Get string representation of value
18591867 value_str = item .get_string_value (self )
18601868
1869+ # Get attribute name for programmatic access
1870+ attr_name = item ._name
1871+
18611872 html += (
18621873 f'<tr><td style="text-align: right; vertical-align: top;">{ label } :</td>'
18631874 )
18641875 html += (
1865- f'<td style="text-align: left; padding-left: 10px;">'
1866- f"{ value_str } </td></tr>"
1876+ f'<td style="text-align: left; padding-left: 10px;">{ value_str } </td>'
1877+ )
1878+ html += (
1879+ f'<td style="text-align: left; padding-left: 15px; '
1880+ f'color: #888; font-family: monospace; font-size: 0.9em;">'
1881+ f"({ attr_name } )</td></tr>"
18671882 )
18681883
18691884 html += "</table>"
You can’t perform that action at this time.
0 commit comments