Cell DSL API¶
Traits¶
Traits represent abstract properties that various operations may have
Commands with this trait provide some data to the function for writing. |
|
Commands with this trait parametrize data_type, generally assuming |
|
Commands with this trait provide some format_ to the function for writing. |
|
Commands with this trait target a cell relative to the current cell. |
|
Commands with this aspect target a specific cell at row and col |
|
Commands with this trait require some kind of real-valued size |
|
Commands with this trait require some kind of integer size |
|
Commands with this trait target a range of cells bounded by a box with top_left_point and bottom_right_point. |
|
Commands with this trait give a temporary point_name to the cell to be referenced later. |
|
Commands with this trait manage a list of resolve_refs. |
|
Commands with this trait have a dictionary of options |
|
Commands with this trait are active commands representing actions that will be done in the worksheet. |
- class xlsxwriter_celldsl.ops.traits.AbsolutePosition(row: int = - 1, col: int = - 1)[source]¶
Commands with this aspect target a specific cell at row and col
- c(col: numbers.Integral) xlsxwriter_celldsl.ops.traits.T[source]¶
Target the cell at col for this object.
- r(row: numbers.Integral) xlsxwriter_celldsl.ops.traits.T[source]¶
Target the cell at row for this object.
- class xlsxwriter_celldsl.ops.traits.CardinalSize(size: int = 0)[source]¶
Commands with this trait require some kind of integer size
- with_size(size: numbers.Integral) xlsxwriter_celldsl.ops.traits.T[source]¶
Specify the integral size for this object.
- class xlsxwriter_celldsl.ops.traits.Data(data: Any = '')[source]¶
Commands with this trait provide some data to the function for writing.
- class xlsxwriter_celldsl.ops.traits.DataType(data_type: Optional[str] = None)[source]¶
Commands with this trait parametrize data_type, generally assuming
Datatrait is also present.
- class xlsxwriter_celldsl.ops.traits.ExecutableCommand[source]¶
Commands with this trait are active commands representing actions that will be done in the worksheet.
- class xlsxwriter_celldsl.ops.traits.Format(set_format: Optional[xlsxwriter_celldsl.formats.FormatDict] = None)[source]¶
Commands with this trait provide some format_ to the function for writing.
- class xlsxwriter_celldsl.ops.traits.ForwardRef(resolved_refs: Dict[str, str] = NOTHING)[source]¶
Commands with this trait manage a list of resolve_refs.
- class xlsxwriter_celldsl.ops.traits.FractionalSize(size: float = 0.0)[source]¶
Commands with this trait require some kind of real-valued size
- with_size(size: numbers.Real) xlsxwriter_celldsl.ops.traits.T[source]¶
Specify the real-valued size for this object.
- class xlsxwriter_celldsl.ops.traits.NamedPoint(point_name: str = '__DEFAULT')[source]¶
Commands with this trait give a temporary point_name to the cell to be referenced later.
- class xlsxwriter_celldsl.ops.traits.Options(options: Dict[str, Any] = NOTHING)[source]¶
Commands with this trait have a dictionary of options
- class xlsxwriter_celldsl.ops.traits.Range(top_left_point: Union[str, int, Tuple[int, int]] = 0, bottom_right_point: Union[str, int, Tuple[int, int]] = 0)[source]¶
Commands with this trait target a range of cells bounded by a box with top_left_point and bottom_right_point.
Notes
top_left_point and bottom_right_point have different behavior depending on the value type
If it’s a string, this will be the save point name at which the save occurs.
If it’s an Integral
If positive: this will be last n-th visited cell.
If negative: this will be last n-th position in save stack which will be retrieved without popping it from the stack.
If zero, current cell will be the target.
If it’s Coords, it will be the absolute coords of the cell.
- class xlsxwriter_celldsl.ops.traits.RelativePosition(row: int = 0, col: int = 0)[source]¶
Commands with this trait target a cell relative to the current cell.
- c(delta_col: numbers.Integral) xlsxwriter_celldsl.ops.traits.T[source]¶
Specify a target delta_col away from current position for this object.
- r(delta_row: numbers.Integral) xlsxwriter_celldsl.ops.traits.T[source]¶
Specify a target delta_row away from current position for this object.
Operations¶
Operations are the commands that are executed after they’re committed
A command to move |
|
A command to go to a cell |
|
A command to |
|
A command to push current location into save stack. |
|
A command to pop last location from save stack and jump to it. |
|
A command to jump to |
|
A command to save current location |
|
A forward reference to an array of cells |
|
A command that does nothing, but may assist in debugging and documentation of scripts by giving providing segments in script |
|
A command that indicates an end of the most recent SectionBeginOp. |
|
A command to write to this cell |
|
A command to merge |
|
A command to write a text run |
|
A command to append to merge current cell’s format |
|
A command to override current cell’s format |
|
Draw a box with borders where top_left_point and bottom_right_point are respective corners using (right|top|left|bottom)_formats. |
|
|
A command to make a box |
A command to set current row’s height |
|
A command to set current column’s height with |
|
A command to submit a horizontal page break at current row. |
|
A command to submit a vertical page break at current row. |
|
A command to apply all existing pagebreaks. |
|
A command to add a comment to this cell |
|
A command to add a chart to this cell perhaps |
|
A command to add a conditional format to a range of cells |
|
A command to add an image to this cell either getting it |
|
A command that allows to set the printed area of the sheet as a box |
- class xlsxwriter_celldsl.ops.classes.AddChartOp(NAME_STACK_DATA: List[str] = NOTHING, resolved_refs: Dict[str, str] = NOTHING, type: str = 'bar', subtype: Optional[str] = None, target: xlsxwriter_celldsl.ops.classes.T = NOTHING, action_chain: List[Tuple[str, Tuple[Any, ...], Dict[str, Any]]] = NOTHING)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.ExecutableCommand,xlsxwriter_celldsl.ops.traits.ForwardRef,Generic[xlsxwriter_celldsl.ops.classes.T]A command to add a chart to this cell perhaps
with_subtype()and thendo()call some methods on the associated target class.- do(command_list)[source]¶
Add command_list to action_chain
Example
>>> from xlsxwriter_celldsl.ops import AddLineChart, AddBarChart, RefArray ... AddLineChart.do([ ... # You really should only use `target` attribute of this class ... AddLineChart.target.add_series({'values': '=SheetName!$A$1:$D$1'}), ... # Charts allow to use `RefArray` in place of literal cell ranges ... AddLineChart.target.add_series({'values': RefArray.at('some ref')}), ... # Combine method accepts AddChartOp ... AddLineChart.target.combine( ... # This will combine this line chart with a bar chart ... AddBarChart.do([]) ... ) ... ])
- class xlsxwriter_celldsl.ops.classes.AddCommentOp(NAME_STACK_DATA: List[str] = NOTHING, data: Any = '', options: Dict[str, Any] = NOTHING)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.Data,xlsxwriter_celldsl.ops.traits.Options,xlsxwriter_celldsl.ops.traits.ExecutableCommandA command to add a comment to this cell
with_data(), configuredwith_options().
- class xlsxwriter_celldsl.ops.classes.AddConditionalFormatOp(NAME_STACK_DATA: List[str] = NOTHING, top_left_point: Union[str, int, Tuple[int, int]] = 0, bottom_right_point: Union[str, int, Tuple[int, int]] = 0, options: Dict[str, Any] = NOTHING, set_format: Optional[xlsxwriter_celldsl.formats.FormatDict] = None)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.ExecutableCommand,xlsxwriter_celldsl.ops.traits.Range,xlsxwriter_celldsl.ops.traits.Options,xlsxwriter_celldsl.ops.traits.FormatA command to add a conditional format to a range of cells
with_top_left()andwith_bottom_right()corners parametrizedwith_options().To configure the format, you can either use
with_format()or specify theFormatDictas format key in options. Do not use both at the same time however.
- class xlsxwriter_celldsl.ops.classes.AddImageOp(NAME_STACK_DATA: List[str] = NOTHING, options: Dict[str, Any] = NOTHING, file_path: str = '')[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.ExecutableCommand,xlsxwriter_celldsl.ops.traits.OptionsA command to add an image to this cell either getting it
with_filepath()or constructing itwith_image_data(), parametrizedwith_options().
- class xlsxwriter_celldsl.ops.classes.ApplyPagebreaksOp(NAME_STACK_DATA: List[str] = NOTHING)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.CommandA command to apply all existing pagebreaks. Should come after all SubmitHPagebreakOp and SubmitVPagebreakOp have been committed.
- class xlsxwriter_celldsl.ops.classes.AtCellOp(NAME_STACK_DATA: List[str] = NOTHING, row: int = - 1, col: int = - 1)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.AbsolutePositionA command to go to a cell
r()andc().
- class xlsxwriter_celldsl.ops.classes.BacktrackCellOp(NAME_STACK_DATA: List[str] = NOTHING, n: int = 0)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.CommandA command to
rewind()the position back in time. 0 stays in current cell, 1 goes to previous cell…
- class xlsxwriter_celldsl.ops.classes.DrawBoxBorderOp(NAME_STACK_DATA: List[str] = NOTHING, top_left_point: Union[str, int, Tuple[int, int]] = 0, bottom_right_point: Union[str, int, Tuple[int, int]] = 0, right_format: Mapping = {'right': 1}, top_format: Mapping = {'top': 1}, left_format: Mapping = {'left': 1}, bottom_format: Mapping = {'bottom': 1})[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.RangeDraw a box with borders where top_left_point and bottom_right_point are respective corners using (right|top|left|bottom)_formats.
- class xlsxwriter_celldsl.ops.classes.ImposeFormatOp(NAME_STACK_DATA: List[str] = NOTHING, set_format={})[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.FormatA command to append to merge current cell’s format
with_format().
- class xlsxwriter_celldsl.ops.classes.LoadOp(NAME_STACK_DATA: List[str] = NOTHING, point_name: str = '__DEFAULT')[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.NamedPointA command to jump to
at()a save point.
- class xlsxwriter_celldsl.ops.classes.MergeWriteOp(NAME_STACK_DATA: List[str] = NOTHING, size: int = 0, data: Any = '', data_type: Optional[str] = None, set_format: Optional[xlsxwriter_celldsl.formats.FormatDict] = None)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.CardinalSize,xlsxwriter_celldsl.ops.traits.Data,xlsxwriter_celldsl.ops.traits.DataType,xlsxwriter_celldsl.ops.traits.Format,xlsxwriter_celldsl.ops.traits.ExecutableCommandA command to merge
with_size()cols starting from current col and writewith_data()with datawith_data_type()andwith_format()into this cell.
- class xlsxwriter_celldsl.ops.classes.MoveOp(NAME_STACK_DATA: List[str] = NOTHING, row: int = 0, col: int = 0)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.RelativePositionA command to move
r()rows andc()columns away from current cell.
- class xlsxwriter_celldsl.ops.classes.OverrideFormatOp(NAME_STACK_DATA: List[str] = NOTHING, set_format: Optional[xlsxwriter_celldsl.formats.FormatDict] = None)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.FormatA command to override current cell’s format
with_format().
- class xlsxwriter_celldsl.ops.classes.RefArrayOp(NAME_STACK_DATA: List[str] = NOTHING, top_left_point: Union[str, int, Tuple[int, int]] = 0, bottom_right_point: Union[str, int, Tuple[int, int]] = 0, point_name: str = '__DEFAULT')[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.Range,xlsxwriter_celldsl.ops.traits.NamedPointA forward reference to an array of cells
with_name()defined using a rectangle withtop_left()andbottom_right()specified. This is only used in charts.This is also a marker for such an array, meaning in commands that support forward references, you can use RefArray.at(‘name’) to use a reference, which will be replaced with a string like
'=SheetName!$C$1:$F$9'.
- class xlsxwriter_celldsl.ops.classes.SaveOp(NAME_STACK_DATA: List[str] = NOTHING, point_name: str = '__DEFAULT')[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.NamedPointA command to save current location
at()memory location.
- class xlsxwriter_celldsl.ops.classes.SectionBeginOp(NAME_STACK_DATA: List[str] = NOTHING, name: str = '__UNNAMED')[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.CommandA command that does nothing, but may assist in debugging and documentation of scripts by giving providing segments in script
with_name().During execution, if an error occurs, the surrounding names will be displayed, in order from most recent to least recent.
- class xlsxwriter_celldsl.ops.classes.SectionEndOp(NAME_STACK_DATA: List[str] = NOTHING)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.CommandA command that indicates an end of the most recent SectionBeginOp.
- class xlsxwriter_celldsl.ops.classes.SetColumnWidthOp(NAME_STACK_DATA: List[str] = NOTHING, size: float = 0.0)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.FractionalSize,xlsxwriter_celldsl.ops.traits.ExecutableCommandA command to set current column’s height with
with_size().
- class xlsxwriter_celldsl.ops.classes.SetPrintAreaOp(NAME_STACK_DATA: List[str] = NOTHING, top_left_point: Union[str, int, Tuple[int, int]] = 0, bottom_right_point: Union[str, int, Tuple[int, int]] = 0)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.ExecutableCommand,xlsxwriter_celldsl.ops.traits.RangeA command that allows to set the printed area of the sheet as a box
with_top_left()andwith_bottom_right()
- class xlsxwriter_celldsl.ops.classes.SetRowHeightOp(NAME_STACK_DATA: List[str] = NOTHING, size: float = 0.0)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.FractionalSize,xlsxwriter_celldsl.ops.traits.ExecutableCommandA command to set current row’s height
with_size().
- class xlsxwriter_celldsl.ops.classes.StackLoadOp(NAME_STACK_DATA: List[str] = NOTHING)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.CommandA command to pop last location from save stack and jump to it.
- class xlsxwriter_celldsl.ops.classes.StackSaveOp(NAME_STACK_DATA: List[str] = NOTHING)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.CommandA command to push current location into save stack.
- class xlsxwriter_celldsl.ops.classes.SubmitHPagebreakOp(NAME_STACK_DATA: List[str] = NOTHING)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.CommandA command to submit a horizontal page break at current row. This is preserved between several cell_dsl_context.
- class xlsxwriter_celldsl.ops.classes.SubmitVPagebreakOp(NAME_STACK_DATA: List[str] = NOTHING)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.CommandA command to submit a vertical page break at current row. This is preserved between several cell_dsl_context.
- class xlsxwriter_celldsl.ops.classes.WriteOp(NAME_STACK_DATA: List[str] = NOTHING, data: Any = '', data_type: Optional[str] = None, set_format: Optional[xlsxwriter_celldsl.formats.FormatDict] = None)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.Data,xlsxwriter_celldsl.ops.traits.DataType,xlsxwriter_celldsl.ops.traits.Format,xlsxwriter_celldsl.ops.traits.ExecutableCommandA command to write to this cell
with_data()with datawith_data_type()andwith_format().
- class xlsxwriter_celldsl.ops.classes.WriteRichOp(NAME_STACK_DATA: List[str] = NOTHING, data: Any = '', set_format: Optional[xlsxwriter_celldsl.formats.FormatDict] = None, default_format=NOTHING, cell_format: Optional[xlsxwriter_celldsl.formats.FormatDict] = None, prev_fragment: Optional[WriteRichOp] = None)[source]¶
Bases:
xlsxwriter_celldsl.ops.classes.Command,xlsxwriter_celldsl.ops.traits.Data,xlsxwriter_celldsl.ops.traits.Format,xlsxwriter_celldsl.ops.traits.ExecutableCommandA command to write a text run
with_data()andwith_format()to current position,then()perhaps write some more, optionallywith_default_format().Additionally, the first WriteRichOp may also set this cell
with_cell_format().- then(fragment: xlsxwriter_celldsl.ops.classes.WriteRichOp)[source]¶
Submit additional fragments of the rich string
- with_cell_format(format: Optional[xlsxwriter_celldsl.formats.FormatDict])[source]¶
If format is not None, then set the cell format to be set to the cell upon writing.
This method does not implicitly merge with DEFAULT_FORMAT.
Utils¶
Various helpful objects and functions
- class xlsxwriter_celldsl.utils.WorkbookPair(wb: xlsxwriter.workbook.Workbook, fmt: xlsxwriter_celldsl.formats.FormatHandler)[source]¶
A pair used to bundle a
FormatHandlerand a Workbook- add_worksheet(name)[source]¶
Create a worksheet and bind it into a
WorksheetTriplet
- classmethod from_wb(wb)[source]¶
Bind a
Workbookinto aWorkbookPair
- class xlsxwriter_celldsl.utils.WorksheetTriplet(wb: xlsxwriter.workbook.Workbook, ws: xlsxwriter.worksheet.Worksheet, fmt: xlsxwriter_celldsl.formats.FormatHandler)[source]¶
A triplet used for cell_dsl operations.
- xlsxwriter_celldsl.utils.chain_rich(iterable: Iterable[WriteRichOp]) WriteRichOp[source]¶
Take an iterable of WriteRich segments and combine them to produce a single WriteRich operation.
- xlsxwriter_celldsl.utils.col_chain(iterable: Iterable, initial_save_name: Optional[str] = None, final_save_name: Optional[str] = None, range_name: Optional[str] = None, array_name: Optional[str] = None, step=1) List[CommitTypes][source]¶
Iterate iterable and insert step NextRows between each command and then come back to start Perhaps also save initial location as initial_save_name and final location as final_save_name. Perhaps also make the result a named range with name range_name. Perhaps add a forward reference as well with name array_name.
- xlsxwriter_celldsl.utils.row_chain(iterable: Iterable, initial_save_name: Optional[str] = None, final_save_name: Optional[str] = None, range_name: Optional[str] = None, array_name: Optional[str] = None, step=1) List[CommitTypes][source]¶
Iterate iterable and insert step NextCols between each command and then come back to start Perhaps also save initial location as initial_save_name and final location as final_save_name. Perhaps also make the result a named range with name range_name. Perhaps add a forward reference as well with name array_name.
Formats¶
Various utilities to deal with formats
- class xlsxwriter_celldsl.formats.FormatDict[source]¶
A special variant of vanilla dictionary that implement __or__ and __hash__. Used to create and merge formats.
Examples
>>> F = FormatDict >>> F1 = F({'font_name': 'Arial'}) >>> F2 = F({'font_size': 12}) >>> F3 = F({'font_name': 'Arial', 'font_size': 12}) >>> F1 | F2 == F3 True >>> F2 | F1 == F3 True >>> hash(F1 | F2) == hash(F3) True
Cell DSL module¶
- class xlsxwriter_celldsl.cell_dsl.CellDSLContext(target: xlsxwriter_celldsl.utils.WorksheetTriplet, initial_row: int = 0, initial_col: int = 0, stat_receiver: Optional[xlsxwriter_celldsl.cell_dsl.StatReceiver] = None, overwrites_ok: bool = False)[source]¶
A context manager inside which you can perform writes and change cells in target in an arbitrary order, starting at initial_row and initial_col, even writing multiple times to a cell if overwrites_ok.
After it exits, it will execute those changes and send stats to stat_receiver.
This context manager returns an
ExecutorHelperobject, usecommit()method to submit operations to be executed.- Parameters
target – Target WorksheetTriplet to apply changes with
stat_receiver – This is a reference to a StatReceiver object that will receive all data about visited cells and save points.
initial_row – Starting row, zero-based
initial_col – Starting column, zero-based
overwrites_ok – If True, it is expected that there may be several writes with different data to the same cell, which is ordinarily a sign of a bug since the result would be ambiguous. If False, overwrites raise
ExecutionCellDSLError.
- class xlsxwriter_celldsl.cell_dsl.ExecutorHelper(action_chain: List[xlsxwriter_celldsl.ops.classes.Command] = NOTHING)[source]¶
A special object that performs some preprocessing of the commands when commit is called and stores the actions to be executed in action_chain
- commit(chain: Optional[Union[Iterable[Optional[Union[Iterable[CommitTypes], xlsxwriter_celldsl.ops.classes.Command, int, str, dict, xlsxwriter_celldsl.formats.FormatDict]]], xlsxwriter_celldsl.ops.classes.Command, int, str, dict, xlsxwriter_celldsl.formats.FormatDict]])[source]¶
Commit this chain to action_chain.
Notes
int acts like a shortcut for one or several MoveOp commands. Look at how the numbers correspond to the step direction, same as using a numpad.
7 8 9 ↖ ↑ ↗ 4 5 6 ← . → 1 2 3 ↙ ↓ ↘
Examples
>>> from xlsxwriter_celldsl.ops import Write, Move, WriteRich >>> from xlsxwriter_celldsl.formats import FormatsNamespace as F >>> E1 = ExecutorHelper() >>> E1.commit([ ... Write.with_data('Alpha'), 943, # Write alpha, follow by moving ↗←↘ --> → ... [Write.with_data('Beta')], # Nested sequences are flattened ... "Gamma", 2, # Lone strings are short forms of WriteOp.with_data(...) ... # Dictionaries followed by a string is a short form of ... # WriteOp.with_data(str).with_format(...) ... F.default_font, "Delta", 2, ... # Consecutive short forms of WriteOp are merged into WriteRich ... F.default_font, F.center, "Epsilon ", ... F.default_font, F.bold, " Eta", ... F.italic, "!", ... # Ending the short form with a format will set this cell to this format ... F.wrapped ... None # None is skipped ... ]) >>> E2 = ExecutorHelper() >>> E2.commit([ ... Write.with_data('Alpha'), ... Move.c(1).r(0), # → ... Write.with_data('Beta'), ... Write.with_data("Gamma"), ... Move.r(1), ... Write.with_data("Delta").with_format(F.default_font), ... Move.r(1), ... WriteRich.with_data("Epsilon ").with_format(F.default_font | F.center).then( ... WriteRich.with_data(" Eta").with_format(F.default_font | F.bold) ... ).then( ... # `with_format` implicitly merges with `F.default_font`, more specifically ... # `Format.FALLBACK_FONT` ... WriteRich.with_data("!").with_format(F.default_font | F.italic) ... # Cell formats here are an exception to implicit merges ... # since it's not used to set the text appearance, but the cell's ... .with_cell_format(F.wrapped) ... ) ... ]) >>> E1.action_chain == E2.action_chain True
- class xlsxwriter_celldsl.cell_dsl.StatReceiver[source]¶
Receiver object for stats after cell_dsl_context context finishes execution.
- coord_pairs¶
A list of pairs, with the first element being the coordinate pair and the second being the command executed.
- xlsxwriter_celldsl.cell_dsl.cell_dsl_context¶