PyAutomationIO 1.0.0__tar.gz
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.
- pyautomationio-1.0.0/LICENSE +21 -0
- pyautomationio-1.0.0/MANIFEST.in +4 -0
- pyautomationio-1.0.0/PKG-INFO +198 -0
- pyautomationio-1.0.0/PyAutomationIO.egg-info/PKG-INFO +198 -0
- pyautomationio-1.0.0/PyAutomationIO.egg-info/SOURCES.txt +143 -0
- pyautomationio-1.0.0/PyAutomationIO.egg-info/dependency_links.txt +1 -0
- pyautomationio-1.0.0/PyAutomationIO.egg-info/requires.txt +26 -0
- pyautomationio-1.0.0/PyAutomationIO.egg-info/top_level.txt +1 -0
- pyautomationio-1.0.0/README.md +145 -0
- pyautomationio-1.0.0/automation/__init__.py +46 -0
- pyautomationio-1.0.0/automation/alarms/__init__.py +563 -0
- pyautomationio-1.0.0/automation/alarms/states.py +192 -0
- pyautomationio-1.0.0/automation/alarms/trigger.py +64 -0
- pyautomationio-1.0.0/automation/buffer.py +132 -0
- pyautomationio-1.0.0/automation/core.py +1775 -0
- pyautomationio-1.0.0/automation/dbmodels/__init__.py +23 -0
- pyautomationio-1.0.0/automation/dbmodels/alarms.py +524 -0
- pyautomationio-1.0.0/automation/dbmodels/core.py +86 -0
- pyautomationio-1.0.0/automation/dbmodels/events.py +153 -0
- pyautomationio-1.0.0/automation/dbmodels/logs.py +155 -0
- pyautomationio-1.0.0/automation/dbmodels/machines.py +181 -0
- pyautomationio-1.0.0/automation/dbmodels/opcua.py +81 -0
- pyautomationio-1.0.0/automation/dbmodels/opcua_server.py +174 -0
- pyautomationio-1.0.0/automation/dbmodels/tags.py +921 -0
- pyautomationio-1.0.0/automation/dbmodels/users.py +259 -0
- pyautomationio-1.0.0/automation/extensions/__init__.py +15 -0
- pyautomationio-1.0.0/automation/extensions/api.py +149 -0
- pyautomationio-1.0.0/automation/extensions/cors.py +18 -0
- pyautomationio-1.0.0/automation/filter/__init__.py +19 -0
- pyautomationio-1.0.0/automation/iad/__init__.py +3 -0
- pyautomationio-1.0.0/automation/iad/frozen_data.py +54 -0
- pyautomationio-1.0.0/automation/iad/out_of_range.py +51 -0
- pyautomationio-1.0.0/automation/iad/outliers.py +51 -0
- pyautomationio-1.0.0/automation/logger/__init__.py +0 -0
- pyautomationio-1.0.0/automation/logger/alarms.py +426 -0
- pyautomationio-1.0.0/automation/logger/core.py +265 -0
- pyautomationio-1.0.0/automation/logger/datalogger.py +646 -0
- pyautomationio-1.0.0/automation/logger/events.py +194 -0
- pyautomationio-1.0.0/automation/logger/logdict.py +53 -0
- pyautomationio-1.0.0/automation/logger/logs.py +203 -0
- pyautomationio-1.0.0/automation/logger/machines.py +248 -0
- pyautomationio-1.0.0/automation/logger/opcua_server.py +130 -0
- pyautomationio-1.0.0/automation/logger/users.py +96 -0
- pyautomationio-1.0.0/automation/managers/__init__.py +4 -0
- pyautomationio-1.0.0/automation/managers/alarms.py +455 -0
- pyautomationio-1.0.0/automation/managers/db.py +328 -0
- pyautomationio-1.0.0/automation/managers/opcua_client.py +186 -0
- pyautomationio-1.0.0/automation/managers/state_machine.py +183 -0
- pyautomationio-1.0.0/automation/models.py +174 -0
- pyautomationio-1.0.0/automation/modules/__init__.py +14 -0
- pyautomationio-1.0.0/automation/modules/alarms/__init__.py +0 -0
- pyautomationio-1.0.0/automation/modules/alarms/resources/__init__.py +10 -0
- pyautomationio-1.0.0/automation/modules/alarms/resources/alarms.py +280 -0
- pyautomationio-1.0.0/automation/modules/alarms/resources/summary.py +79 -0
- pyautomationio-1.0.0/automation/modules/events/__init__.py +0 -0
- pyautomationio-1.0.0/automation/modules/events/resources/__init__.py +10 -0
- pyautomationio-1.0.0/automation/modules/events/resources/events.py +83 -0
- pyautomationio-1.0.0/automation/modules/events/resources/logs.py +109 -0
- pyautomationio-1.0.0/automation/modules/tags/__init__.py +0 -0
- pyautomationio-1.0.0/automation/modules/tags/resources/__init__.py +8 -0
- pyautomationio-1.0.0/automation/modules/tags/resources/tags.py +201 -0
- pyautomationio-1.0.0/automation/modules/users/__init__.py +2 -0
- pyautomationio-1.0.0/automation/modules/users/resources/__init__.py +10 -0
- pyautomationio-1.0.0/automation/modules/users/resources/models/__init__.py +2 -0
- pyautomationio-1.0.0/automation/modules/users/resources/models/roles.py +5 -0
- pyautomationio-1.0.0/automation/modules/users/resources/models/users.py +14 -0
- pyautomationio-1.0.0/automation/modules/users/resources/roles.py +38 -0
- pyautomationio-1.0.0/automation/modules/users/resources/users.py +113 -0
- pyautomationio-1.0.0/automation/modules/users/roles.py +121 -0
- pyautomationio-1.0.0/automation/modules/users/users.py +335 -0
- pyautomationio-1.0.0/automation/opcua/__init__.py +1 -0
- pyautomationio-1.0.0/automation/opcua/models.py +541 -0
- pyautomationio-1.0.0/automation/opcua/subscription.py +259 -0
- pyautomationio-1.0.0/automation/pages/__init__.py +0 -0
- pyautomationio-1.0.0/automation/pages/alarms.py +34 -0
- pyautomationio-1.0.0/automation/pages/alarms_history.py +21 -0
- pyautomationio-1.0.0/automation/pages/assets/styles.css +7 -0
- pyautomationio-1.0.0/automation/pages/callbacks/__init__.py +28 -0
- pyautomationio-1.0.0/automation/pages/callbacks/alarms.py +218 -0
- pyautomationio-1.0.0/automation/pages/callbacks/alarms_summary.py +20 -0
- pyautomationio-1.0.0/automation/pages/callbacks/db.py +222 -0
- pyautomationio-1.0.0/automation/pages/callbacks/filter.py +238 -0
- pyautomationio-1.0.0/automation/pages/callbacks/machines.py +29 -0
- pyautomationio-1.0.0/automation/pages/callbacks/machines_detailed.py +581 -0
- pyautomationio-1.0.0/automation/pages/callbacks/opcua.py +266 -0
- pyautomationio-1.0.0/automation/pages/callbacks/opcua_server.py +244 -0
- pyautomationio-1.0.0/automation/pages/callbacks/tags.py +495 -0
- pyautomationio-1.0.0/automation/pages/callbacks/trends.py +119 -0
- pyautomationio-1.0.0/automation/pages/communications.py +129 -0
- pyautomationio-1.0.0/automation/pages/components/__init__.py +123 -0
- pyautomationio-1.0.0/automation/pages/components/alarms.py +151 -0
- pyautomationio-1.0.0/automation/pages/components/alarms_summary.py +45 -0
- pyautomationio-1.0.0/automation/pages/components/database.py +128 -0
- pyautomationio-1.0.0/automation/pages/components/gaussian_filter.py +69 -0
- pyautomationio-1.0.0/automation/pages/components/machines.py +396 -0
- pyautomationio-1.0.0/automation/pages/components/opcua.py +384 -0
- pyautomationio-1.0.0/automation/pages/components/opcua_server.py +53 -0
- pyautomationio-1.0.0/automation/pages/components/tags.py +253 -0
- pyautomationio-1.0.0/automation/pages/components/trends.py +66 -0
- pyautomationio-1.0.0/automation/pages/database.py +26 -0
- pyautomationio-1.0.0/automation/pages/filter.py +55 -0
- pyautomationio-1.0.0/automation/pages/machines.py +20 -0
- pyautomationio-1.0.0/automation/pages/machines_detailed.py +41 -0
- pyautomationio-1.0.0/automation/pages/main.py +63 -0
- pyautomationio-1.0.0/automation/pages/opcua_server.py +28 -0
- pyautomationio-1.0.0/automation/pages/tags.py +40 -0
- pyautomationio-1.0.0/automation/pages/trends.py +35 -0
- pyautomationio-1.0.0/automation/singleton.py +30 -0
- pyautomationio-1.0.0/automation/state_machine.py +1672 -0
- pyautomationio-1.0.0/automation/tags/__init__.py +2 -0
- pyautomationio-1.0.0/automation/tags/cvt.py +1198 -0
- pyautomationio-1.0.0/automation/tags/filter.py +55 -0
- pyautomationio-1.0.0/automation/tags/tag.py +418 -0
- pyautomationio-1.0.0/automation/tests/__init__.py +10 -0
- pyautomationio-1.0.0/automation/tests/test_alarms.py +110 -0
- pyautomationio-1.0.0/automation/tests/test_core.py +257 -0
- pyautomationio-1.0.0/automation/tests/test_unit.py +21 -0
- pyautomationio-1.0.0/automation/tests/test_user.py +155 -0
- pyautomationio-1.0.0/automation/utils/__init__.py +164 -0
- pyautomationio-1.0.0/automation/utils/decorators.py +222 -0
- pyautomationio-1.0.0/automation/utils/npw.py +294 -0
- pyautomationio-1.0.0/automation/utils/observer.py +21 -0
- pyautomationio-1.0.0/automation/utils/units.py +118 -0
- pyautomationio-1.0.0/automation/variables/__init__.py +55 -0
- pyautomationio-1.0.0/automation/variables/adimentional.py +30 -0
- pyautomationio-1.0.0/automation/variables/current.py +71 -0
- pyautomationio-1.0.0/automation/variables/density.py +115 -0
- pyautomationio-1.0.0/automation/variables/eng_time.py +68 -0
- pyautomationio-1.0.0/automation/variables/force.py +90 -0
- pyautomationio-1.0.0/automation/variables/length.py +104 -0
- pyautomationio-1.0.0/automation/variables/mass.py +80 -0
- pyautomationio-1.0.0/automation/variables/mass_flow.py +101 -0
- pyautomationio-1.0.0/automation/variables/percentage.py +30 -0
- pyautomationio-1.0.0/automation/variables/power.py +113 -0
- pyautomationio-1.0.0/automation/variables/pressure.py +93 -0
- pyautomationio-1.0.0/automation/variables/temperature.py +168 -0
- pyautomationio-1.0.0/automation/variables/volume.py +70 -0
- pyautomationio-1.0.0/automation/variables/volumetric_flow.py +100 -0
- pyautomationio-1.0.0/automation/workers/__init__.py +2 -0
- pyautomationio-1.0.0/automation/workers/logger.py +164 -0
- pyautomationio-1.0.0/automation/workers/state_machine.py +207 -0
- pyautomationio-1.0.0/automation/workers/worker.py +36 -0
- pyautomationio-1.0.0/requirements.txt +23 -0
- pyautomationio-1.0.0/setup.cfg +4 -0
- pyautomationio-1.0.0/setup.py +42 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 know-ai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: PyAutomationIO
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A python library to develop automation continuous tasks using sync or async concurrent threads
|
|
5
|
+
Home-page: https://github.com/know-ai/PyAutomation
|
|
6
|
+
Author: KnowAI
|
|
7
|
+
Author-email: dev.know.ai@gmail.com
|
|
8
|
+
License: GNU AFFERO GENERAL PUBLIC LICENSE
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
17
|
+
Classifier: Topic :: System :: Logging
|
|
18
|
+
Classifier: Topic :: System :: Monitoring
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: python-statemachine==2.4.0
|
|
22
|
+
Requires-Dist: python-statemachine[diagrams]
|
|
23
|
+
Requires-Dist: peewee==3.17.8
|
|
24
|
+
Requires-Dist: psycopg2-binary==2.9.9; sys_platform != "win32"
|
|
25
|
+
Requires-Dist: psycopg2==2.9.9; sys_platform == "win32"
|
|
26
|
+
Requires-Dist: numpy==1.25.0
|
|
27
|
+
Requires-Dist: PyWavelets==1.7.0
|
|
28
|
+
Requires-Dist: dash==2.18.2
|
|
29
|
+
Requires-Dist: dash-bootstrap-components==1.6.0
|
|
30
|
+
Requires-Dist: dash-mantine-components==0.14.7
|
|
31
|
+
Requires-Dist: dash-iconify==0.1.2
|
|
32
|
+
Requires-Dist: opcua==0.98.13
|
|
33
|
+
Requires-Dist: python-dotenv==1.0.1
|
|
34
|
+
Requires-Dist: cryptography==43.0.3
|
|
35
|
+
Requires-Dist: Flask-Cors==5.0.0
|
|
36
|
+
Requires-Dist: flask-restx==1.3.0
|
|
37
|
+
Requires-Dist: Flask-SocketIO==5.4.1
|
|
38
|
+
Requires-Dist: gunicorn==23.0.0
|
|
39
|
+
Requires-Dist: websocket-client==1.8.0
|
|
40
|
+
Requires-Dist: gevent-websocket==0.10.1
|
|
41
|
+
Requires-Dist: PyJWT==2.9.0
|
|
42
|
+
Requires-Dist: pydot==3.0.2
|
|
43
|
+
Dynamic: author
|
|
44
|
+
Dynamic: author-email
|
|
45
|
+
Dynamic: classifier
|
|
46
|
+
Dynamic: description
|
|
47
|
+
Dynamic: description-content-type
|
|
48
|
+
Dynamic: home-page
|
|
49
|
+
Dynamic: license
|
|
50
|
+
Dynamic: license-file
|
|
51
|
+
Dynamic: requires-dist
|
|
52
|
+
Dynamic: summary
|
|
53
|
+
|
|
54
|
+
# PyAutomation
|
|
55
|
+
|
|
56
|
+
The development intention of this framework is to provide the ability to develop industrial applications where processes need to be executed concurrently and field data need to be managed for monitoring, control, and supervision applications.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
In the image above, you can generally see the architecture and interaction of the different modules that make up the framework.
|
|
63
|
+
|
|
64
|
+
For this, state machines are available that run in the background and concurrently to acquire data by query (DAQ), Acquire Data by Exception (DAS) and any other general purpose state machine.
|
|
65
|
+
|
|
66
|
+
It has a memory persistence module for real-time variables that we call (CVT, Current Value Table).
|
|
67
|
+
|
|
68
|
+
There is also an alarm management system
|
|
69
|
+
|
|
70
|
+
And finally, the disk persistence of the variables to provide functionalities for historical trends of the field variables.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# Run Config Page
|
|
74
|
+
|
|
75
|
+
## Crearte Virtual Environment
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
python3 -m venv venv
|
|
79
|
+
. venv/bin/activate
|
|
80
|
+
```
|
|
81
|
+
## Install Dependencies
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
pip install --upgrade pip
|
|
85
|
+
pip install -r requirements.txt
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Run Config page
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
python run.py
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
or
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
|
|
98
|
+
./docker-entrypoint.sh
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Deploy documentation on Development mode With mkautodoc
|
|
102
|
+
|
|
103
|
+
### Install Wheel
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
pip install wheel
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Create PyAutomation's package
|
|
110
|
+
|
|
111
|
+
Execute this code where is setup.py file
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
python3 setup.py bdist_wheel
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
This create some folders
|
|
118
|
+
|
|
119
|
+
- build
|
|
120
|
+
- dist
|
|
121
|
+
- PyAutomation.egg-info
|
|
122
|
+
|
|
123
|
+
### Install PyAutomation Folder
|
|
124
|
+
|
|
125
|
+
Located into "dist" folder
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
pip install dist/PyAutomation-1.0.0-py3-none-any.whl
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
After that, you can run mkdocs serve
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
# Deploy
|
|
135
|
+
|
|
136
|
+
Make the following `.env` file:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
PORT=5000
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Docker
|
|
143
|
+
|
|
144
|
+
Export environment variables
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
export $(grep -v '^#' .env | xargs)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Start the app
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
sudo docker run -d \
|
|
154
|
+
--name PyAutomation \
|
|
155
|
+
-p ${PORT}:${PORT}\
|
|
156
|
+
-v $(pwd)/temp/db:/app/db \
|
|
157
|
+
-v $(pwd)/temp/logs:/app/logs \
|
|
158
|
+
-e PORT=${PORT} \
|
|
159
|
+
knowai/automation:1.0.0
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Docker Compose
|
|
163
|
+
|
|
164
|
+
If you want to deploy it using docker compose, make the following `docker-compose.yml` file:
|
|
165
|
+
|
|
166
|
+
```YaMl
|
|
167
|
+
version: '3.3'
|
|
168
|
+
|
|
169
|
+
services:
|
|
170
|
+
|
|
171
|
+
automation:
|
|
172
|
+
container_name: "PyAutomation"
|
|
173
|
+
image: "knowai/automation:1.0.0"
|
|
174
|
+
restart: always
|
|
175
|
+
ports:
|
|
176
|
+
- ${PORT}:${PORT}
|
|
177
|
+
volumes:
|
|
178
|
+
- ./temp/db:/app/db
|
|
179
|
+
- ./temp/logs:/app/logs
|
|
180
|
+
environment:
|
|
181
|
+
PORT: ${PORT}
|
|
182
|
+
OPCUA_SERVER_PORT: ${OPCUA_SERVER_PORT}
|
|
183
|
+
healthcheck:
|
|
184
|
+
test: ["CMD-SHELL", "curl --fail -s -k http://0.0.0.0:${PORT}/api/healthcheck/ || curl --fail -s -k https://0.0.0.0:${PORT}/api/healthcheck/ || exit 1"]
|
|
185
|
+
interval: 15s
|
|
186
|
+
timeout: 10s
|
|
187
|
+
retries: 3
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Start the docker compose file
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
sudo docker-compose --env-file .env up -d
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
Go to http://host:${PORT} to view the config page
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: PyAutomationIO
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A python library to develop automation continuous tasks using sync or async concurrent threads
|
|
5
|
+
Home-page: https://github.com/know-ai/PyAutomation
|
|
6
|
+
Author: KnowAI
|
|
7
|
+
Author-email: dev.know.ai@gmail.com
|
|
8
|
+
License: GNU AFFERO GENERAL PUBLIC LICENSE
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
17
|
+
Classifier: Topic :: System :: Logging
|
|
18
|
+
Classifier: Topic :: System :: Monitoring
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: python-statemachine==2.4.0
|
|
22
|
+
Requires-Dist: python-statemachine[diagrams]
|
|
23
|
+
Requires-Dist: peewee==3.17.8
|
|
24
|
+
Requires-Dist: psycopg2-binary==2.9.9; sys_platform != "win32"
|
|
25
|
+
Requires-Dist: psycopg2==2.9.9; sys_platform == "win32"
|
|
26
|
+
Requires-Dist: numpy==1.25.0
|
|
27
|
+
Requires-Dist: PyWavelets==1.7.0
|
|
28
|
+
Requires-Dist: dash==2.18.2
|
|
29
|
+
Requires-Dist: dash-bootstrap-components==1.6.0
|
|
30
|
+
Requires-Dist: dash-mantine-components==0.14.7
|
|
31
|
+
Requires-Dist: dash-iconify==0.1.2
|
|
32
|
+
Requires-Dist: opcua==0.98.13
|
|
33
|
+
Requires-Dist: python-dotenv==1.0.1
|
|
34
|
+
Requires-Dist: cryptography==43.0.3
|
|
35
|
+
Requires-Dist: Flask-Cors==5.0.0
|
|
36
|
+
Requires-Dist: flask-restx==1.3.0
|
|
37
|
+
Requires-Dist: Flask-SocketIO==5.4.1
|
|
38
|
+
Requires-Dist: gunicorn==23.0.0
|
|
39
|
+
Requires-Dist: websocket-client==1.8.0
|
|
40
|
+
Requires-Dist: gevent-websocket==0.10.1
|
|
41
|
+
Requires-Dist: PyJWT==2.9.0
|
|
42
|
+
Requires-Dist: pydot==3.0.2
|
|
43
|
+
Dynamic: author
|
|
44
|
+
Dynamic: author-email
|
|
45
|
+
Dynamic: classifier
|
|
46
|
+
Dynamic: description
|
|
47
|
+
Dynamic: description-content-type
|
|
48
|
+
Dynamic: home-page
|
|
49
|
+
Dynamic: license
|
|
50
|
+
Dynamic: license-file
|
|
51
|
+
Dynamic: requires-dist
|
|
52
|
+
Dynamic: summary
|
|
53
|
+
|
|
54
|
+
# PyAutomation
|
|
55
|
+
|
|
56
|
+
The development intention of this framework is to provide the ability to develop industrial applications where processes need to be executed concurrently and field data need to be managed for monitoring, control, and supervision applications.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
In the image above, you can generally see the architecture and interaction of the different modules that make up the framework.
|
|
63
|
+
|
|
64
|
+
For this, state machines are available that run in the background and concurrently to acquire data by query (DAQ), Acquire Data by Exception (DAS) and any other general purpose state machine.
|
|
65
|
+
|
|
66
|
+
It has a memory persistence module for real-time variables that we call (CVT, Current Value Table).
|
|
67
|
+
|
|
68
|
+
There is also an alarm management system
|
|
69
|
+
|
|
70
|
+
And finally, the disk persistence of the variables to provide functionalities for historical trends of the field variables.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# Run Config Page
|
|
74
|
+
|
|
75
|
+
## Crearte Virtual Environment
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
python3 -m venv venv
|
|
79
|
+
. venv/bin/activate
|
|
80
|
+
```
|
|
81
|
+
## Install Dependencies
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
pip install --upgrade pip
|
|
85
|
+
pip install -r requirements.txt
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Run Config page
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
python run.py
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
or
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
|
|
98
|
+
./docker-entrypoint.sh
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Deploy documentation on Development mode With mkautodoc
|
|
102
|
+
|
|
103
|
+
### Install Wheel
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
pip install wheel
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Create PyAutomation's package
|
|
110
|
+
|
|
111
|
+
Execute this code where is setup.py file
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
python3 setup.py bdist_wheel
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
This create some folders
|
|
118
|
+
|
|
119
|
+
- build
|
|
120
|
+
- dist
|
|
121
|
+
- PyAutomation.egg-info
|
|
122
|
+
|
|
123
|
+
### Install PyAutomation Folder
|
|
124
|
+
|
|
125
|
+
Located into "dist" folder
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
pip install dist/PyAutomation-1.0.0-py3-none-any.whl
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
After that, you can run mkdocs serve
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
# Deploy
|
|
135
|
+
|
|
136
|
+
Make the following `.env` file:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
PORT=5000
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Docker
|
|
143
|
+
|
|
144
|
+
Export environment variables
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
export $(grep -v '^#' .env | xargs)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Start the app
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
sudo docker run -d \
|
|
154
|
+
--name PyAutomation \
|
|
155
|
+
-p ${PORT}:${PORT}\
|
|
156
|
+
-v $(pwd)/temp/db:/app/db \
|
|
157
|
+
-v $(pwd)/temp/logs:/app/logs \
|
|
158
|
+
-e PORT=${PORT} \
|
|
159
|
+
knowai/automation:1.0.0
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Docker Compose
|
|
163
|
+
|
|
164
|
+
If you want to deploy it using docker compose, make the following `docker-compose.yml` file:
|
|
165
|
+
|
|
166
|
+
```YaMl
|
|
167
|
+
version: '3.3'
|
|
168
|
+
|
|
169
|
+
services:
|
|
170
|
+
|
|
171
|
+
automation:
|
|
172
|
+
container_name: "PyAutomation"
|
|
173
|
+
image: "knowai/automation:1.0.0"
|
|
174
|
+
restart: always
|
|
175
|
+
ports:
|
|
176
|
+
- ${PORT}:${PORT}
|
|
177
|
+
volumes:
|
|
178
|
+
- ./temp/db:/app/db
|
|
179
|
+
- ./temp/logs:/app/logs
|
|
180
|
+
environment:
|
|
181
|
+
PORT: ${PORT}
|
|
182
|
+
OPCUA_SERVER_PORT: ${OPCUA_SERVER_PORT}
|
|
183
|
+
healthcheck:
|
|
184
|
+
test: ["CMD-SHELL", "curl --fail -s -k http://0.0.0.0:${PORT}/api/healthcheck/ || curl --fail -s -k https://0.0.0.0:${PORT}/api/healthcheck/ || exit 1"]
|
|
185
|
+
interval: 15s
|
|
186
|
+
timeout: 10s
|
|
187
|
+
retries: 3
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Start the docker compose file
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
sudo docker-compose --env-file .env up -d
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
Go to http://host:${PORT} to view the config page
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.md
|
|
4
|
+
requirements.txt
|
|
5
|
+
setup.py
|
|
6
|
+
PyAutomationIO.egg-info/PKG-INFO
|
|
7
|
+
PyAutomationIO.egg-info/SOURCES.txt
|
|
8
|
+
PyAutomationIO.egg-info/dependency_links.txt
|
|
9
|
+
PyAutomationIO.egg-info/requires.txt
|
|
10
|
+
PyAutomationIO.egg-info/top_level.txt
|
|
11
|
+
automation/__init__.py
|
|
12
|
+
automation/buffer.py
|
|
13
|
+
automation/core.py
|
|
14
|
+
automation/models.py
|
|
15
|
+
automation/singleton.py
|
|
16
|
+
automation/state_machine.py
|
|
17
|
+
automation/alarms/__init__.py
|
|
18
|
+
automation/alarms/states.py
|
|
19
|
+
automation/alarms/trigger.py
|
|
20
|
+
automation/dbmodels/__init__.py
|
|
21
|
+
automation/dbmodels/alarms.py
|
|
22
|
+
automation/dbmodels/core.py
|
|
23
|
+
automation/dbmodels/events.py
|
|
24
|
+
automation/dbmodels/logs.py
|
|
25
|
+
automation/dbmodels/machines.py
|
|
26
|
+
automation/dbmodels/opcua.py
|
|
27
|
+
automation/dbmodels/opcua_server.py
|
|
28
|
+
automation/dbmodels/tags.py
|
|
29
|
+
automation/dbmodels/users.py
|
|
30
|
+
automation/extensions/__init__.py
|
|
31
|
+
automation/extensions/api.py
|
|
32
|
+
automation/extensions/cors.py
|
|
33
|
+
automation/filter/__init__.py
|
|
34
|
+
automation/iad/__init__.py
|
|
35
|
+
automation/iad/frozen_data.py
|
|
36
|
+
automation/iad/out_of_range.py
|
|
37
|
+
automation/iad/outliers.py
|
|
38
|
+
automation/logger/__init__.py
|
|
39
|
+
automation/logger/alarms.py
|
|
40
|
+
automation/logger/core.py
|
|
41
|
+
automation/logger/datalogger.py
|
|
42
|
+
automation/logger/events.py
|
|
43
|
+
automation/logger/logdict.py
|
|
44
|
+
automation/logger/logs.py
|
|
45
|
+
automation/logger/machines.py
|
|
46
|
+
automation/logger/opcua_server.py
|
|
47
|
+
automation/logger/users.py
|
|
48
|
+
automation/managers/__init__.py
|
|
49
|
+
automation/managers/alarms.py
|
|
50
|
+
automation/managers/db.py
|
|
51
|
+
automation/managers/opcua_client.py
|
|
52
|
+
automation/managers/state_machine.py
|
|
53
|
+
automation/modules/__init__.py
|
|
54
|
+
automation/modules/alarms/__init__.py
|
|
55
|
+
automation/modules/alarms/resources/__init__.py
|
|
56
|
+
automation/modules/alarms/resources/alarms.py
|
|
57
|
+
automation/modules/alarms/resources/summary.py
|
|
58
|
+
automation/modules/events/__init__.py
|
|
59
|
+
automation/modules/events/resources/__init__.py
|
|
60
|
+
automation/modules/events/resources/events.py
|
|
61
|
+
automation/modules/events/resources/logs.py
|
|
62
|
+
automation/modules/tags/__init__.py
|
|
63
|
+
automation/modules/tags/resources/__init__.py
|
|
64
|
+
automation/modules/tags/resources/tags.py
|
|
65
|
+
automation/modules/users/__init__.py
|
|
66
|
+
automation/modules/users/roles.py
|
|
67
|
+
automation/modules/users/users.py
|
|
68
|
+
automation/modules/users/resources/__init__.py
|
|
69
|
+
automation/modules/users/resources/roles.py
|
|
70
|
+
automation/modules/users/resources/users.py
|
|
71
|
+
automation/modules/users/resources/models/__init__.py
|
|
72
|
+
automation/modules/users/resources/models/roles.py
|
|
73
|
+
automation/modules/users/resources/models/users.py
|
|
74
|
+
automation/opcua/__init__.py
|
|
75
|
+
automation/opcua/models.py
|
|
76
|
+
automation/opcua/subscription.py
|
|
77
|
+
automation/pages/__init__.py
|
|
78
|
+
automation/pages/alarms.py
|
|
79
|
+
automation/pages/alarms_history.py
|
|
80
|
+
automation/pages/communications.py
|
|
81
|
+
automation/pages/database.py
|
|
82
|
+
automation/pages/filter.py
|
|
83
|
+
automation/pages/machines.py
|
|
84
|
+
automation/pages/machines_detailed.py
|
|
85
|
+
automation/pages/main.py
|
|
86
|
+
automation/pages/opcua_server.py
|
|
87
|
+
automation/pages/tags.py
|
|
88
|
+
automation/pages/trends.py
|
|
89
|
+
automation/pages/assets/styles.css
|
|
90
|
+
automation/pages/callbacks/__init__.py
|
|
91
|
+
automation/pages/callbacks/alarms.py
|
|
92
|
+
automation/pages/callbacks/alarms_summary.py
|
|
93
|
+
automation/pages/callbacks/db.py
|
|
94
|
+
automation/pages/callbacks/filter.py
|
|
95
|
+
automation/pages/callbacks/machines.py
|
|
96
|
+
automation/pages/callbacks/machines_detailed.py
|
|
97
|
+
automation/pages/callbacks/opcua.py
|
|
98
|
+
automation/pages/callbacks/opcua_server.py
|
|
99
|
+
automation/pages/callbacks/tags.py
|
|
100
|
+
automation/pages/callbacks/trends.py
|
|
101
|
+
automation/pages/components/__init__.py
|
|
102
|
+
automation/pages/components/alarms.py
|
|
103
|
+
automation/pages/components/alarms_summary.py
|
|
104
|
+
automation/pages/components/database.py
|
|
105
|
+
automation/pages/components/gaussian_filter.py
|
|
106
|
+
automation/pages/components/machines.py
|
|
107
|
+
automation/pages/components/opcua.py
|
|
108
|
+
automation/pages/components/opcua_server.py
|
|
109
|
+
automation/pages/components/tags.py
|
|
110
|
+
automation/pages/components/trends.py
|
|
111
|
+
automation/tags/__init__.py
|
|
112
|
+
automation/tags/cvt.py
|
|
113
|
+
automation/tags/filter.py
|
|
114
|
+
automation/tags/tag.py
|
|
115
|
+
automation/tests/__init__.py
|
|
116
|
+
automation/tests/test_alarms.py
|
|
117
|
+
automation/tests/test_core.py
|
|
118
|
+
automation/tests/test_unit.py
|
|
119
|
+
automation/tests/test_user.py
|
|
120
|
+
automation/utils/__init__.py
|
|
121
|
+
automation/utils/decorators.py
|
|
122
|
+
automation/utils/npw.py
|
|
123
|
+
automation/utils/observer.py
|
|
124
|
+
automation/utils/units.py
|
|
125
|
+
automation/variables/__init__.py
|
|
126
|
+
automation/variables/adimentional.py
|
|
127
|
+
automation/variables/current.py
|
|
128
|
+
automation/variables/density.py
|
|
129
|
+
automation/variables/eng_time.py
|
|
130
|
+
automation/variables/force.py
|
|
131
|
+
automation/variables/length.py
|
|
132
|
+
automation/variables/mass.py
|
|
133
|
+
automation/variables/mass_flow.py
|
|
134
|
+
automation/variables/percentage.py
|
|
135
|
+
automation/variables/power.py
|
|
136
|
+
automation/variables/pressure.py
|
|
137
|
+
automation/variables/temperature.py
|
|
138
|
+
automation/variables/volume.py
|
|
139
|
+
automation/variables/volumetric_flow.py
|
|
140
|
+
automation/workers/__init__.py
|
|
141
|
+
automation/workers/logger.py
|
|
142
|
+
automation/workers/state_machine.py
|
|
143
|
+
automation/workers/worker.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
python-statemachine==2.4.0
|
|
2
|
+
python-statemachine[diagrams]
|
|
3
|
+
peewee==3.17.8
|
|
4
|
+
numpy==1.25.0
|
|
5
|
+
PyWavelets==1.7.0
|
|
6
|
+
dash==2.18.2
|
|
7
|
+
dash-bootstrap-components==1.6.0
|
|
8
|
+
dash-mantine-components==0.14.7
|
|
9
|
+
dash-iconify==0.1.2
|
|
10
|
+
opcua==0.98.13
|
|
11
|
+
python-dotenv==1.0.1
|
|
12
|
+
cryptography==43.0.3
|
|
13
|
+
Flask-Cors==5.0.0
|
|
14
|
+
flask-restx==1.3.0
|
|
15
|
+
Flask-SocketIO==5.4.1
|
|
16
|
+
gunicorn==23.0.0
|
|
17
|
+
websocket-client==1.8.0
|
|
18
|
+
gevent-websocket==0.10.1
|
|
19
|
+
PyJWT==2.9.0
|
|
20
|
+
pydot==3.0.2
|
|
21
|
+
|
|
22
|
+
[:sys_platform != "win32"]
|
|
23
|
+
psycopg2-binary==2.9.9
|
|
24
|
+
|
|
25
|
+
[:sys_platform == "win32"]
|
|
26
|
+
psycopg2==2.9.9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
automation
|