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-4/

Network Table Persistence Toolkit

Utility module for storing, restoring, and filtering network table entries using the dependency's native persistence format.

Capabilities

Write and tag entries

  • Writing an entry with persistent=True marks it for disk persistence; writing the same key later with persistent=False clears persistence while keeping the current value. @test

Save and restore persistent state

  • Saving after tagging entries writes only those marked persistent; loading from that file overwrites in-memory values for those keys while leaving non-persistent keys unchanged. @test

Filtered snapshots

  • Requesting a snapshot with prefixes writes only matching entries to disk using the dependency's persistence format and returns the exported key/value pairs. @test

Filtered load merge

  • Loading a snapshot file with prefixes applies only matching entries into the live tables while leaving other keys untouched. @test

Implementation

@generates

API

from typing import Any, Iterable

def write_entry(key: str, value: Any, *, persistent: bool = False) -> None:
    ...

def save_persistent(filepath: str) -> None:
    ...

def load_persistent(filepath: str) -> dict[str, Any]:
    ...

def snapshot_filtered(filepath: str, prefixes: Iterable[str]) -> dict[str, Any]:
    ...

def load_filtered(filepath: str, prefixes: Iterable[str]) -> dict[str, Any]:
    ...

Dependencies { .dependencies }

pynetworktables { .dependency }

Uses the dependency's built-in network table entry storage and persistence format to write/read entries and snapshots.

Version

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