magogi/prod/: mgf-tele-core-0.1.9 metadata and description

Simple index

Vendor-neutral telematics seam for mgf-common consumers — the TelematicsProvider device-session ABC, the codec-agnostic AVL frame types, the typed error hierarchy, and a scripted mock. Per-vendor codecs (mgf-tele-teltonika, …) build on this. Sibling of mgf-common under the mgf.* namespace.

author Bassam Alsanie, mgf-tele-core contributors
classifiers
  • Development Status :: 3 - Alpha
  • Intended Audience :: Developers
  • License :: OSI Approved :: Apache Software License
  • Programming Language :: Python :: 3
  • Programming Language :: Python :: 3.11
  • Programming Language :: Python :: 3.12
  • Programming Language :: Python :: 3.13
  • Topic :: Software Development :: Libraries
  • Typing :: Typed
description_content_type text/markdown
keywords avl, fleet, gps, iot, telematics, teltonika
license Apache-2.0
license_file
  • LICENSE
  • NOTICE
requires_dist
  • mgf-common<1.0,>=0.41
  • import-linter>=2.0; extra == 'dev'
  • mgf-test-supervisor<0.2,>=0.1.2; extra == 'dev'
  • mypy>=1.10; extra == 'dev'
  • pytest-asyncio>=0.23; extra == 'dev'
  • pytest-cov>=5.0; extra == 'dev'
  • pytest-timeout>=2.3; extra == 'dev'
  • pytest>=8.0; extra == 'dev'
  • ruff<0.16,>=0.4; extra == 'dev'
  • mgf-common[standards]<1.0,>=0.46; extra == 'standards'
requires_python >=3.11

Because this project isn't in the mirror_whitelist, no releases from root/pypi are included.

File Tox results History
mgf_tele_core-0.1.9-py3-none-any.whl
Size
14 KB
Type
Python Wheel
Python
3
mgf_tele_core-0.1.9.tar.gz
Size
113 KB
Type
Source

mgf-tele-core

The vendor-neutral telematics seam for mgf-common consumers: the TelematicsProvider device-session ABC, the codec-agnostic AVL frame types, a typed error hierarchy, and a scripted mock. A sibling of mgf-common under the mgf.* namespace, and the foundation of the mgf-tele-* family — per-vendor codec packages (mgf-tele-teltonika, later mgf-tele-queclink, …) depend on this and never the other way.

Extracted from PlasmaMapper's ingest path (ADR-010's two-layer seam): the provider owns the device session; a per-vendor codec is a pure bytes → DecodedAvlRecord dependency injected into it.

Install

pip install mgf-tele-core

What's in it

Name What
TelematicsProvider the device-session ABC: open_session / receive_packet / send_command / close_session
SessionHandle / TrackerCommand / CommandAck the seam's command/session vocabulary
GeoPoint / DecodedAvlRecord / ReceivedPacket / ParseStatus codec-agnostic AVL frame types (every vendor normalises to these)
TelematicsError (+ MalformedPacketError, ChecksumError, UnsupportedCodecError, MalformedHandshakeError, UnknownTrackerError, SessionClosedError) typed errors, all subclass mgf.common.exceptions.AppError
mgf.tele.core.mock.MockTelematicsProvider scripted in-memory provider for consumers' tests

The two-layer shape

mgf-tele-core        TelematicsProvider (ABC)  +  AVL frame types  +  errors
      ▲
      │ depends on
mgf-tele-teltonika   Codec 8/8E/12 parser  +  TeltonikaProvider(codec)
mgf-tele-queclink    (future) …

A consumer wires a concrete provider into its ingest loop:

async def session_loop(provider: TelematicsProvider, reader, writer):
    handle = await provider.open_session(reader, writer)
    try:
        while True:
            packet = await provider.receive_packet(handle)   # ReceivedPacket
            persist_raw(packet)                               # always (forensic)
            if packet.parse_status == "ok":
                ingest(packet.records)                        # DecodedAvlRecord[]
    except SessionClosedError:
        pass
    finally:
        await provider.close_session(handle)

Tests use MockTelematicsProvider(batches=[…]) — no socket, no vendor codec — to drive the consumer's ingest logic deterministically.

Design notes