Metadata-Version: 2.5
Name: can-db-model
Version: 0.1.2
Summary: Shared Pydantic model + KCD/YAML loaders for CAN databases
License-Expression: LGPL-3.0-only
License-File: LICENSE.txt
Requires-Python: >=3.10
Requires-Dist: cantools
Requires-Dist: lxml
Requires-Dist: pydantic>=2
Requires-Dist: pyyaml
Description-Content-Type: text/markdown

# can-db-model

Shared Pydantic model + KCD/YAML loaders and serializers for CAN databases.
Consumed by can-api-generator and kcd-merger.

## Signal start and byte order

`Signal.start` of a little-endian signal is the bit number (byte*8 + bit, bit 0 = LSB of the byte) of
its least significant bit. For a big-endian (Motorola) signal it is the bit number of its most
significant bit, as cantools defines the start bit; the signal runs from there downwards and on to bit
7 of the next byte. YAML `start` means the same. In a KCD the big-endian `offset` is the Kayak one:
`start = 8*(offset//8) + 7 - offset%8` (the mapping is its own inverse), so a 32-bit serial sent MSB
first in bytes 4..7 is `offset="32" length="32" endianess="big"`, `start = 39`.
`occupied_bits()` gives the bits a signal occupies; length and overlap checks use it.
