iotflows-mtconnect 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ """Simple MTConnect client: watch an agent for machine execution state and parts made."""
2
+
3
+ from .agent import ExecutionEvent, MTConnectAgent, PartsEvent
4
+
5
+ __all__ = ["MTConnectAgent", "ExecutionEvent", "PartsEvent"]
6
+ __version__ = "1.0.0"
@@ -0,0 +1,198 @@
1
+ from __future__ import annotations
2
+
3
+ import logging
4
+ import threading
5
+ import urllib.error
6
+ import urllib.parse
7
+ import urllib.request
8
+ from dataclasses import dataclass
9
+ from typing import Any, Callable, Dict, List, Optional
10
+
11
+ from .machine import Machine
12
+ from .mtxml import PATH, Header, Observation, parse_header, parse_observations
13
+
14
+ REQUEST_TIMEOUT = 10.0
15
+ EVENTS = ("execution", "parts", "connect", "disconnect")
16
+
17
+ log = logging.getLogger("iotflows_mtconnect")
18
+
19
+
20
+ @dataclass(frozen=True)
21
+ class ExecutionEvent:
22
+ device: str
23
+ """MTConnect device name, e.g. "OKUMA"."""
24
+ state: str
25
+ """RUNNING, STOPPED or UNKNOWN."""
26
+ execution: Optional[str] = None
27
+ """Raw MTConnect Execution value, e.g. "ACTIVE", "READY". None while the agent is unreachable."""
28
+ mode: Optional[str] = None
29
+ """Raw ControllerMode value, e.g. "AUTOMATIC"."""
30
+ timestamp: Optional[str] = None
31
+ """Agent timestamp of the change. None for the initial snapshot and when the agent is unreachable."""
32
+
33
+
34
+ @dataclass(frozen=True)
35
+ class PartsEvent:
36
+ device: str
37
+ count: int
38
+ """Parts made since the last event."""
39
+ program: Optional[str] = None
40
+ """"program - comment", or None if neither is known."""
41
+ timestamp: Optional[str] = None
42
+
43
+
44
+ class MTConnectAgent:
45
+ """Watches an MTConnect agent and calls listeners for:
46
+
47
+ - ``execution`` (ExecutionEvent): a machine's state changes. On start, once per machine with its current state.
48
+ - ``parts`` (PartsEvent): a machine made parts.
49
+ - ``connect``: the agent is reachable (on start, and again after an outage).
50
+ - ``disconnect`` (exception): the agent is unreachable. Every machine then gets an ``execution`` event with UNKNOWN.
51
+
52
+ It reads /current once, then every change through /sample, so short states between polls aren't missed.
53
+ """
54
+
55
+ def __init__(self, url: str, *, interval: float = 2.0, automatic_only: bool = False) -> None:
56
+ if not url:
57
+ raise ValueError("MTConnectAgent needs the agent URL, e.g. http://192.168.1.50:5000")
58
+ self.url = url.rstrip("/")
59
+ self.interval = interval
60
+ self.automatic_only = automatic_only
61
+ self.machines: Dict[str, Machine] = {} # MTConnect device name -> Machine
62
+ self.connected = False
63
+ self._emitted: Dict[str, str] = {} # device name -> last emitted state
64
+ self._next: Optional[Header] = None # where to continue reading
65
+ self._stopper: Optional[threading.Event] = None
66
+ self._listeners: Dict[str, List[Callable[..., Any]]] = {event: [] for event in EVENTS}
67
+
68
+ def on(self, event: str, listener: Optional[Callable[..., Any]] = None):
69
+ """Add a listener. Also works as a decorator: ``@agent.on("execution")``."""
70
+ if event not in self._listeners:
71
+ raise ValueError(f'Unknown event "{event}". Use one of: {", ".join(EVENTS)}')
72
+ if listener is None:
73
+ return lambda fn: self.on(event, fn)
74
+ self._listeners[event].append(listener)
75
+ return listener
76
+
77
+ def start(self) -> None:
78
+ """Start polling on a background thread. Listeners are called on that thread."""
79
+ if self._stopper:
80
+ return
81
+ self._stopper = threading.Event()
82
+ threading.Thread(target=self._loop, args=(self._stopper,), name="mtconnect-agent", daemon=True).start()
83
+
84
+ def run(self) -> None:
85
+ """Poll on the current thread until stop() is called (e.g. from a listener) or Ctrl+C."""
86
+ if self._stopper:
87
+ raise RuntimeError("Already running")
88
+ self._stopper = stopper = threading.Event()
89
+ try:
90
+ self._loop(stopper)
91
+ finally:
92
+ stopper.set()
93
+ if self._stopper is stopper:
94
+ self._stopper = None
95
+
96
+ def stop(self) -> None:
97
+ """Stop polling. No more events are emitted, even if a request is still in progress."""
98
+ if self._stopper:
99
+ self._stopper.set()
100
+ self._stopper = None
101
+
102
+ def _loop(self, stopper: threading.Event) -> None:
103
+ down = False
104
+ while not stopper.is_set():
105
+ try:
106
+ self._poll(stopper)
107
+ if not self.connected:
108
+ self.connected = True
109
+ down = False
110
+ self._emit(stopper, "connect")
111
+ except Exception as err: # noqa: BLE001 - any failure means the agent can't be read right now
112
+ if stopper.is_set():
113
+ break
114
+ self._next = None
115
+ self.connected = False
116
+ if not down:
117
+ self._emit(stopper, "disconnect", err)
118
+ down = True
119
+ for machine in self.machines.values():
120
+ machine.execution = None # nothing is known while the agent is unreachable
121
+ self._emit_state(stopper, machine)
122
+ stopper.wait(self.interval)
123
+
124
+ def _poll(self, stopper: threading.Event) -> None:
125
+ """Read everything new since the last poll."""
126
+ while not stopper.is_set():
127
+ if not self._next:
128
+ return self._read_current(stopper)
129
+
130
+ xml = self._fetch("sample", {"from": self._next.next_sequence, "count": 1000})
131
+ header = parse_header(xml)
132
+ if not header or header.instance_id != self._next.instance_id:
133
+ # Agent restarted, or we fell behind its buffer: start over
134
+ self._next = None
135
+ continue
136
+ self._apply(stopper, parse_observations(xml), live=True)
137
+ self._next = header
138
+ if header.next_sequence > header.last_sequence:
139
+ return # caught up
140
+
141
+ def _read_current(self, stopper: threading.Event) -> None:
142
+ xml = self._fetch("current", {})
143
+ header = parse_header(xml)
144
+ if not header:
145
+ raise RuntimeError("Unexpected response from /current")
146
+
147
+ observations = parse_observations(xml)
148
+ for name in dict.fromkeys(o.device for o in observations):
149
+ machine = self.machines.get(name) or Machine(name, automatic_only=self.automatic_only)
150
+ machine.select_data_items(observations)
151
+ if "Execution" in machine.data_items: # skips e.g. the "Agent" device
152
+ self.machines[name] = machine
153
+ # Part counts already on the machine are the baseline; after an outage, parts made meanwhile are counted
154
+ self._apply(stopper, observations, live=False)
155
+ self._next = header
156
+
157
+ def _apply(self, stopper: threading.Event, observations: List[Observation], live: bool) -> None:
158
+ for o in observations:
159
+ machine = self.machines.get(o.device)
160
+ if not machine:
161
+ continue
162
+ parts = machine.apply(o, live)
163
+ if parts > 0:
164
+ self._emit(stopper, "parts", PartsEvent(machine.name, parts, machine.program, o.timestamp))
165
+ # Live changes are emitted as they happen; a snapshot only once it's fully applied
166
+ if live:
167
+ self._emit_state(stopper, machine, o.timestamp)
168
+ if not live:
169
+ for machine in self.machines.values():
170
+ self._emit_state(stopper, machine)
171
+
172
+ def _emit_state(self, stopper: threading.Event, machine: Machine, timestamp: Optional[str] = None) -> None:
173
+ state = machine.state
174
+ if self._emitted.get(machine.name) == state:
175
+ return
176
+ self._emitted[machine.name] = state
177
+ self._emit(stopper, "execution", ExecutionEvent(machine.name, state, machine.execution, machine.mode, timestamp))
178
+
179
+ def _emit(self, stopper: threading.Event, event: str, *args: Any) -> None:
180
+ if stopper.is_set():
181
+ return
182
+ for listener in list(self._listeners[event]):
183
+ try:
184
+ listener(*args)
185
+ except Exception: # noqa: BLE001 - a listener error must not stop polling
186
+ log.exception('Error in MTConnectAgent "%s" listener', event)
187
+
188
+ def _fetch(self, request: str, params: Dict[str, Any]) -> str:
189
+ query = urllib.parse.urlencode({"path": PATH, **params})
190
+ try:
191
+ with urllib.request.urlopen(f"{self.url}/{request}?{query}", timeout=REQUEST_TIMEOUT) as response:
192
+ return response.read().decode("utf-8", errors="replace")
193
+ except urllib.error.HTTPError as err:
194
+ xml = err.read().decode("utf-8", errors="replace")
195
+ # An MTConnectError (e.g. OUT_OF_RANGE) has no nextSequence; callers handle it through parse_header()
196
+ if "<MTConnectError" in xml:
197
+ return xml
198
+ raise RuntimeError(f"HTTP {err.code}") from None
@@ -0,0 +1,91 @@
1
+ """Tracks one MTConnect device: its execution state and the parts it makes."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import math
6
+ from typing import Dict, Iterable, Optional
7
+
8
+ from .mtxml import Observation
9
+
10
+ IGNORED_SUBTYPES = {
11
+ "PartCount": ("TARGET", "REMAINING", "BAD", "ABORTED", "FAILED"),
12
+ "Program": ("ACTIVE", "SCHEDULE"), # prefer MAIN / no subType
13
+ "ProgramComment": ("ACTIVE",),
14
+ }
15
+
16
+
17
+ class Machine:
18
+ def __init__(self, name: str, *, automatic_only: bool = False) -> None:
19
+ self.name = name
20
+ self.automatic_only = automatic_only
21
+ self.data_items: Dict[str, str] = {} # type -> the dataItemId we follow
22
+ self.execution: Optional[str] = None # raw MTConnect value, e.g. ACTIVE, READY
23
+ self.mode: Optional[str] = None
24
+ self.part_count: Optional[int] = None
25
+ self.program_name: Optional[str] = None
26
+ self.program_comment: Optional[str] = None
27
+
28
+ def select_data_items(self, observations: Iterable[Observation]) -> None:
29
+ """Follow the first data item of each type in a /current snapshot, skipping unwanted subTypes."""
30
+ self.data_items = {}
31
+ for o in observations:
32
+ if o.device != self.name or o.type in self.data_items:
33
+ continue
34
+ if o.sub_type not in IGNORED_SUBTYPES.get(o.type, ()):
35
+ self.data_items[o.type] = o.data_item_id
36
+
37
+ @property
38
+ def state(self) -> str:
39
+ """RUNNING, STOPPED or UNKNOWN."""
40
+ if self.execution is None or self.execution == "UNAVAILABLE":
41
+ return "UNKNOWN"
42
+ running = self.execution == "ACTIVE" and (not self.automatic_only or self.mode == "AUTOMATIC")
43
+ return "RUNNING" if running else "STOPPED"
44
+
45
+ @property
46
+ def program(self) -> Optional[str]:
47
+ """"program - comment", or None if neither is known."""
48
+ return " - ".join(p for p in (self.program_name, self.program_comment) if p) or None
49
+
50
+ def apply(self, o: Observation, live: bool) -> int:
51
+ """Apply one observation and return how many parts it completed.
52
+
53
+ `live` is False for /current snapshots, where a PROGRAM_COMPLETED may be old news.
54
+ """
55
+ if self.data_items.get(o.type) != o.data_item_id:
56
+ return 0
57
+
58
+ if o.type == "Program":
59
+ self.program_name = o.value
60
+ elif o.type == "ProgramComment":
61
+ self.program_comment = o.value
62
+ elif o.type == "ControllerMode":
63
+ self.mode = o.value
64
+ elif o.type == "Execution":
65
+ # No part counter: a completed program counts as one part
66
+ completed = (
67
+ live
68
+ and "PartCount" not in self.data_items
69
+ and o.value == "PROGRAM_COMPLETED"
70
+ and self.execution != "PROGRAM_COMPLETED"
71
+ )
72
+ self.execution = o.value
73
+ return 1 if completed else 0
74
+ elif o.type == "PartCount":
75
+ count = _integer(o.value)
76
+ if count is None: # UNAVAILABLE
77
+ return 0
78
+ previous, self.part_count = self.part_count, count
79
+ if previous is None or count == previous:
80
+ return 0
81
+ # Counter went down: it was reset, so everything since the reset is new
82
+ return count - previous if count > previous else count
83
+ return 0
84
+
85
+
86
+ def _integer(value: str) -> Optional[int]:
87
+ try:
88
+ number = float(value)
89
+ except ValueError:
90
+ return None
91
+ return int(number) if math.isfinite(number) and number.is_integer() else None
@@ -0,0 +1,86 @@
1
+ """Minimal MTConnect XML reading, for the few observation types we use."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import xml.etree.ElementTree as ET
6
+ from dataclasses import dataclass
7
+ from typing import List, Optional
8
+
9
+ TYPES = ("Execution", "ControllerMode", "PartCount", "Program", "ProgramComment")
10
+
11
+ # Agent query that returns only the data items above
12
+ PATH = (
13
+ '//DataItem[@type="EXECUTION" or @type="CONTROLLER_MODE" or @type="PART_COUNT"'
14
+ ' or @type="PROGRAM" or @type="PROGRAM_COMMENT"]'
15
+ )
16
+
17
+
18
+ @dataclass(frozen=True)
19
+ class Header:
20
+ instance_id: Optional[str]
21
+ next_sequence: int
22
+ last_sequence: int
23
+
24
+
25
+ @dataclass(frozen=True)
26
+ class Observation:
27
+ device: Optional[str]
28
+ type: str
29
+ data_item_id: Optional[str]
30
+ sub_type: Optional[str]
31
+ sequence: int
32
+ timestamp: Optional[str]
33
+ value: str
34
+
35
+
36
+ def parse_header(xml: str) -> Optional[Header]:
37
+ """The response header, or None if the response is an MTConnectError (e.g. OUT_OF_RANGE)."""
38
+ root = ET.fromstring(xml)
39
+ header = next((e for e in root.iter() if _name(e) == "Header"), None)
40
+ if _name(root) == "MTConnectError" or header is None:
41
+ return None
42
+ next_sequence = _int(header.get("nextSequence"))
43
+ if not next_sequence:
44
+ return None
45
+ return Header(
46
+ instance_id=header.get("instanceId"),
47
+ next_sequence=next_sequence,
48
+ last_sequence=_int(header.get("lastSequence")),
49
+ )
50
+
51
+
52
+ def parse_observations(xml: str) -> List[Observation]:
53
+ """All observations of TYPES, across devices, in the order they happened."""
54
+ observations = []
55
+ for stream in ET.fromstring(xml).iter():
56
+ if _name(stream) != "DeviceStream":
57
+ continue
58
+ device = stream.get("name")
59
+ for element in stream.iter():
60
+ type_ = _name(element)
61
+ if type_ not in TYPES:
62
+ continue
63
+ observations.append(
64
+ Observation(
65
+ device=device,
66
+ type=type_,
67
+ data_item_id=element.get("dataItemId"),
68
+ sub_type=element.get("subType"),
69
+ sequence=_int(element.get("sequence")),
70
+ timestamp=element.get("timestamp"),
71
+ value=(element.text or "").strip(),
72
+ )
73
+ )
74
+ return sorted(observations, key=lambda o: o.sequence)
75
+
76
+
77
+ def _name(element: ET.Element) -> str:
78
+ """Tag name without its namespace."""
79
+ return element.tag.rsplit("}", 1)[-1]
80
+
81
+
82
+ def _int(value: Optional[str]) -> int:
83
+ try:
84
+ return int(value)
85
+ except (TypeError, ValueError):
86
+ return 0
File without changes
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.5
2
+ Name: iotflows-mtconnect
3
+ Version: 1.0.0
4
+ Summary: Simple MTConnect client: watch an agent for machine execution state and parts made.
5
+ Project-URL: Homepage, https://iotflows.com
6
+ Project-URL: Source, https://github.com/iotflows/iotflows-mtconnect-python
7
+ Author-email: IoTFlows <support@iotflows.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: cnc,iotflows,machine-monitoring,mtconnect,oee
11
+ Classifier: Intended Audience :: Manufacturing
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Topic :: System :: Monitoring
15
+ Classifier: Typing :: Typed
16
+ Requires-Python: >=3.9
17
+ Provides-Extra: test
18
+ Requires-Dist: pytest; extra == 'test'
19
+ Description-Content-Type: text/markdown
20
+
21
+ # iotflows-mtconnect
22
+
23
+ Watch an MTConnect agent for each machine's execution state and the parts it makes. No dependencies.
24
+
25
+ ```bash
26
+ pip install iotflows-mtconnect
27
+ ```
28
+
29
+ Requires Python 3.9+. The Python version of [`@iotflows/mtconnect`](https://www.npmjs.com/package/@iotflows/mtconnect). It works the same way.
30
+
31
+ ```python
32
+ from iotflows_mtconnect import MTConnectAgent
33
+
34
+ agent = MTConnectAgent("https://demo.mtconnect.org")
35
+
36
+ agent.on("execution", lambda e: print(e.device, e.state)) # OKUMA RUNNING
37
+ agent.on("parts", lambda e: print(e.device, e.count, e.program)) # OKUMA 1 IMTS-2022-1E-MM.MIN
38
+
39
+ agent.run() # blocks until Ctrl+C or agent.stop()
40
+ ```
41
+
42
+ Use `agent.start()` instead to poll on a background thread, and `agent.stop()` to end it. Listeners also work as decorators:
43
+
44
+ ```python
45
+ @agent.on("execution")
46
+ def on_execution(e):
47
+ print(e.device, e.state)
48
+ ```
49
+
50
+ ## Events
51
+
52
+ | Event | Argument | When |
53
+ |--------------|----------|------|
54
+ | `execution` | `ExecutionEvent(device, state, execution, mode, timestamp)` | A machine's state changes. On start, one event per machine with its current state. |
55
+ | `parts` | `PartsEvent(device, count, program, timestamp)` | A machine made `count` parts. `program` is "program - comment". |
56
+ | `connect` | | The agent is reachable (on start, and again after an outage). |
57
+ | `disconnect` | `error` | The agent is unreachable. Every machine then gets an `execution` event with `UNKNOWN`. |
58
+
59
+ `device` is the MTConnect device name. `state` is `"RUNNING"`, `"STOPPED"` or `"UNKNOWN"`. `execution` is the raw MTConnect value (`ACTIVE`, `READY`, …), or `None` while the agent is unreachable. `timestamp` is the agent's time for the change. It's `None` for the initial state, because that may be hours old.
60
+
61
+ Listeners run on the polling thread. An exception in a listener is logged (logger `iotflows_mtconnect`) and polling continues.
62
+
63
+ ## How it decides
64
+
65
+ **State**
66
+ - `Execution` `ACTIVE` → `RUNNING`.
67
+ - `UNAVAILABLE`, or the agent can't be reached → `UNKNOWN`.
68
+ - Anything else (`READY`, `INTERRUPTED`, `FEED_HOLD`, …) → `STOPPED`.
69
+ - With `automatic_only=True`, `ACTIVE` only counts as `RUNNING` when `ControllerMode` is `AUTOMATIC`.
70
+
71
+ **Parts**
72
+ - Every increase of `PartCount` is counted. `TARGET`, `REMAINING`, `BAD`, `ABORTED` and `FAILED` counters are ignored.
73
+ - If the counter goes down, it was reset, so its new value is counted as new parts.
74
+ - After an outage, parts made in the meantime are counted.
75
+ - Machines without a `PartCount` count one part each time `Execution` becomes `PROGRAM_COMPLETED`.
76
+
77
+ It reads `/current` once, then every change through `/sample`, so brief states between polls (like a 0.25 s `PROGRAM_COMPLETED`) aren't missed. Only the five data items it uses are requested.
78
+
79
+ ## Send to IoTFlows
80
+
81
+ With [`iotflows-device`](https://pypi.org/project/iotflows-device/):
82
+
83
+ ```python
84
+ from iotflows_device import IoTFlowsDevice
85
+ from iotflows_mtconnect import MTConnectAgent
86
+
87
+ iotflows = IoTFlowsDevice(username="dev_xxxxxxxx", password="xxxxxxxx")
88
+ iotflows.connect()
89
+
90
+ agent = MTConnectAgent("http://192.168.1.50:5000")
91
+ agent.on("execution", lambda e: iotflows.asset(e.device).execution(e.state))
92
+ agent.on("parts", lambda e: iotflows.asset(e.device).count(e.count, part_name=e.program))
93
+ agent.run()
94
+ ```
95
+
96
+ This assumes each IoTFlows asset has the same name as its MTConnect device. To find the MTConnect device names, open `<agent>/probe` in a browser and look for `<Device name="...">`.
97
+
98
+ ### Ready-to-run gateway
99
+
100
+ [`examples/gateway`](./examples/gateway) is a complete gateway with a config file, name mapping (`OKUMA` → `Line 10`) and logging:
101
+
102
+ ```bash
103
+ pip install iotflows-device iotflows-mtconnect
104
+ cd examples/gateway
105
+ cp config.example.json config.json # then edit config.json
106
+ python gateway.py
107
+ ```
108
+
109
+ You should see:
110
+
111
+ ```
112
+ 2026-12-02 10:00:00,000 Connected to IoTFlows
113
+ 2026-12-02 10:00:00,400 Line 10 RUNNING (ACTIVE)
114
+ 2026-12-02 10:00:00,400 Press 4 STOPPED (READY)
115
+ 2026-12-02 10:00:00,401 Watching http://192.168.1.50:5000
116
+ ```
117
+
118
+ | Setting | Description |
119
+ |------------------|-------------|
120
+ | `agentUrl` | MTConnect agent, e.g. `http://192.168.1.50:5000` |
121
+ | `username`, `password` | IoTFlows device credentials |
122
+ | `machines` | MTConnect device name → IoTFlows asset (name, custom identifier or `asset_uuid`). If you leave this out, each MTConnect device is matched to the asset with the same name. Devices that aren't listed are ignored. |
123
+ | `automaticOnly` | `true`: count as RUNNING only when ControllerMode is AUTOMATIC |
124
+
125
+ Each part is published with the program name (plus program comment, if any) as its part name. Times are recorded when IoTFlows receives the data, at most one poll interval (2 s) late. Agent timestamps aren't sent, because machine clocks are often wrong.
126
+
127
+ It stays connected to IoTFlows. If it stops for any reason, IoTFlows sets the assets to `UNKNOWN`. To keep it running permanently on Linux, use systemd, in `/etc/systemd/system/mtconnect-gateway.service`:
128
+
129
+ ```ini
130
+ [Unit]
131
+ Description=IoTFlows MTConnect Gateway
132
+ After=network-online.target
133
+ Wants=network-online.target
134
+
135
+ [Service]
136
+ WorkingDirectory=/opt/iotflows-mtconnect-gateway
137
+ ExecStart=/usr/bin/python3 gateway.py
138
+ Restart=always
139
+ RestartSec=10
140
+
141
+ [Install]
142
+ WantedBy=multi-user.target
143
+ ```
144
+
145
+ ```bash
146
+ sudo systemctl enable --now mtconnect-gateway
147
+ journalctl -u mtconnect-gateway -f
148
+ ```
149
+
150
+ ## Options
151
+
152
+ ```python
153
+ MTConnectAgent(url,
154
+ interval=2.0, # poll every 2 s
155
+ automatic_only=False,
156
+ )
157
+ ```
158
+
159
+ ## Development
160
+
161
+ ```bash
162
+ pip install -e ".[test]"
163
+ pytest
164
+ ```
165
+
166
+ ## License
167
+
168
+ Apache-2.0
@@ -0,0 +1,9 @@
1
+ iotflows_mtconnect/__init__.py,sha256=X2Cl5LZKXErOE8tvf3knb535tHbq8hYFbPUJEoS2aEg,237
2
+ iotflows_mtconnect/agent.py,sha256=2ofbd1f26O6hvcpZ51zDdj5ph7wqYTKetIAgchC3v_E,8647
3
+ iotflows_mtconnect/machine.py,sha256=2u_yk4fUXnUVGw6hGH4WZUUUWFhnocHDkNVYD1j5bNM,3544
4
+ iotflows_mtconnect/mtxml.py,sha256=O_2zqVdH2BYxQy0uC285oRCmMEAJFMOVpP5vcDJZm5s,2614
5
+ iotflows_mtconnect/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ iotflows_mtconnect-1.0.0.dist-info/METADATA,sha256=F5wOFoT8pgsqs4V7N0lB4iq2_05fQTjMiXBDQ_IF0NM,6339
7
+ iotflows_mtconnect-1.0.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
8
+ iotflows_mtconnect-1.0.0.dist-info/licenses/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
9
+ iotflows_mtconnect-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.