neptyne.cell

Neptyne's Cell API.

Cell ranges are the fundamental building block of Neptyne. They are the primary way to interact with data in a sheet.

Access to a cell's value is implicitly provided.

Set A1's value

A1 = 4

Retrieve A1's value

A1

Set A1's background color

A1.set_background_color('red')

For more high level context see Cell API Overview

class CellApiMixin:
def set_render_size(self, width: int, height: int) -> None:

Change the size of an object anchored in this cell.

For example, if B2 contains an Image, you can change the size of the image by calling B2.set_render_size(100, 100).

def get_render_size( self) -> tuple[int, int] | list[tuple[int, int]] | list[list[tuple[int, int]]]:

Get the size of an object anchored in this cell.

def clear(self) -> None:

Clear the cell's value

def is_empty(self) -> bool:

Check if the cell is empty

xy: tuple[int, int]

Get the cell's column and row indices respectively as a tuple of integers

def to_datetime(self) -> datetime.datetime:

Convert the cell's value to a datetime object

def set_note(self: Any, value: str | int | float) -> None:

Set the note of the cell

def set_color(self: Any, *args: Any) -> None:

Set the text color of the cell

Color may be specified in a variety of formats:

  1. As three integers representing the red, green, and blue components of the color, e.g. set_color(255, 0, 0)
  2. As a list or tuple of three integers, e.g. set_color([255, 0, 0])
  3. As a hex color string, e.g. set_color('#FF0000')
  4. As a named color e.g. set_color('red')
def set_background_color(self: Any, *args: Any) -> None:

Set the background color of the cell

Color may be specified in a variety of formats:

  1. As three integers representing the red, green, and blue components of the color, e.g. set_background_color(255, 0, 0)
  2. As a list or tuple of three integers, e.g. set_background_color([255, 0, 0])
  3. As a hex color string, e.g. set_background_color('#FF0000')
  4. As a named color e.g. set_background_color('red')