Python client for ingesting signals, DTCs, network stats, and GPS data to a GraphQL backend
Project description
Harry what_is_harry 🥹 It’s fine, come to me.
Harry — 30/06/2025, 7:46 PM If the case is to remain in one instance and no fancy caching.. then doable hai kaam Image Haseeb Saif — 30/06/2025, 7:46 PM Thk hai. Harry — 30/06/2025, 7:48 PM Semphores parha hai.. not sure use kar sakty with the calling.. cause hum directly call kartay abhi.. baaki agar hum isko as HTTP request bhejhay hai then semephores use kar sktay..
basically aik way hai tou block or manage multi-request and doesn't make a queue.. Haseeb Saif — 30/06/2025, 9:15 PM Yeh better nahi? Harry — 30/06/2025, 9:22 PM Better hai yeh b… but queue maintain nahi hoti ismay Haseeb Saif — 30/06/2025, 9:24 PM Batching kesay karain gay? Batch queue say bano andar data baijaty howay yeh use kar lo? Harry — 30/06/2025, 9:25 PM Batch k wapis annay ka wait kar sktay Queue na banaye agar Haseeb Saif — 30/06/2025, 9:26 PM Yes wohi kar letay. But check k kya better hai. Ask papa. Both cases Harry — 30/06/2025, 10:16 PM http://lustra.intrepidcs.corp/ics/wivi/issues/-/issues/1843 http://lustra.intrepidcs.corp/ics/wivi/issues/-/issues/1844 http://lustra.intrepidcs.corp/ics/wivi/issues/-/issues/1845 http://lustra.intrepidcs.corp/ics/wivi/issues/-/issues/1846 http://lustra.intrepidcs.corp/ics/wivi/issues/-/issues/1847 Harry — 02/07/2025, 8:10 PM Update for now :
Revamp initialization of the library Created Schema validator for it. Seperate classes for creating configuration
Currently working on test cases of init
Will complete test cases and library intialization testing with validation today!
========================================== 1 hour break for gym
Haseeb Saif — 03/07/2025, 5:10 PM Yo Local pay graph chal raha teray pass? Harry — 03/07/2025, 5:10 PM Yes Haseeb Saif — 03/07/2025, 5:10 PM Latest? Harry — 03/07/2025, 5:10 PM Parso pull liya master ka So yes latest Haseeb Saif — 03/07/2025, 5:11 PM Networkstat k table main hai kuch locally? Harry — 03/07/2025, 5:11 PM Network stat ma nahi add kiya kuch.. Haseeb Saif — 03/07/2025, 5:11 PM And device Version walay table main? Harry — 03/07/2025, 5:11 PM Signal or message or config ma hai Haseeb Saif — 03/07/2025, 5:11 PM query { deviceVersion(input: { configuration: { vehicleId: 87, }, limit:1, order: DESC }) { name lastUpdateTime:time value vehicleId } } Yeh qry chala k deakhni hai Harry — 03/07/2025, 5:11 PM Mere pass device version wgaira nahi chaltay Harry — 03/07/2025, 5:12 PM Ma locally data daal k dekh leta hun.. Haseeb Saif — 03/07/2025, 5:12 PM Han data daaal k deakh zara Harry — 03/07/2025, 5:13 PM Okay Haseeb Saif — 03/07/2025, 5:13 PM 2,2 entries kar lain means veh 87 ki 2,2 Harry — 03/07/2025, 5:13 PM Okay Harry — 03/07/2025, 5:24 PM simple deviceVersion ki query nahi chalai but with vehicle chalai hai Image simple dekhta abh Haseeb Saif — 03/07/2025, 5:25 PM Main awais sath edakh raha Tu lib pay kar Harry — 03/07/2025, 5:26 PM Image Okay Haseeb Saif — 03/07/2025, 5:28 PM join awais cube' ??? Haseeb Saif — 10/07/2025, 4:10 PM @Harry PRs main proper likh dena jesay Umer ny tasks main detail likhi hain k kya kar rahay Haseeb Saif — 10/07/2025, 4:27 PM ??? Harry — 10/07/2025, 5:02 PM join cube Haseeb Saif — Yesterday at 4:36 PM Can we use this as our Read.Me file?
Analytics Ingest Client
A lightweight Python library to batch and push automotive telemetry data—such as signals, Diagnostic Trouble Codes (DTCs), GPS data, and network statistics—to a GraphQL backend.
Expand Readme.txt 4 KB Check the examples before using it. Addsignal and addGPs etc examples. Harry — Yesterday at 4:47 PM Examples needs to be set for dtcs and signals as message info is not there
other than that it's looking far better then existing one Haseeb Saif — Yesterday at 4:51 PM Amend and add. Harry — Yesterday at 4:52 PM Okay Haseeb Saif haseebsaifullah
Analytics Ingest Client
A lightweight Python library to batch and push automotive telemetry data—such as signals, Diagnostic Trouble Codes (DTCs), GPS data, and network statistics—to a GraphQL backend.
🔧 Features
- Supports Python 3.11+
- Clean, single-class interface:
IcsAnalytics - In-memory caching for resolved IDs (message id or configuration)
- Batching support (by interval, count, or signal limit)
- Async-safe request queuing (only 1 request at a time)
- Minimal dependency footprint
- Easy to test and integrate
- Supports signals, DTCs, GPS, and network stats ingestion
📦 Installation
pip install analytics-ingest
🚀 Usage
Basic Example
from analytics_ingest import IcsAnalytics
client = IcsAnalytics(
device_id=123,
vehicle_id=456,
fleet_id=789,
org_id=1011,
graphql_endpoint="https://your-backend/graphql",
batch_size=100,
batch_interval_seconds=10,
max_signal_count=100
)
# Add signals (list of dicts)
client.add_signal([
{"name": "rpm", "unit": "rpm", "data": [{"value": 3000, "timestamp": "2024-01-01T00:00:00Z"}]},
# ... more signals ...
])
# Add DTCs (list of dicts)
client.add_dtc([
{"dtcId": "P0300", "status": "active", "description": "Random/Multiple Cylinder Misfire Detected", "data": []},
# ... more DTCs ...
])
# Add GPS data (dict)
client.add_gps({
"latitude": 37.7749,
"longitude": -122.4194,
"timestamp": "2024-01-01T00:00:00Z"
})
# Add network stats (dict)
client.add_network_stats({
"name": "CAN1",
"vehicleId": 456,
"uploadId": 1,
"totalMessages": 1000,
"matchedMessages": 950,
"unmatchedMessages": 50,
"errorMessages": 0,
"longMessageParts": 0,
"rate": 500.0
})
# Graceful shutdown (flushes any remaining data)
client.close()
⚙️ Configuration
You can configure the client via constructor arguments or environment variables (e.g., GRAPH_ENDPOINT).
device_id,vehicle_id,fleet_id,org_id: Required identifiersgraphql_endpoint: URL to your GraphQL backendbatch_size: Number of items per batch (default: 100)batch_interval_seconds: Max seconds between batch sends (default: 10)max_signal_count: Max signals per batch (default: 100)
🛠️ Error Handling & Logging
- Uses exceptions for invalid input or backend errors
- Replaceable
printstatements with logging recommended for production - Retries failed batch sends on next interval
🧪 Testing
Run all test cases:
PYTHONPATH=src python3 -m unittest discover -s tests -v
Build and upload package:
python3 -m build
python -m twine upload dist/*
💡 Improvements & Roadmap
- Add more usage examples and API documentation
- Integrate a logging framework
- Increase test coverage and add integration tests
- Allow dynamic runtime configuration
- Expose a fully async API
- Add metrics and monitoring hooks
- Enforce linting and type checking in CI
🤝 Contributing
Pull requests and issues are welcome! Please add tests for new features and follow PEP8 style guidelines.
📄 License
MIT License Readme.txt 4 KB
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file analytics_ingest-0.1.38.tar.gz.
File metadata
- Download URL: analytics_ingest-0.1.38.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c815d85fb38fddae114e522d4479cb3b28a9d982fb0440c92ff7e9b8cd01881f
|
|
| MD5 |
e4668e83ef2ed23c2918ecaa72247c5b
|
|
| BLAKE2b-256 |
7bb07fb05d86ff85d432a41f30b928724eaba4436e0fb6bbcafd23c71dd4721a
|
File details
Details for the file analytics_ingest-0.1.38-py3-none-any.whl.
File metadata
- Download URL: analytics_ingest-0.1.38-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa5ebe6ef568c3741903846b369b02fa4f32f592e563d5dc3b36cd3d6d1e270e
|
|
| MD5 |
2de4fe860049209f286740d0c9b07747
|
|
| BLAKE2b-256 |
477c477921c75e3e2cf3f57c436d77fe9003da5983f0366ddbdc0d49b9cfd650
|