signals¶
- raw¶
An
OrderedDictof all signals extracted fromdata.raw, sorted by the signal processing order. The signal processing order is the sorted virtual signals, followed by the sorted fluid signals, followed by all the sorted item signals. The order of signals insignals.rawcan be considered equivalent tosignals.virtual + signals.fluid + signals.item. The exact format of the data depends on what type of item/fluid/signal is being queried. Allows the user to iterate over all signals in order, and query specific properties about them, such as their order string for custom sorting orders. Order and content are dependent on loaded mods.- Example:
import json from draftsman.data import signals print(json.dumps(signals.raw["iron-ore"], indent=4)){ "order": "e[iron-ore]", "pictures": [ ... ], "stack_size": 50, "type": "item", "icon_mipmaps": 4, "name": "iron-ore", "icon": "__base__/graphics/icons/iron-ore.png", "subgroup": "raw-resource", "icon_size": 64 }
- type_of¶
A
dictof all signals where the key is the name of the signal and the value is the signal type of the signal. Note that this value may differ from the value ofsignals.raw[signal_name]["type"]; this value is used specifically during the construction ofSIGNAL_ID. The returned value can be one of"item","fluid", or"virtual". Order is dependent on loaded mods.Note
This structure is unsorted. If you want to iterate over signals in order, consider using
signals.rawinstead:from draftsman.data import signals for signal_name in signals.raw: print(signals.type_of[signal_name])
- item¶
A list of all item signal names, sorted by their Factorio order. Order and content are dependent on mods.
# Possible contents [ "wooden-chest", "iron-chest", "steel-chest", "storage-tank", "transport-belt", "fast-transport-belt", "express-transport-belt", "underground-belt", "fast-underground-belt", "express-underground-belt", ... ]
- fluid¶
A list of all fluid signal names, sorted by their Factorio order. Order and content are dependent on loaded mods.
# Possible contents [ "water", "crude-oil", "steam", "heavy-oil", "light-oil", "petroleum-gas", "sulfuric-acid", "lubricant" ]
- virtual¶
A list of all virtual signal names, sorted by their Factorio order. Order and content are dependent on loaded mods.
# Possible contents [ "signal-everything", "signal-anything", "signal-each", "signal-0", "signal-1", "signal-2", "signal-3", "signal-4", "signal-5", "signal-6", ... ]Note
signals.virtualcontains the signals insignals.pure_virtual, as illustrated above.
- pure_virtual¶
A list of all pure virtual signal names, sorted by their Factorio order. This list is constant, independent of mods, and is always equivalent to:
["signal-everything", "signal-anything", "signal-each"]
- get_signal_types(signal_name: str) list[str]¶
Returns the set of types that a given signal can have based on its ID string.
Typically, signals can only be selected with a single type, but the game distinguishes between signals of different types in the circuit network. This means that you can have multiple different versions of the “same” signal, with the only difference being their type. For example,
transport-beltcan have a type of"item","recipe", or"entity".- Parameters:
- signal_name: str¶
The name of the signal.
- Returns:
A set of strings that this signal’s type can be.
- Raises:
InvalidSignalError – If the signal name is not contained within
draftsman.data.signals, and thus it’s types cannot be deduced.