Model accessors (ipyflow.models)

These functions, also re-exported from the top-level ipyflow package, are the entry points to ipyflow’s data model. Most return a class whose classmethods query the whole graph; a few return a specific instance relative to the active cell.

Two accessors are overloaded. cells() with no argument returns the Cell class, while cells(cell_id) returns a single Cell; likewise symbols() returns the Symbol class, while symbols(sym) passes an instance through unchanged.

ipyflow.models.cells(cell_id: None = None) Type['Cell'][source]
ipyflow.models.cells(cell_id: IdType) Cell

Access the Cell model.

Called with no argument, returns the Cell class, whose classmethods (at_counter, from_id, current_cell, …) query all cells. Called with a cell_id – either an execution counter (int) or a frontend cell id – returns that specific Cell instance.

ipyflow.models.cell_above() Cell | None[source]

Return the cell immediately above the active cell, or None.

ipyflow.models.cell_below() Cell | None[source]

Return the cell immediately below the active cell, or None.

ipyflow.models.cell_at_offset(offset: int) Cell | None[source]

Return the cell offset positions from the active cell (may be negative).

ipyflow.models.last_run_cell() Cell | None[source]

Return the most recently executed cell, or None if none have run.

ipyflow.models.namespaces() Type[Namespace][source]

Return the Namespace class.

ipyflow.models.scopes() Type[Scope][source]

Return the Scope class.

ipyflow.models.symbols(sym: None = None) Type['Symbol'][source]
ipyflow.models.symbols(sym: Symbol) Symbol

Access the Symbol model.

Called with no argument, returns the Symbol class; called with a Symbol instance, returns it unchanged. The pass-through form is a convenience for generic code that accepts either the class or an instance.

ipyflow.models.statements() Type[Statement][source]

Return the Statement class.

ipyflow.models.timestamps() Type[Timestamp][source]

Return the Timestamp class.

See also

Data model for the classes these accessors expose.