Python API Reference

This page documents the Python package ezsnmp_data_logger, its CLI entry point, and the cross-platform GUI modules (CliSubprocessBridge and StudioHttpServer) that drive the CLI behind the scenes across Linux, macOS, and Windows.

Top-Level Package (ezsnmp_data_logger)

ezsnmp_data_logger: C++17 SNMP Data Logger powered by ezsnmp with SWIG bindings.

class ezsnmp_data_logger.Batch[source]

Proxy of C++ ezsnmp_data_logger::Batch class.

property dut_ip
property dut_name
static from_json(json_text) → Batch[source]

Parameters

json_text: std::string const &

property samples
property thisown

The membership flag

to_json(self, indent=-1) → std::string[source]

Parameters

indent: int

property ts_unix_ns
class ezsnmp_data_logger.CliResult[source]

Proxy of C++ ezsnmp_data_logger::CliResult class.

property exit_code
property stderr_text
property stdout_text
property thisown

The membership flag

to_json(self, indent=-1) → std::string[source]

Parameters

indent: int

class ezsnmp_data_logger.CliRunner[source]

Proxy of C++ ezsnmp_data_logger::CliRunner class.

static execute(args) → CliResult[source]

Parameters

args: std::vector< std::string,std::allocator< std::string > > const &

static request_stop()[source]
static run(args) → int[source]

Parameters

args: std::vector< std::string,std::allocator< std::string > > const &

property thisown

The membership flag

class ezsnmp_data_logger.DataLogger(*args)[source]

Proxy of C++ ezsnmp_data_logger::DataLogger class.

config_json(self, indent=2) → std::string[source]

Parameters

indent: int

flush(self)[source]
static from_file(file_path) → DataLogger[source]

Parameters

file_path: std::string const &

static inspect_json(json_config, limit=50, dut_filter='', metric_filter='', indent=-1) → std::string[source]

Parameters

json_config: std::string const & limit: int dut_filter: std::string const & metric_filter: std::string const & indent: int

is_running(self) → bool[source]
static probe(config, dut_filter='') → DutProbeResultVector[source]

Parameters

config: ezsnmp_data_logger::LoggerConfig const & dut_filter: std::string const &

static probe_json(json_config, dut_filter='', indent=-1) → std::string[source]

Parameters

json_config: std::string const & dut_filter: std::string const & indent: int

push_batch(self, batch) → bool[source]

Parameters

batch: ezsnmp_data_logger::Batch const &

push_batch_json(self, batch_json) → bool[source]

Parameters

batch_json: std::string const &

static request_json(json_config, dut_name, operation, oids, max_repeaters=10, record_to_sinks=False, indent=-1) → std::string[source]

Parameters

json_config: std::string const & dut_name: std::string const & operation: std::string const & oids: std::vector< std::string,std::allocator< std::string > > const & max_repeaters: int record_to_sinks: bool indent: int

run(self)[source]
run_once(self) → BatchVector[source]
static set_json(json_config, dut_name, oid, set_type, set_value, record_to_sinks=False, indent=-1) → std::string[source]

Parameters

json_config: std::string const & dut_name: std::string const & oid: std::string const & set_type: std::string const & set_value: std::string const & record_to_sinks: bool indent: int

start(self)[source]
stats(self) → LoggerStats[source]
stats_json(self, indent=-1) → std::string[source]

Parameters

indent: int

stop(self)[source]
property thisown

The membership flag

class ezsnmp_data_logger.DutConfig[source]

Proxy of C++ ezsnmp_data_logger::DutConfig class.

property dut_ip
property enabled
property metrics
property name
property poll_interval_ms
property snmp
property thisown

The membership flag

class ezsnmp_data_logger.DutProbeResult[source]

Proxy of C++ ezsnmp_data_logger::DutProbeResult class.

property dut_ip
property dut_name
property error
property latency_ms
property reachable
property samples
property thisown

The membership flag

to_json(self, indent=-1) → std::string[source]

Parameters

indent: int

class ezsnmp_data_logger.GuiConfig[source]

Proxy of C++ ezsnmp_data_logger::GuiConfig class.

property cli_executable
property frontend
property host
property locale
property locale_file
property max_log_lines
property open_browser
property port
property refresh_interval_ms
property theme
property thisown

The membership flag

property window_height
property window_width
class ezsnmp_data_logger.InspectRow[source]

Proxy of C++ ezsnmp_data_logger::InspectRow class.

