CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-pynetworktables

tessl install tessl/pypi-pynetworktables@2021.0.0

A pure Python implementation of NetworkTables, used for robot communications in the FIRST Robotics Competition.

Agent Success

Agent success rate when using this tile

75%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.01x

Baseline

Agent success rate without this tile

74%

task.mdevals/scenario-1/

Entry Metadata Toolkit

Utility module for managing key-value entries with explicit defaults, persistence controls, type-safe updates, and metadata snapshots.

Capabilities

Initialize entries with persistence-aware defaults

  • Creating an entry with a default value applies that default only when the entry is unset, and marks the entry as persistent when requested; subsequent reads reflect the persisted default. @test

Enforce or override entry typing on updates

  • Updating an entry with a value of a different type than the existing entry type raises an error unless an explicit override flag is provided; when overriding, the entry's stored type updates to the new value's type. @test

Surface entry metadata snapshots

  • Requesting a snapshot returns the entry name, current data type as a human-readable string, whether the entry is persistent, and the last change timestamp in milliseconds; after an update, the timestamp reflects the latest change. @test

Clear persistence and values

  • Clearing an entry removes its persistence flag and deletes its stored value so subsequent reads return the provided fallback instead of the old value. @test

Implementation

@generates

API

from typing import Any, Dict

def init_entry(table: Any, key: str, default: Any = None, persistent: bool = False) -> Any:
    """Ensure an entry exists for the key, apply the default if unset, optionally mark it persistent, and return the entry handle."""

def update_entry(entry: Any, value: Any, *, allow_type_override: bool = False) -> None:
    """Write a value to an entry; reject type changes unless allow_type_override is True, in which case the stored type is replaced."""

def entry_snapshot(entry: Any) -> Dict[str, Any]:
    """Return metadata including name, human-readable data type, persistence status, and last-change timestamp (ms)."""

def clear_entry(entry: Any, *, fallback: Any = None) -> Any:
    """Remove persistence, delete the stored value, and return the value that subsequent reads should yield as a fallback."""

Dependencies { .dependencies }

pynetworktables { .dependency }

Pure-Python NetworkTables implementation for key/value communication.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pynetworktables@2021.0.x
tile.json