A Python library for decoding and parsing ISA51 identifiers. This library supports both standard ISA51 codes and custom user-defined components.
- Decode ISA51 identifiers into their component parts
- Support for variable modifiers and function modifiers
- Handle both active and passive functions
- Custom component registration
- Full validation of ISA51 codes
pip install isa51-decoder
from isa51_decoder_agg import ISA51DecoderAggregator
decoder = ISA51DecoderAggregator()
# Simple code with variable and active function
result = decoder.decode_isa_51("AC") # Analysis Control
# Code with variable modifiers
result = decoder.decode_isa_51("FQT") # Flow Total Transmit
# Complex code with multiple modifiers
result = decoder.decode_isa_51("ZDXADH") # Position Difference X Axis High Deviation Alarm
You can register custom components for your specific needs:
from data_types import ISA51Component
from letter_based_decoder import UserChoiceMap
c_fly_done_var = ISA51Component(
name="Fly Drone",
refs_codes=["1"],
refs_text={"1": "Fly Drone that is used for measuring"},
letter="C"
)
b_sun_light_sensor = ISA51Component(
name="Sun Light Sensor",
refs_codes=["1"],
refs_text={"1": "Sensor that measures the sun light"},
letter="B"
)
n_water_irrigation = ISA51Component(
name="Water Irrigation",
refs_codes=["1"],
refs_text={"1": "Water Irrigation system"},
letter="N"
)
water_heater = ISA51Component(
name="Water Heater",
refs_codes=["1"],
refs_text={"1": "Water Heater system"},
letter="B"
)
uc_map = UserChoiceMap(
variables={
"C": c_fly_done_var,
},
passive_functions={
"B": b_sun_light_sensor,
},
active_functions={
"N": n_water_irrigation,
},
function_modifiers={
"B": water_heater
}
)
decoder = ISA51DecoderAggregator(uc_map)
# Use custom components
result = decoder.decode_isa_51("CN") # "Fly Drone Water Irrigation"
MIT
The ANSI/ISA 51 standard is a registered trademark of the International Society of Automation (ISA). This library is not affiliated with ISA and is not endorsed by ISA.