Skip to main content

Vehk Axle Python SDK

Official Python SDK for the Vehk Axle Fleet Management, GPS Tracking & Predictive Maintenance Platform.

PyPI version Python Version License: MIT

Installation

pip install vehk-axle

What's New in v2.0.0

  • GPS Tracking API - Send and retrieve real-time device location data
  • Device Management API - List devices and get fleet-wide locations
  • Scoped Permissions - Granular API key scopes (telemetry:write, tracking:read, etc.)
  • Enforced Rate Limits - Per-key sliding window rate limiting (default 60 req/min)
  • New Models - TrackingData and DeviceLocation dataclasses

Quick Start

from vehk_axle import VehkClient

client = VehkClient(api_key="vehk_your_api_key_here")

# Send telemetry data
response = client.telemetry.send(
    vehicle_id="VH-001",
    sensor_data={
        "speed": 65,
        "rpm": 2500,
        "coolant_temp": 92,
        "fuel_level": 45,
        "battery_voltage": 12.6
    }
)
print(f"Telemetry sent: {response['telemetry_id']}")

# Send GPS tracking data from a device
client.tracking.send(
    device_id="dev-abc123",
    latitude=12.9716,
    longitude=77.5946,
    speed=45.2,
    ignition=True
)

# Get ML prediction
prediction = client.predict(
    vehicle_id="VH-001",
    sensor_data={"speed": 65, "rpm": 2500, "coolant_temp": 92}
)
print(f"Health Score: {prediction.health_score}%")
print(f"Status: {prediction.health_status.value}")
print(f"Critical: {prediction.is_critical}")

Features

Telemetry Ingestion

Send real-time sensor data from your vehicles:

# Single telemetry point
client.telemetry.send(
    vehicle_id="VH-001",
    sensor_data={"speed": 65, "rpm": 2500},
    timestamp="2026-03-26T10:00:00Z",
    location={"lat": 12.97, "lng": 77.59}
)

# Batch telemetry (up to 100 at a time)
batch_result = client.telemetry.send_batch([
    {"vehicle_id": "VH-001", "sensor_data": {"speed": 65}},
    {"vehicle_id": "VH-002", "sensor_data": {"speed": 70}},
    {"vehicle_id": "VH-003", "sensor_data": {"speed": 55}},
])
print(f"Processed: {batch_result.records_processed}")

GPS Tracking (v2.0)

Send and retrieve GPS tracking data from configured devices:

# Send a single tracking data point
client.tracking.send(
    device_id="dev-abc123",
    latitude=12.9716,
    longitude=77.5946,
    speed=45.2,
    heading=180,
    ignition=True,
    event="periodic"
)

# Batch tracking (up to 100 at a time)
client.tracking.send_batch([
    {"device_id": "dev-1", "latitude": 12.97, "longitude": 77.59, "speed": 45},
    {"device_id": "dev-2", "latitude": 13.01, "longitude": 77.61, "speed": 30},
])

# Get all device locations (real-time fleet map)
locations = client.tracking.locations()
for loc in locations:
    print(f"{loc['device_id']}: {loc['latitude']}, {loc['longitude']}")

# Get a single device location
loc = client.tracking.location("dev-abc123")
print(f"Speed: {loc['speed']} km/h, Ignition: {loc['ignition']}")

Device Management (v2.0)

List and query devices registered to your tenant:

# List all devices
devices = client.devices.list()
for d in devices:
    print(f"{d['device_id']}: {d.get('status', 'unknown')}")

# Filter by status
active = client.devices.list(status="active")

Predictions

Get AI-powered predictions for vehicle health:

prediction = client.predictions.get(
    vehicle_id="VH-001",
    sensor_data={"speed": 65, "rpm": 2500, "coolant_temp": 92}
)

print(f"Health Score: {prediction.health_score}")
print(f"Risk Level: {prediction.risk_level.value}")

