Skip to content

API Reference navrules.availability

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

navrules.availability

View source

AvailabilityWindow: ambient/temporal applicability of a rule set.

Extraction of nav-rewards RewardObject.evaluate_environment (base.py:309): time-of-day windows, day-month date windows, and direct attribute matching against the Environment (scalar equality, or membership for range/list).

Class AvailabilityWindow

Declarative availability constraints evaluated against an Environment.

Parameter Type Default Description
start_time Optional[time] None
end_time Optional[time] None
start_date Optional[str] None
end_date Optional[str] None
matches_attrs dict[str, Any] dict()

Fields:

Field Type Default Description
start_time Optional[time] None Inclusive time-of-day window.
end_time Optional[time] None
start_date Optional[str] None Inclusive day-month window (DD-MM), year taken from the environment's timestamp.
end_date Optional[str] None
matches_attrs dict[str, Any] field(default_factory=dict) Extra attributes matched against the environment: scalar => equality; list/range => membership.

Method AvailabilityWindow.from_dict

Build a window from the JSON availability_rule dict.

from_dict(availability: Optional[dict]) -> 'AvailabilityWindow'

Parameter Type Default Description
availability Optional[dict]

Returns: 'AvailabilityWindow'

Method AvailabilityWindow.matches

True when the environment falls inside every declared constraint.

matches(env: Environment) -> bool

Parameter Type Default Description
env Environment

Returns: bool

Alias Environment

Re-exported from navrules.environment.Environment.

Function parse_day_month

Parse a DD-MM (or DD/MM) string into a date in year.

Preserves the historical rewards behavior: the year is the current year unless given, and both separators are tolerated.

parse_day_month(value: str, year: Optional[int] = None) -> date

Parameter Type Default Description
value str
year Optional[int] None

Returns: date

Function parse_time

Parse HH:MM:SS into a time object.

parse_time(value: str, fmt: str = '%H:%M:%S') -> time

Parameter Type Default Description
value str
fmt str '%H:%M:%S'

Returns: time

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally