set_display_options#

class set_display_options(
*,
style: Literal['html', 'text'] | None = None,
timezone: str | None = None,
time_format: Literal['iso', 'readable'] | None = None,
time_precision: Literal['s', 'ms', 'us', 'ns'] | None = None,
show_link: bool | None = None,
collapse_threshold: int | None = None,
max_items: int | None = None,
)[source]#

Bases: object

Change how instruments and publishers display in notebooks.

Options left out keep their current values. The change applies to the whole Python process. Used as a context manager, it lasts until the with block ends.

Parameters:
  • style

    "html" shows objects as formatted cards. "text" shows their plain repr.

  • timezone

    Time zone for timestamps: "UTC", "local", or an IANA name such as "Europe/Berlin".

  • time_format

    "iso" for ISO 8601, or "readable" for a space and the time zone’s name.

  • time_precision

    The finest unit timestamps show: "s", "ms", "us" or "ns".

  • show_link

    Whether cards link datasets to their pages in the Nominal app.

  • collapse_threshold

    Sections with more items than this start collapsed.

  • max_items

    The most items a section lists.

Raises:

ValueError – If an option has an invalid value, such as an unknown time zone.

Example

from instro.lib import set_display_options

set_display_options(timezone="America/Los_Angeles", time_precision="ms")

with set_display_options(show_link=False):
    psu  # shows the card without resolving Nominal links