property dut_ip
property dut_name
property f64
property i64
property metric_name
property oid
property oid_index
property raw_value
property sink_type
property snmp_type
property status
property str_val
property thisown

The membership flag

to_json(self, indent=-1) → std::string[source]

Parameters

indent: int

property ts_unix_ns
property type_tag
class ezsnmp_data_logger.LoggerConfig[source]

Proxy of C++ ezsnmp_data_logger::LoggerConfig class.

property duts
static from_file(file_path) → LoggerConfig[source]

Parameters

file_path: std::string const &

static from_json(json_text) → LoggerConfig[source]

Parameters

json_text: std::string const &

property gui
property logger
property sinks
property thisown

The membership flag

to_json(self, indent=2) → std::string[source]

Parameters

indent: int

class ezsnmp_data_logger.LoggerRuntimeConfig[source]

Proxy of C++ ezsnmp_data_logger::LoggerRuntimeConfig class.

property log_level
property max_cycles
property poll_interval_ms
property process_start_method
property queue_depth
property run_duration_seconds
property stats_interval_ms
property status_file
property thisown

The membership flag

property worker_threads
property zmq_endpoint
property zmq_hwm
class ezsnmp_data_logger.LoggerStats[source]

Proxy of C++ ezsnmp_data_logger::LoggerStats class.

property cycles_completed
property dropped_batches
property last_error
property poll_errors
property processed_batches
property processed_samples
property queue_depth
property running
property sink_errors
property thisown

The membership flag

to_json(self, indent=-1) → std::string[source]

Parameters

indent: int

property uptime_ms
class ezsnmp_data_logger.MetricConfig[source]

Proxy of C++ ezsnmp_data_logger::MetricConfig class.

property max_repeaters
property name
property oid
property operation
property set_type
property set_value
property thisown

The membership flag

class ezsnmp_data_logger.Sample[source]

Proxy of C++ ezsnmp_data_logger::Sample class.

display_value(self) → std::string[source]
property f64
static from_json(json_text) → Sample[source]

Parameters

json_text: std::string const &

property i64
static make_float(name, oid_str, val, status_code=0) → Sample[source]

Parameters

name: std::string const & oid_str: std::string const & val: double status_code: int

static make_int(name, oid_str, val, status_code=0) → Sample[source]

Parameters

name: std::string const & oid_str: std::string const & val: int64_t status_code: int

static make_string(name, oid_str, val, status_code=0) → Sample[source]

Parameters

name: std::string const & oid_str: std::string const & val: std::string const & status_code: int

property metric_name
property oid
property oid_index
property raw_value
property snmp_type
property status
property str_val
property thisown

The membership flag

to_json(self, indent=-1) → std::string[source]

Parameters

indent: int

property type_tag
class ezsnmp_data_logger.SinkConfig[source]

Proxy of C++ ezsnmp_data_logger::SinkConfig class.

property dir
property enabled
property flush_every_n
property prometheus_host
property prometheus_port
property prometheus_prefix
property psql_batch_size
property psql_conninfo
property psql_enable_timescaledb
property psql_reconnect_delay_ms
property sqlite_commit_every_ms
property sqlite_commit_every_n
property sqlite_path
property thisown

The membership flag

property type
class ezsnmp_data_logger.SnmpConfig[source]

Proxy of C++ ezsnmp_data_logger::SnmpConfig class.

property auth_passphrase
property auth_protocol
property boots_time
property community
property context
property context_engine_id
property load_mibs
property mib_directories
property mode
property port_number
property print_enums_numerically
property print_full_oids
property print_hex_strings
property print_oids_numerically
property print_timeticks_numerically
property privacy_passphrase
property privacy_protocol
property retries
property security_engine_id
property security_level
property security_username
property thisown

The membership flag

property timeout_seconds
property version
class ezsnmp_data_logger.ValidationReport[source]

Proxy of C++ ezsnmp_data_logger::ValidationReport class.

property enabled_duts
property enabled_sinks
property errors
property thisown

The membership flag

to_json(self, indent=-1) → std::string[source]

Parameters

indent: int

property total_metrics
property valid
property warnings

CLI Module (ezsnmp_data_logger.cli)

Command-line entry point for ezsnmp_data_logger (delegates to C++17 CliRunner or GUI).

ezsnmp_data_logger.cli.main(argv: list[str] | None = None) → int[source]

Execute the ezsnmp_data_logger CLI or launch the cross-platform GUI.

GUI Launcher (ezsnmp_data_logger.gui)

Cross-platform Graphical User Interface launcher for ezsnmp_data_logger.

