You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support HTTPS Influx client; add wide-schema docs, v0.2.1
Introduce an HTTP-based Influx client and wide-format (columnar) workflow across the library and docs. Changes include:
- Implement HttpInfluxClient plus _ArrowLike/_Scalar adapters in src/slicks/fetcher.py and auto-select it in get_influx_client() for https:// hosts; preserve InfluxDBClient3 for non-HTTPS. This enables querying via /api/v3/query_sql when gRPC/Flight is not available.
- Update discover_sensors to use get_influx_client() and relax client typing/creation, and simplify narrow/wide paths.
- Expand fetcher typing and client selection logic; add minimal adapters so HTTP responses can be consumed like Arrow results.
- API/docs updates: emphasize wide vs narrow schemas, add schema and resample params to fetch_telemetry, document fetch_telemetry_chunked, WideWriter, CAN decoding and line-protocol writing, and update examples to use schema="wide".
- Bump package version to 0.2.1 and add httpx dependency to pyproject.toml.
- Misc: update README examples (default DB and wide schema example) and add CLAUDE.md to .gitignore.
These changes make the library more robust over HTTPS tunnels and standardize wide-format telemetry usage and writing.
You often need to switch between `Development`, `Testing`, and `Production` databases, or switch to a local replay server.
23
41
24
42
### Option A: Environment Variables (Best for CI/CD)
@@ -38,7 +56,7 @@ slicks.connect_influxdb3(
38
56
)
39
57
```
40
58
41
-
## 3. Bulk Export for CSV Analysis
59
+
## 4. Bulk Export for CSV Analysis
42
60
If you need to hand off data to the aerodynamics team who uses Excel/MATLAB, use the bulk fetcher. It handles day-by-day chunking to avoid crashing the computer.
43
61
44
62
```python
@@ -48,14 +66,41 @@ from slicks import bulk_fetch_season
If you're ingesting raw CAN bus data (e.g., from a replay script or live logger), use `WideWriter`. It decodes CAN frames using a DBC file and writes them as wide format line protocol.
-**start_time***(datetime)*: Start of the query range.
30
31
-**end_time***(datetime)*: End of the query range.
31
-
-**signals***(str or list[str])*: A single sensor name or a list of sensor names to fetch. Defaults to standard configuration if None.
32
+
-**signals***(str or list[str])*: A single sensor name or a list of sensor names to fetch. Defaults to standard configuration if `None`.
32
33
-**client***(InfluxDBClient3, optional)*: An existing client instance (advanced use).
33
-
-**filter_movement***(bool)*: If `True` (default), strips out rows where the car is stationary. If `False`, returns all raw data.
34
+
-**filter_movement***(bool)*: If `True` (default), strips out rows where the car is stationary.
35
+
-**resample***(str or None)*: Pandas frequency string for resampling (e.g. `"1s"`, `"100ms"`). Pass `None` for raw data.
36
+
-**schema***(str)*: `"wide"` (default, columnar — each signal is a column) or `"narrow"` (legacy EAV — requires pivot).
34
37
35
-
**Returns:**`pandas.DataFrame` indexed by time, with 1-second resolution. Returns `None` if no data is found.
38
+
**Returns:**`pandas.DataFrame` indexed by time. Returns `None` if no data is found.
39
+
40
+
---
41
+
42
+
### `slicks.fetch_telemetry_chunked`
43
+
44
+
Same interface as `fetch_telemetry`, but splits large date ranges into chunks and runs them in parallel. Handles server resource limits automatically via adaptive query bisection.
-**chunk_size_days***(int)*: How many days to query at once (prevents timeouts).
68
+
-**start_time***(datetime)*: Start of scan (used only in `"narrow"` schema).
69
+
-**end_time***(datetime)*: End of scan (used only in `"narrow"` schema).
70
+
-**chunk_size_days***(int)*: Days per chunk for narrow schema scans (default: 7).
71
+
-**schema***(str)*: `"wide"` performs an instant metadata lookup (`information_schema.columns`) — no time range required. `"narrow"` scans actual data rows.
50
72
51
73
**Returns:**`list[str]` of unique sensor names sorted alphabetically.
Copy file name to clipboardExpand all lines: docs/example_analysis.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,14 +29,14 @@ Connecting to Slicks Telemetry Database...
29
29
30
30
## 2. Discovering Sensors
31
31
32
-
Before fetching data, we need to know exactly what sensors were recording during our test session. We'll scan a specific window to see the available signals.
32
+
Before fetching data, we can check what sensors are available. With wide format, this is an instant metadata lookup — no time range needed.
33
33
34
34
```python
35
35
start_time = datetime(2025, 9, 28, 20, 20, 0)
36
36
end_time = datetime(2025, 9, 28, 21, 0, 0)
37
37
38
-
print(f"Scanning for sensors between {start_time} and {end_time}...")
0 commit comments