deephaven.calendar

This module defines functions for working with business calendars.

add_calendar(cal)[source]

Adds a new business calendar to the set of available options.

Parameters:

cal (Union[BusinessCalendar, str]) – business calendar or a path to a business calendar file

Raises:

DHError

Return type:

None

calendar(name=None)[source]

Returns the calendar with the given name.

The returned calendar is an ‘io.deephaven.time.calendar.BusinessCalendar’ Java object that can be used in Python. For details on the available methods, see https://deephaven.io/core/javadoc/io/deephaven/time/calendar/BusinessCalendar.html. These methods must be called with string arguments or with Java date-time objects. To convert Python date-time objects to Java date-time objects, use the conversion functions in the ‘deephaven.time’ module.

Parameters:

name (str) – the name of the calendar. If not specified, the default calendar is returned.

Return type:

DType

Returns:

the calendar with the given name or the defalt calendar if name is not specified.

Raises:

DHError

calendar_name()[source]

Returns the default business calendar name.

The default business calendar is set by the ‘Calendar.default’ property or by calling ‘set_calendar’.

Return type:

str

Returns:

the default business calendar name

Raises:

DHError

calendar_names()[source]

Returns the names of all available calendar names.

Return type:

List[str]

Returns:

a list of all available calendar names

Raises:

DHError

remove_calendar(name)[source]

Removes the calendar with the given name from the set of available options.

Parameters:

name (str) – the name of the calendar to remove

Raises:

DHError

Return type:

None

set_calendar(name)[source]

Sets the default calendar.

Parameters:

name (str) – the name of the calendar

Raises:

DHError

Return type:

None