Supports Linux, macOS, and Windows via: 1. tk: Native cross-platform desktop application (tkinter.ttk), or 2. web: Cross-platform Browser Studio (http.server + HTML5/SVG).

Both frontends interact strictly with the ezsnmp-data-logger CLI behind the scenes and store 100% of configuration and GUI settings in JSON.

class ezsnmp_data_logger.gui.CliSubprocessBridge(config_path: str | Path, cli_override: str = '')[source]

Thread-safe controller that drives ezsnmp-data-logger strictly via CLI + JSON.

cli_base_command() → list[str][source]
init_config_template(template_name: str = 'demo') → dict[str, Any][source]
inspect(limit: int = 50, dut: str = '', metric: str = '') → dict[str, Any][source]
is_running() → bool[source]
load_config_dict() → dict[str, Any][source]
load_config_text() → str[source]
probe(dut_name: str = '') → dict[str, Any][source]
request(dut_name: str, operation: str, oids: list[str], max_repeaters: int = 10, record: bool = False) → dict[str, Any][source]
run_once() → dict[str, Any][source]
save_config_dict(config_obj: dict[str, Any]) → dict[str, Any][source]
save_config_text(raw_json: str) → dict[str, Any][source]
schema() → dict[str, Any][source]
set_oid(dut_name: str, oid: str, set_type: str, value: str, record: bool = False) → dict[str, Any][source]
snapshot() → dict[str, Any][source]

Return a thread-safe live telemetry & CLI audit snapshot for GUI rendering.

start_run() → dict[str, Any][source]
stop_run(timeout: float = 8.0) → dict[str, Any][source]
validate(config_text: str | None = None) → dict[str, Any][source]
version_info() → dict[str, Any][source]
class ezsnmp_data_logger.gui.LocaleManager(locale: str = 'en', locale_file: str | Path | None = None)[source]

Manages string resolution, language selection, and fallback for GUIs.

Supports the key-centric format: {“LOCALE_KEY_NAME”: {“en”: “…”, “es”: “…”, …}}

get_locale_dict(locale: str | None = None) → dict[str, str][source]

Return flat dictionary mapping each key to its string for the requested locale.

reload() → None[source]

Load or reload locale definitions from JSON file.

set_locale(locale: str) → None[source]

Switch active locale (e.g. ‘en’, ‘es’).

supported_locales() → list[str][source]

Return list of supported locale codes in the loaded catalog.

t(key: str, default: str | None = None, **kwargs: Any) → str[source]

Translate a key into the active locale with keyword formatting.

Looks up _catalog[key][locale], falling back to _catalog[key][‘en’] or default / key.

ezsnmp_data_logger.gui.can_use_tkinter_display() → bool[source]

Return True if tkinter is installed and a graphical display is available.

ezsnmp_data_logger.gui.main(argv: list[str] | None = None) → int[source]

CLI entry point for ezsnmp-data-logger-gui and ezsnmp-data-logger gui.

ezsnmp_data_logger.gui.select_frontend(requested: str) → str[source]

Resolve ‘auto’ | ‘tk’ | ‘web’ to a concrete cross-platform frontend.

GUI Behind-the-Scenes CLI Bridge (ezsnmp_data_logger.gui.cli_bridge)

Pure CLI subprocess + JSON bridge powering all ezsnmp_data_logger GUIs.

All Graphical User Interfaces (native tkinter.ttk desktop and Browser Web Studio) interact exclusively with the ezsnmp-data-logger CLI behind the scenes and store 100% of settings in JSON configuration files.

class ezsnmp_data_logger.gui.cli_bridge.CliSubprocessBridge(config_path: str | Path, cli_override: str = '')[source]

Thread-safe controller that drives ezsnmp-data-logger strictly via CLI + JSON.

cli_base_command() → list[str][source]
init_config_template(template_name: str = 'demo') → dict[str, Any][source]
inspect(limit: int = 50, dut: str = '', metric: str = '') → dict[str, Any][source]
is_running() → bool[source]
load_config_dict() → dict[str, Any][source]
load_config_text() → str[source]
probe(dut_name: str = '') → dict[str, Any][source]
request(dut_name: str, operation: str, oids: list[str], max_repeaters: int = 10, record: bool = False) → dict[str, Any][source]
run_once() → dict[str, Any][source]
save_config_dict(config_obj: dict[str, Any]) → dict[str, Any][source]
save_config_text(raw_json: str) → dict[str, Any][source]
schema() → dict[str, Any][source]
set_oid(dut_name: str, oid: str, set_type: str, value: str, record: bool = False) → dict[str, Any][source]
snapshot() → dict[str, Any][source]

