
NOTICE: All information contained herein is, and remains the property of TechnoCore Automate.
The intellectual and technical concepts contained herein are proprietary to TechnoCore Automate
and dissemination of this information or reproduction of this material is strictly
forbidden unless prior written permission is obtained from TechnoCore Automate.
ObjectsObjects.py is the foundational base module for the entire Axion framework. It defines
the root Object class from which nearly every Axion component inherits, and provides
the global configuration singleton and shared utility methods used across all factories.
The Object class itself is composed from five delegate mixins located in
factory.core/extend.delegate/. Each mixin encapsulates a distinct responsibility,
keeping the base class focused on database connectivity, encryption, and type detection.
| Symbol | Type | Purpose |
|---|---|---|
DO_DEBUG |
bool |
Controls debug output — must be present in every module even if unused |
DO_MQTT |
bool |
Controls MQTT logging |
DO_REDIS |
bool |
Controls Redis caching |
DO_ENCRYPTION |
bool |
Controls database field encryption |
DO_SCHEMA_CHECKS |
bool |
Controls automatic schema validation (env: AXION_SCHEMA_CHECKS) |
PACKAGE_BUFFER |
dict |
Cached package configuration values |
Object
├── ObjDebug (debug, logging, tracing)
├── ObjPatch (parameter patching and text substitution)
├── ObjSystem (OS commands, environment detection, instance locking)
├── ObjResource (CSS/JS resource injection, parent name resolution)
└── ObjSerialization (JSON encode/decode, object injection/extraction)
All five mixins are imported from factory.core/extend.delegate/ and combined via
multiple inheritance in the Object class definition.
Each delegate mixin is documented in detail in factory.core/extend.delegate/.
ObjDebug — Logging and DiagnosticsProvides the complete debug/logging system including Rich console output, MQTT
log forwarding, and pytest-aware optimisations.
| Method | Purpose |
|---|---|
debug(note, ...) |
Conditional output gated by DO_DEBUG, with frame inspection |
note(note, ...) |
Always-on output, no frame decode |
warning(note, ...) |
WARNING level output |
info(note, ...) |
INFO level, dim styling |
error(note, ...) |
ERROR level output |
exception(note, ...) |
Full traceback context |
note_progress(note, ...) |
In-place countdown with ANSI overwrite on TTY |
debug_base(...) |
Core output method — all others delegate here |
debug_trace(error) |
Formatted traceback output |
debug_table(note, tab) |
Tabular debug output |
debug_dict(note, context) |
Dictionary debug output |
show_trace(trace, err) |
Trace display helper |
progress_bar(...) |
Visual progress bar |
progress_sleep(tx) |
Sleep with progress display |
See factory.core/extend.delegate/ObjDebug.md for full details.
ObjPatch — Parameter PatchingHandles dynamic parameter substitution in SQL, text, and workflow payloads.
| Method | Purpose |
|---|---|
patch_param(...) |
Main entry — substitutes $param$ tokens in text |
patch_paramBuffer(term) |
Resolve a single token from the parameter buffer |
patch_paramRun(...) |
Execute patching with a run context |
patch_all(...) |
Batch-patch all parameters in a payload |
process_text(text) |
Text post-processing after patching |
See factory.core/extend.delegate/ObjPatch.md for full details.
ObjSystem — OS and EnvironmentSystem-level operations: shell commands, Docker/virtualisation detection,
instance locking, and network utilities.
| Method | Purpose |
|---|---|
system_run(command) |
Execute a shell command and return output |
RemoteSystem(Connect, cmd) |
Execute command on a remote host |
is_docker() |
Detect Docker container environment |
is_pytest() |
Detect pytest execution context |
get_virtualization_environment() |
Identify virtualisation platform |
get_ip_address(host) |
Resolve IP address |
single_instance(...) |
Acquire an advisory lock for single-instance execution |
unlock_instance() |
Release advisory lock |
get_local_folder() |
Resolve local document folder path |
connect_mem_db() |
Create an in-memory SQLite connection |
See factory.core/extend.delegate/ObjSystem.md for full details.
ObjResource — Web Resource InjectionManages CSS and JavaScript resource loading for web-rendered components.
| Method | Purpose |
|---|---|
get_parent_name() |
Resolve the parent class name for resource lookup |
add_resource_css(...) |
Load and inject CSS from YAML configuration |
add_resource_script(...) |
Load and inject JavaScript resources |
ObjSerialization — Object SerializationJSON encoding/decoding and object field injection/extraction.
| Method | Purpose |
|---|---|
encode_class_json() |
Serialize object fields to a dictionary |
encode_json() |
Serialize object to a JSON string |
decode_class_json(d) |
Restore object fields from a dictionary |
decode_json(json_str) |
Restore object from a JSON string |
inject(target) |
Copy all fields into a target object |
inject_blank(...) |
Inject blank/default values |
inject_hidden(target) |
Inject hidden fields only |
inject_dictionary(...) |
Inject from a dictionary source |
extract(...) |
Extract fields from a source object |
Connection ClassThe Connection class (defined before Object) provides low-level database
connectivity. It handles connection pooling, multi-database support, and
SQL set configuration.
| Method | Purpose |
|---|---|
connect_db(...) |
Establish a database connection (MySQL, MSSQL, SQLite, Postgres) |
get_sql_set(config_name) |
Load SQL connection parameters from config |
get_local_db_name(host, client) |
Resolve the local database name |
transfer_detail(DB, recon_db) |
Populate transfer metadata |
Object — Methods Defined DirectlyThese methods remain in Objects.py and are not delegated.
| Method | Purpose |
|---|---|
close_db(db) |
Close a database connection and update tracking |
get_db_connections() |
List active database connections |
encrypt(message, package) |
Encrypt a string using the configured key |
decrypt(message, package) |
Decrypt a string using the configured key |
| Method | Purpose |
|---|---|
get_deployment() |
Return the current deployment name (cached) |
get_host() |
Return the current hostname (cached) |
get_role() |
Return the current role (cached) |
| Method | Purpose |
|---|---|
DBType(AltDB) |
Return the database type string for a connection |
is_my_sql(data_connector) |
Check if connector is MySQL/MariaDB |
is_ms_sql(data_connector) |
Check if connector is MSSQL |
is_postgres(data_connector) |
Check if connector is PostgreSQL |
is_sqlite(data_connector) |
Check if connector is SQLite |
is_mongo(data_connector) |
Check if connector is MongoDB |
is_openobserve(data_connector) |
Check if connector is OpenObserve |
| Method | Purpose |
|---|---|
get_uuid(context) |
Generate a short UUID |
safe_int(value, default) |
Safe integer conversion (static) |
NotEmpty(item) |
Check if a value is non-empty |
sql_escape(sql) |
Escape a SQL string |
command_line(prompt, choices) |
Interactive CLI prompt via cutie |
create_tables_from_yaml(schema_name) |
Create database tables from a YAML schema definition |
ini = Objects.global_config # ConfigIni singleton
value = ini.Get(section, key) # Read a config value
Or via static helpers exposed on Object:
value = self.get_ini_value("mqtt", "host", "localhost")
flag = self.get_ini_bool("infisical", "enabled", False)
port = self.get_ini_int("chromadb", "port", 8000)
Objects.py is compiled to a .so extension as part of the factory.core build:
python factory.deploy/ObjCompile.py service core
Updated: 2026-03-21