Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1f3c33d
in work
nathan-sift Nov 5, 2025
c1023e7
in work 2
nathan-sift Nov 5, 2025
579f765
completed layout
nathan-sift Nov 6, 2025
fc6fae2
docs and linting
nathan-sift Nov 6, 2025
25a9521
clean up
nathan-sift Nov 6, 2025
5410631
in work tracing
nathan-sift Nov 6, 2025
bc47eae
fixes and rip out old ingestion method
nathan-sift Nov 6, 2025
94ce997
working ingestion
nathan-sift Nov 6, 2025
5086aac
add recovery config
nathan-sift Nov 6, 2025
5dacf68
channel value
nathan-sift Nov 6, 2025
ae8610d
various fixes
nathan-sift Nov 7, 2025
a44b81e
Keep bindings as optional dep
nathan-sift Nov 7, 2025
f0b2582
add qol functions and cleanup
nathan-sift Nov 7, 2025
6ba20da
ruff fmt
nathan-sift Nov 7, 2025
beba8c3
add tests and cleanup
nathan-sift Nov 8, 2025
0cb7e4a
update pyproject
nathan-sift Nov 8, 2025
eb74a04
type fix
nathan-sift Nov 8, 2025
329872d
change remaining "to_rust..." functions to private
nathan-sift Nov 10, 2025
b96580f
Add comments and clean up imports
nathan-sift Nov 10, 2025
05052a7
reorder add_new_flows logic
nathan-sift Nov 10, 2025
0aedc25
Make IngestionConfigStreamingClient private
nathan-sift Nov 10, 2025
8d2f1ae
hash client key by default
nathan-sift Nov 10, 2025
ba46637
PR feedback
nathan-sift Nov 10, 2025
23b2f2f
Move log file constants to class
nathan-sift Nov 10, 2025
716f179
fix circular dependancy issue
nathan-sift Nov 10, 2025
dcf89f8
ruff
nathan-sift Nov 11, 2025
4d9e5e4
Update defaults
nathan-sift Nov 11, 2025
ee6aa77
ruff and mypy cleanup
nathan-sift Nov 11, 2025
8020d4a
mypy fix
nathan-sift Nov 11, 2025
3bba01c
mypy fix
nathan-sift Nov 11, 2025
07db503
more mypy fixes
nathan-sift Nov 11, 2025
297b920
mypy fix
nathan-sift Nov 11, 2025
e4d7725
mypy
nathan-sift Nov 11, 2025
e64d031
mypy
nathan-sift Nov 11, 2025
30df5bf
ruff
nathan-sift Nov 11, 2025
414a7af
update tests
nathan-sift Nov 11, 2025
84ebe37
pyright fixes
nathan-sift Nov 11, 2025
3ff24df
test fix
nathan-sift Nov 11, 2025
946fd7b
ci fix
nathan-sift Nov 11, 2025
5dec022
add basic example
nathan-sift Nov 11, 2025
4a17a48
ruff
nathan-sift Nov 11, 2025
2b31629
pyright issues again
nathan-sift Nov 11, 2025
424c2ca
remove tests requiring ingest
nathan-sift Nov 11, 2025
968341a
fix test imports
nathan-sift Nov 11, 2025
dec499b
ruff
nathan-sift Nov 11, 2025
a517fe1
remove pyright fixes again
nathan-sift Nov 11, 2025
fb66ab5
pr feedback
nathan-sift Nov 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/python_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
working-directory: python
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Python
uses: actions/setup-python@v2
Expand Down
102 changes: 102 additions & 0 deletions python/docs/examples/ingestion.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "0b202351",
"metadata": {},
"source": [
"# Sift Client Ingestion Basic Example\n",
"\n",
"This notebook demonstrates some examples features of SiftClient ingestion\n",
"- Initializing the Sift client\n",
"- Creating an ingestion config\n",
"- Creating a run\n",
"- Creating and sending flows\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "02268d76",
"metadata": {
"vscode": {
"languageId": "plaintext"
}
},
"outputs": [],
"source": [
"import asyncio\n",
"import random\n",
"import time\n",
"from datetime import datetime, timezone\n",
"\n",
"from sift_client import SiftClient, SiftConnectionConfig\n",
"from sift_client.sift_types import (\n",
" ChannelConfig,\n",
" ChannelDataType,\n",
" FlowConfig,\n",
" IngestionConfigCreate,\n",
" RunCreate,\n",
")\n",
"\n",
"\n",
"async def main():\n",
" connection_config = SiftConnectionConfig(\n",
" api_key=\"my_api_key\",\n",
" grpc_url=\"sift_grpc_url\",\n",
" rest_url=\"sift_rest_url\",\n",
" )\n",
"\n",
" client = SiftClient(connection_config=connection_config)\n",
"\n",
" # Ingestion configs are created using SiftClient types\n",
" ingestion_config = IngestionConfigCreate(\n",
" asset_name=\"sift_rover_1\",\n",
" flows=[\n",
" FlowConfig(\n",
" name=\"onboard_sensors\",\n",
" channels=[\n",
" ChannelConfig(name=\"motor_temp\", unit=\"C\", data_type=ChannelDataType.DOUBLE),\n",
" ChannelConfig(\n",
" name=\"tank_pressure\", unit=\"kPa\", data_type=ChannelDataType.DOUBLE\n",
" ),\n",
" ],\n",
" )\n",
" ],\n",
" )\n",
"\n",
" run = RunCreate(name=\"sift_rover-\" + str(int(time.time())))\n",
"\n",
" async with await client.async_.ingestion.create_ingestion_config_streaming_client(\n",
" ingestion_config=ingestion_config,\n",
" run=run,\n",
" ) as ingest_client:\n",
" while True:\n",
" # Flows can be generated easily from the ingest client\n",
" flow_config = ingest_client.get_flow_config(flow_name=\"onboard_sensors\")\n",
" flow = flow_config.as_flow(\n",
" timestamp=datetime.now(timezone.utc),\n",
" values={\n",
" \"motor_temp\": 50.0 + random.random() * 5.0,\n",
" \"tank_pressure\": 2000.0 + random.random() * 100.0,\n",
" },\n",
" )\n",
" # Ingest the flow with .send()\n",
" await ingest_client.send(flow=flow)\n",
"\n",
" await asyncio.sleep(1)\n",
"\n",
"\n",
"if __name__ == \"__main__\":\n",
" asyncio.run(main())\n"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading
Loading