Skip to content

Data Models

Data Models

Data models are used to store and transfer structured business data inside the application.

Signal uses Pydantic models for this purpose. The most important examples are Config, Transaction, and Specification

For example, a transaction inside Signal is not just a raw network packet or a text dump. It is represented as a Transaction Pydantic model that provides validated access to fields, subfields, metadata, matching parameters, and transaction state.

The same applies to configuration settings and specification definitions — they are stored as strongly typed models rather than plain dictionaries or raw JSON.

This approach improves validation, readability, and debugging, and makes development safer.

Using Data Models

All business data inside Signal is represented as Pydantic models.

To use a data model, import the required class, create an object, and work with its validated fields and methods.

Models can be created manually, loaded from JSON files, parsed from incoming dumps, or generated by internal program modules.

The example below shows how to load the main configuration object from the default configuration file.

from common.lib.data_models.Config import Config
from common.lib.enums.TermFilesPath import TermFilesPath

config = Config(TermFilesPath.CONFIG)  # Parse file path TermFilesPath.CONFIG

print(config.host.host)
print(config.host.port)

Data Models Reference

A complete reference to the available data models is provided on the dedicated Data Models page.

All parts of Signal — GUI, API, CLI, internal modules, and external library integrations — use the same centralized and unified data models.

This guarantees consistent transaction processing, predictable behavior, and compatibility between all interfaces of the system.

The library itself does not introduce separate private structures for the same business entities. Transactions, configuration objects, specifications, connection settings, and other important data are always represented by the same shared models.