Quickstart
Install
Section titled “Install”pip install "hypermesh[engine]"Open a database
Section titled “Open a database”hm.connect() chooses the backend from the target: a filesystem path opens the
embedded engine; an http(s):// URL returns a remote client.
import hypermesh as hm
# Embedded engine (build the index from a CSV on first open)db = hm.connect("/var/lib/hypermesh/data", hyperedges_csv="hyperedges.csv")
# Or remote# db = hm.connect("https://hypermesh.internal:8000", api_key="...")res = db.execute( "MATCH HYPEREDGE (he:CoProximity) " "WHERE he.event_ts >= $start AND he.event_ts <= $end " "RETURN *", parameters={"start": 0, "end": 300},)print(res.num_tuples, "hyperedges")for row in res: print(row["event_ts"], row.members, row.weight)print(res.query_plan) # TPI pushdown statsdb.insert(event_ts=9999, members=[1, 2, 3], weight=0.95, formation="WEDGE")db.delete(event_ts=9999, members=[1, 2, 3])db.compact()db.close()Errors
Section titled “Errors”All SDK errors derive from hm.exceptions.HyperMeshError:
try: db.execute("MATCH ...")except hm.exceptions.QueryError: ...except hm.exceptions.HyperMeshError: ...Logging
Section titled “Logging”The library is silent by default (NullHandler). Turn on debug logging:
hm.enable_debug_logging()