Return a thread-safe live telemetry & CLI audit snapshot for GUI rendering.

start_run() → dict[str, Any][source]
stop_run(timeout: float = 8.0) → dict[str, Any][source]
validate(config_text: str | None = None) → dict[str, Any][source]
version_info() → dict[str, Any][source]
ezsnmp_data_logger.gui.cli_bridge.resolve_cli_command(cli_override: str = '') → list[str][source]

Locate the ezsnmp-data-logger CLI command across Linux, macOS, and Windows.

GUI Cross-Platform Browser Studio Server (ezsnmp_data_logger.gui.server)

Cross-platform Browser Studio HTTP server for Linux, macOS, and Windows.

Uses Python’s standard-library ThreadingHTTPServer so zero external web frameworks are required, delegating 100% of operations to CliSubprocessBridge (CLI + JSON).

class ezsnmp_data_logger.gui.server.StudioHttpServer(server_address: tuple[str, int], bridge: CliSubprocessBridge, locale_mgr: LocaleManager | None = None)[source]

ThreadingHTTPServer carrying a shared CliSubprocessBridge instance.

allow_reuse_address = True
class ezsnmp_data_logger.gui.server.StudioRequestHandler(request, client_address, server)[source]

REST JSON + static asset handler backed strictly by CliSubprocessBridge.

do_GET() → None[source]
do_POST() → None[source]
log_message(format: str, *args: Any) → None[source]

Log an arbitrary message.

This is used by all other logging functions. Override it if you have specific logging wishes.

The first argument, FORMAT, is a format string for the message to be logged. If the format string contains any % escapes requiring parameters, they should be specified as subsequent arguments (it’s just like printf!).

The client ip and current date/time are prefixed to every message.

Unicode control characters are replaced with escaped hex before writing the output to stderr.

server: StudioHttpServer
ezsnmp_data_logger.gui.server.create_web_server(bridge: CliSubprocessBridge, host: str = '127.0.0.1', port: int = 8765, locale_mgr: LocaleManager | None = None) → StudioHttpServer[source]

Create a bound StudioHttpServer instance (supports port=0 ephemeral bind).

ezsnmp_data_logger.gui.server.launch_web_gui(bridge: CliSubprocessBridge, host: str = '127.0.0.1', port: int = 8765, open_browser: bool = True, locale_mgr: LocaleManager | None = None) → int[source]

Start the cross-platform Browser Studio and block until Ctrl+C.

GUI Cross-Platform Native Desktop Studio (ezsnmp_data_logger.gui.desktop_tk)

Cross-platform Native Desktop GUI (tkinter.ttk) for Linux, macOS, and Windows.

Drives ezsnmp-data-logger strictly through CliSubprocessBridge (CLI + JSON) with zero duplicated engine or SNMP logic.

class ezsnmp_data_logger.gui.desktop_tk.DesktopLoggerStudio(bridge: CliSubprocessBridge, schedule_refresh: bool = True, locale_mgr: LocaleManager | None = None)[source]

Cross-platform tkinter.ttk GUI interacting exclusively with the CLI + JSON.

action_add_dut() → None[source]
action_add_metric() → None[source]
action_apply_dut() → None[source]
action_apply_settings_tab() → None[source]
action_clear_all_series() → None[source]

Deselect all series from plotting.

action_execute_ezsnmp_request() → None[source]
action_inspect_sinks() → None[source]
action_load_template() → None[source]
action_open_config() → None[source]
action_probe_all() → None[source]
action_probe_selected_dut() → None[source]
action_remove_dut() → None[source]
action_remove_metric() → None[source]
action_run_once() → None[source]
action_save_all() → None[source]
action_save_editor_json() → None[source]
action_select_all_series() → None[source]

Select all available series for plotting.

action_show_schema() → None[source]
action_start_run() → None[source]
action_stop_run() → None[source]
action_validate_editor() → None[source]
action_validate_saved() → None[source]
on_close() → None[source]
refresh_live_state(reschedule: bool = True) → None[source]
reload_from_disk() → None[source]
ezsnmp_data_logger.gui.desktop_tk.launch_desktop_gui(bridge: CliSubprocessBridge, locale_mgr: LocaleManager | None = None) → int[source]

Launch the cross-platform tkinter.ttk Desktop Studio mainloop.