if prediction.needs_maintenance:
    for alert in prediction.maintenance_alerts:
        print(f"  {alert.type}: {alert.description}")

for rec in prediction.recommendations:
    print(f"  {rec}")

# List recent predictions
recent = client.predictions.list(vehicle_id="VH-001", limit=10)
for p in recent:
    print(f"{p.vehicle_id}: {p.health_score}%")

Vehicle Management

vehicles = client.vehicles.list()
for vehicle in vehicles:
    print(f"{vehicle.vehicle_id}: Health {vehicle.health_score}%")

Error Handling

from vehk_axle import (
    VehkClient,
    VehkAuthenticationError,
    VehkRateLimitError,
    VehkConnectionError,
    VehkAPIError,
)

try:
    client = VehkClient(api_key="vehk_your_key")
    prediction = client.predict("VH-001", {"speed": 65})

except VehkAuthenticationError:
    print("Invalid API key. Check your credentials.")

except VehkRateLimitError as e:
    print(f"Rate limit hit. Retry after {e.retry_after} seconds.")

except VehkConnectionError:
    print("Could not connect to Vehk API. Check your network.")

except VehkAPIError as e:
    print(f"API error [{e.status_code}]: {e.message}")

API Scopes (v2.0)

API keys now enforce granular permission scopes:

Scope Description
telemetry:write Send telemetry data
telemetry:read Read telemetry history
tracking:write Send GPS tracking data
tracking:read Read device locations
devices:read List devices
predict Request ML predictions
vehicles:read List vehicles

Configuration

Custom Base URL

client = VehkClient(
    api_key="vehk_your_key",
    base_url="https://api-staging.vehk.in"
)

Timeout & Retries

client = VehkClient(
    api_key="vehk_your_key",
    timeout=60,
    retries=5,
    retry_delay=2.0
)

Context Manager

with VehkClient(api_key="vehk_your_key") as client:
    prediction = client.predict("VH-001", {"speed": 65})

Health Check

health = client.health_check()
print(f"Status: {health['status']}")
print(f"Version: {health['version']}")

Supported Sensor Fields

Field Description Unit
speed Vehicle speed km/h
rpm Engine RPM RPM
coolant_temp Coolant temperature °C
fuel_level Fuel level %
battery_voltage Battery voltage V
oil_pressure Oil pressure PSI
throttle Throttle position %
intake_air_temp Intake air temperature °C
ambient_temp Ambient temperature °C
odometer Odometer reading km

Requirements

  • Python 3.8+
  • requests library

Getting Your API Key

  1. Log in to Vehk Dashboard
  2. Go to Settings > API Keys
  3. Click "Generate New Key"
  4. Copy the key (shown only once)

Support

License

MIT License - see LICENSE for details.

Metadata

Release files for vehk-axle 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vehk-axle 2.1.1
File Size Uploaded Provenance Actions
vehk_axle-2.1.1.tar.gz 15.1 kB Without provenance Details for vehk_axle-2.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vehk-axle 2.1.1
File Interpreter ABI Platform Actions
vehk_axle-2.1.1-py3-none-any.whl Python 3 none any Details for vehk_axle-2.1.1-py3-none-any.whl

Total release size: 28.8 kB

Release files / vehk_axle-2.1.1.tar.gz

Download URL vehk_axle-2.1.1.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2ebe4175bb877194e4eeadbb9396fba0f39e9c29359a40ba18343d46987e684a
BLAKE2b-256 checksum
How to use checksums
a407c0d3ada2e028b86c06836936bb66675d004f0d9e79fe78ad23db4efe5376
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / vehk_axle-2.1.1-py3-none-any.whl

Download URL vehk_axle-2.1.1-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a90faad1b1320e670be6b901e532c1f0d4a678a59e676cceaf38c91d1ed9ae3
BLAKE2b-256 checksum
How to use checksums
651fa204d0e1ed17555cf7c3f733d3ef127b6b2b6458587d26f555170ba2c3a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for vehk-axle 2.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page