Skip to main content

Python client for GIGI — Geometric Intrinsic Global Index

Project description

gigi-client

Python client for GIGI — the Geometric Intrinsic Global Index database engine.

Install

pip install gigi-client
# With pandas support:
pip install gigi-client[pandas]

Quick start

from gigi import GigiClient

db = GigiClient("http://localhost:3142")

# Create a bundle (table)
db.create_bundle("sensors", fields={
    "sensor_id": "categorical",
    "temp": "numeric",
    "humidity": "numeric",
}, keys=["sensor_id"])

# Insert records
db.insert("sensors", [
    {"sensor_id": "S-001", "temp": 22.5, "humidity": 60.1},
    {"sensor_id": "S-002", "temp": 19.3, "humidity": 71.4},
])

# Query
results = db.query("sensors", filters=[
    {"field": "temp", "op": "gt", "value": 20}
])
print(results)

# Get curvature (geometric health)
k = db.curvature("sensors")
print(f"K={k['K']:.4f}  confidence={k['confidence']:.4f}")

# As a pandas DataFrame
df = db.query_df("sensors")
print(df.head())

Real-time subscriptions

import asyncio
from gigi import GigiSubscriber

async def main():
    sub = GigiSubscriber("ws://localhost:3142/ws")
    await sub.connect()

    # Subscribe to all inserts on the 'sensors' bundle
    await sub.subscribe("sensors")

    # Subscribe with a filter: only temp > 30
    await sub.subscribe("alerts", where="temp > 30")

    async for event in sub.events():
        print(f"[{event.op}] {event.bundle}: {event.record}")

asyncio.run(main())

GIGI Math

GIGI models data as fiber bundles over a base manifold.
Each bundle's geometry is captured by scalar curvature $K$:

$$K = \frac{\text{Var}(F)}{R^2}$$

where $F$ is the fiber distribution and $R$ is the base range.

  • $K \approx 0$: flat geometry, arithmetic-dominated (maximum compressibility)
  • $K > 0$: positive curvature, bounded/categorical data
  • $K < 0$: negative curvature (hyperbolic), heavy-tailed distributions

The confidence in the curvature estimate:

$$\text{conf}(K) = 1 - e^{-n/100}$$

where $n$ is the record count.

API Reference

See davisgeometric.com/gigi/docs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gigi_client-0.8.0.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gigi_client-0.8.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file gigi_client-0.8.0.tar.gz.

File metadata

  • Download URL: gigi_client-0.8.0.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for gigi_client-0.8.0.tar.gz
Algorithm Hash digest
SHA256 2593a2870dbecd692454d8195913046eb9bf35ef8d19e36ab628b519e5ae8761
MD5 d3feda1b81030fafa7e495e9b68b0193
BLAKE2b-256 965aa995ca56160c80d1cd136c70a665d350e07dd3ee3d9d47508c02dd65071f

See more details on using hashes here.

File details

Details for the file gigi_client-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: gigi_client-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for gigi_client-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 347aa53fd2df3b3a9074531a861f0ec8357caba7f73f9eb7fc2bd7fbda08fbf4
MD5 f429062fc933129967568945255c1ce3
BLAKE2b-256 79daecb4c96ba827825220072d49d6b7a1c91c5ac2c17cf9470109ce4f713198

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page