Orca · API

orca.key

Key: what a partition key is, whatever it counts.

A key is written as text (2024-01, 2024-01-31, log-0f3a), read back by parse, and ordered, for sorting and display. Month and Day are TimeKeys too: each has a next and a previous key, and the key a date falls in, which ranges, schedules' fills and sensors' day-to-month mapping need. Name (orca.name) is a key that isn't a date, so asking it for its next key doesn't compile. parse_keys reads the ranges and lists the command line takes for time keys.

Traits

Key

Implements Copyable, Equatable, Movable, Writable

__lt__

def __lt__(self, other: Self) -> Bool

parse

def parse(s: StringSpan) -> Self

Reads the key as write_to writes it, and nothing else.

TimeKey

A key that is a span of the calendar.

Implements Copyable, Equatable, Key, Movable, Writable

next

def next(self) -> Self

The key after this one.

prev

def prev(self) -> Self

The key before this one.

containing

def containing(year: Int, month: Int, day: Int) -> Self

The key a date falls in.

Functions

parse_keys

def parse_keys[K: TimeKey](s: StringSpan, first: StringSpan = "") -> List[K]

Reads a key, A..B (both ends included), or a comma-separated list of either, in the order given. A key given twice, or one before first (when given), is an error.