tommytracx's picture
Upload 2 files
e8ecd68 verified
raw
history blame
657 Bytes
import typer
import json
from deepboreai_sdk.sdk import DeepBoreAI
app = typer.Typer()
client = DeepBoreAI()
@app.command()
def ingest(file: str):
with open(file, 'r') as f:
data = json.load(f)
result = client.post_telemetry(data)
typer.echo(result)
@app.command()
def export(out: str = 'drilling_data.csv'):
path = client.export_csv(out)
typer.echo(f"Exported to {path}")
@app.command()
def stream():
def callback(data):
typer.echo(f"Live Alert: {data}")
typer.echo("Listening to live data stream...")
client.watch_live(callback)
input("Press Enter to stop...
")
if __name__ == "__main__":
app()