Self-Contained SWIG Multi-Language Distribution¶
EzSnmp Data Logger distributes its C++17 backend (powered by ezsnmp’s SessionBase and Result layers on the v2026.11.4a0 CalSemVer alpha line) as self-contained packages across 4 SWIG 4.x target languages so end users never need to install external system libraries (Net-SNMP, OpenSSL, SQLite3, or SWIG).
Supported SWIG Target Languages¶
Language |
SWIG Invocation |
Self-Contained Packaging Mechanism |
|---|---|---|
Python |
|
|
JavaScript (Node.js N-API) |
|
|
C# (.NET 8+) |
|
|
Go (cgo) |
|
|
How Self-Containment Works¶
Embedded SQLite3 Amalgamation (``tools/prepare_sqlite3_amalgamation.py``): Downloads and SHA-256-verifies the official public-domain SQLite3 C amalgamation (3.49.1) into
third_party/sqlite3/and compilessqlite3.cstatically into every binary (EZSNMP_DL_EMBEDDED_SQLITE3=1), eliminatinglibsqlite3shared-library dependencies on Linux, macOS, and Windows.Standalone Net-SNMP 5.10 + OpenSSL + EzSnmp ``v2026.11.4a0``:
tools/prepare_ezsnmp_source.pystagesezsnmpat CalSemVer alpha tagv2026.11.4a0, whiletools/prepare_{linux,macos,windows}_netsnmp.*builds minimal SHA-256-verified Net-SNMP5.10.pre2libraries.Dynamic Loader Relocation (``tools/bundle_native_package.py``): Copies all non-OS runtime shared libraries into each package’s runtime folder, rewrites RPATH/install-name entries (
$ORIGINviapatchelfon Linux,@loader_pathviainstall_name_tool+codesignon macOS, side-by-side DLLs on Windows), and verifies that zero external non-OS dependencies remain.
Generating Wrappers¶
python3 tools/generate_swig_bindings.py --languages all --out-dir build/swig_generated
Cross-Language Idiomatic Usage¶
Python (CalSemVer Alpha)¶
pip install --pre "ezsnmp-data-logger>=2026.11.5.2"
import ezsnmp_data_logger as edl
dl = edl.DataLogger.from_file("configs/example.json")
batches = dl.run_once()
for batch in batches:
print(batch.dut_name, len(batch.samples), batch.to_json())
JavaScript / Node.js (N-API)¶
const edl = require('ezsnmp-data-logger');
const dl = edl.DataLogger.from_file('configs/example.json');
const batches = dl.run_once();
console.log(dl.stats_json(2));
C# (.NET 8+)¶
using System;
using EzSnmpDataLogger;
using var dl = DataLogger.from_file("configs/example.json");
var batches = dl.run_once();
Console.WriteLine(dl.stats_json(2));
Go (cgo)¶
package main
import (
"fmt"
edl "github.com/carlkidcrypto/ezsnmp_data_logger/bindings/go"
)
func main() {
dl := edl.DataLoggerFrom_file("configs/example.json")
defer edl.DeleteDataLogger(dl)
dl.Run_once()
fmt.Println(dl.Stats_json(2))
}