This repository contains samples for EXD vData SDK for Python package. EXD vData is an edge database running on vehicles' domain controllers. It stores signal data in a high-compression file format with the extension of .vsw. EXD vData SDK offers vsw decoding capabilities in standard programming languages such as C++, Java, Python, Javascript, and etc.
Chinese README is available here.
The following sections demonstrates how to install and use the SDK.
- System Requirement
- Additional Dependencies
- License
- Installation
- API Documentation
- Sample Usage
- Complete Examples
- Sample Data Files
- Getting Help
- Contributing to EXD
- python3
- pip3
The following dependencies will be installed by the SDK if not already exists.
- python-snappy
- zstd
The codes in the repository are released with MIT License.
Binary installers for the latest released version are available at the Python Package Index (PyPI) and may be installed using pip command.
pip3 install exceeddata-sdk-vdata
Collecting exceeddata-sdk-vdata
Using cached exceeddata_sdk_vdata-2.8.2.2-py2.py3-none-any.whl (30 kB)
Requirement already satisfied: zstd in /opt/homebrew/lib/python3.10/site-packages (from exceeddata-sdk-vdata) (1.5.5.1)
Requirement already satisfied: python-snappy in /opt/homebrew/lib/python3.10/site-packages (from exceeddata-sdk-vdata) (0.7.1)
Requirement already satisfied: cramjam in /opt/homebrew/lib/python3.10/site-packages (from python-snappy->exceeddata-sdk-vdata) (2.8.3)
Installing collected packages: exceeddata-sdk-vdata
Successfully installed exceeddata-sdk-vdata-2.8.2.2
Post Installation
pip3 list |grep exceeddata
exceeddata-sdk-vdata 2.8.2.2
Publicly available SDK classes and methods are at API Documentation.
Import To use the SDK import "exceeddata.sdk.vdata" package and the following classes:
- VDataReaderFactory: in most cases VDataReaderFactory is all you ever need
- VDataByteReader: use VDataByteReader if you have a vsw byte arrays and need to wrap in a data reader to VDataReaderFactory
- VDataMeta: the metadata information of the vsw file
- VDataFrame: the data frame of the vsw data contents
SDK is very easy to use, in most cases 7 lines of code is sufficient.
from exceeddata.sdk.vdata import VDataReaderFactory
import pandas as _pd
signals = "" # provide a comma-separated list to select signals as needed, empty list means all signals are selected.
file = open(inputPath, "rb")
factory = VDataReaderFactory()
factory.setDataReaders(file)
factory.setSignals(signals)
reader = factory.open()
frame = reader.df()
df = _pd.DataFrame(frame.objects(), columns=frame.cols(True)) # objects() return a n x m array of rows and columns, here we load into a pandas Data Frame
...
file.close()
- vswdecode.py: a full parameterized app that decodes vsw to pandas dataframe and then exports to CSV format.
- Supports input and output file path parameters.
- Supports optional signals selection parameter.
- Supports optional base64 encoded vsw files.
- Supports densify, expand mode and queue mode parameters.
- vsw2asc.py: a demo app that converts VSW to Vector ASC format to be used in CanOE and other industry tools.
- ASCII Logging Files (.ASC) is an industry-stand Message-based format for reading and writing signal data. See vsw2asc.py for a quick example on conversion.
- vsw2blf.py: a demo app that converts VSW to Vector BLF format to be used in CanOE and other industry tools.
- Binary Logging File (.BLF) is an industry-stand Message-based format for reading and writing signal data.
- data_diff_freqency.vsw: sample vsw data file with 10Hz, 20Hz, 100Hz signals. This file can be used in vswdecode.py and other examples.
- signal_2x2.vsw: Sample CAN Data file, 2 channel included with each channel has 2 message. This file can be used with vsw2asc.py and vsw2blf.py.
For usage questions, the best place to go to is Github issues. For customers of EXCEEDDATA commercial solutions, you can contact support for questions or support.
All contributions, bug reports, bug fixes, documentation improvements, code enhancements, and new ideas are welcome.