PyAutomationIO 1.0.3__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.
Files changed (146) hide show
  1. pyautomationio-1.0.3/LICENSE +21 -0
  2. pyautomationio-1.0.3/MANIFEST.in +5 -0
  3. pyautomationio-1.0.3/PKG-INFO +199 -0
  4. pyautomationio-1.0.3/PyAutomationIO.egg-info/PKG-INFO +199 -0
  5. pyautomationio-1.0.3/PyAutomationIO.egg-info/SOURCES.txt +144 -0
  6. pyautomationio-1.0.3/PyAutomationIO.egg-info/dependency_links.txt +1 -0
  7. pyautomationio-1.0.3/PyAutomationIO.egg-info/requires.txt +26 -0
  8. pyautomationio-1.0.3/PyAutomationIO.egg-info/top_level.txt +1 -0
  9. pyautomationio-1.0.3/README.md +146 -0
  10. pyautomationio-1.0.3/automation/__init__.py +46 -0
  11. pyautomationio-1.0.3/automation/alarms/__init__.py +563 -0
  12. pyautomationio-1.0.3/automation/alarms/states.py +192 -0
  13. pyautomationio-1.0.3/automation/alarms/trigger.py +64 -0
  14. pyautomationio-1.0.3/automation/buffer.py +132 -0
  15. pyautomationio-1.0.3/automation/core.py +1777 -0
  16. pyautomationio-1.0.3/automation/dbmodels/__init__.py +23 -0
  17. pyautomationio-1.0.3/automation/dbmodels/alarms.py +524 -0
  18. pyautomationio-1.0.3/automation/dbmodels/core.py +86 -0
  19. pyautomationio-1.0.3/automation/dbmodels/events.py +153 -0
  20. pyautomationio-1.0.3/automation/dbmodels/logs.py +155 -0
  21. pyautomationio-1.0.3/automation/dbmodels/machines.py +181 -0
  22. pyautomationio-1.0.3/automation/dbmodels/opcua.py +81 -0
  23. pyautomationio-1.0.3/automation/dbmodels/opcua_server.py +174 -0
  24. pyautomationio-1.0.3/automation/dbmodels/tags.py +921 -0
  25. pyautomationio-1.0.3/automation/dbmodels/users.py +259 -0
  26. pyautomationio-1.0.3/automation/extensions/__init__.py +15 -0
  27. pyautomationio-1.0.3/automation/extensions/api.py +149 -0
  28. pyautomationio-1.0.3/automation/extensions/cors.py +18 -0
  29. pyautomationio-1.0.3/automation/filter/__init__.py +19 -0
  30. pyautomationio-1.0.3/automation/iad/__init__.py +3 -0
  31. pyautomationio-1.0.3/automation/iad/frozen_data.py +54 -0
  32. pyautomationio-1.0.3/automation/iad/out_of_range.py +51 -0
  33. pyautomationio-1.0.3/automation/iad/outliers.py +51 -0
  34. pyautomationio-1.0.3/automation/logger/__init__.py +0 -0
  35. pyautomationio-1.0.3/automation/logger/alarms.py +426 -0
  36. pyautomationio-1.0.3/automation/logger/core.py +265 -0
  37. pyautomationio-1.0.3/automation/logger/datalogger.py +646 -0
  38. pyautomationio-1.0.3/automation/logger/events.py +194 -0
  39. pyautomationio-1.0.3/automation/logger/logdict.py +53 -0
  40. pyautomationio-1.0.3/automation/logger/logs.py +203 -0
  41. pyautomationio-1.0.3/automation/logger/machines.py +248 -0
  42. pyautomationio-1.0.3/automation/logger/opcua_server.py +130 -0
  43. pyautomationio-1.0.3/automation/logger/users.py +96 -0
  44. pyautomationio-1.0.3/automation/managers/__init__.py +4 -0
  45. pyautomationio-1.0.3/automation/managers/alarms.py +455 -0
  46. pyautomationio-1.0.3/automation/managers/db.py +328 -0
  47. pyautomationio-1.0.3/automation/managers/opcua_client.py +186 -0
  48. pyautomationio-1.0.3/automation/managers/state_machine.py +183 -0
  49. pyautomationio-1.0.3/automation/models.py +174 -0
  50. pyautomationio-1.0.3/automation/modules/__init__.py +14 -0
  51. pyautomationio-1.0.3/automation/modules/alarms/__init__.py +0 -0
  52. pyautomationio-1.0.3/automation/modules/alarms/resources/__init__.py +10 -0
  53. pyautomationio-1.0.3/automation/modules/alarms/resources/alarms.py +280 -0
  54. pyautomationio-1.0.3/automation/modules/alarms/resources/summary.py +79 -0
  55. pyautomationio-1.0.3/automation/modules/events/__init__.py +0 -0
  56. pyautomationio-1.0.3/automation/modules/events/resources/__init__.py +10 -0
  57. pyautomationio-1.0.3/automation/modules/events/resources/events.py +83 -0
  58. pyautomationio-1.0.3/automation/modules/events/resources/logs.py +109 -0
  59. pyautomationio-1.0.3/automation/modules/tags/__init__.py +0 -0
  60. pyautomationio-1.0.3/automation/modules/tags/resources/__init__.py +8 -0
  61. pyautomationio-1.0.3/automation/modules/tags/resources/tags.py +201 -0
  62. pyautomationio-1.0.3/automation/modules/users/__init__.py +2 -0
  63. pyautomationio-1.0.3/automation/modules/users/resources/__init__.py +10 -0
  64. pyautomationio-1.0.3/automation/modules/users/resources/models/__init__.py +2 -0
  65. pyautomationio-1.0.3/automation/modules/users/resources/models/roles.py +5 -0
  66. pyautomationio-1.0.3/automation/modules/users/resources/models/users.py +14 -0
  67. pyautomationio-1.0.3/automation/modules/users/resources/roles.py +38 -0
  68. pyautomationio-1.0.3/automation/modules/users/resources/users.py +113 -0
  69. pyautomationio-1.0.3/automation/modules/users/roles.py +121 -0
  70. pyautomationio-1.0.3/automation/modules/users/users.py +335 -0
  71. pyautomationio-1.0.3/automation/opcua/__init__.py +1 -0
  72. pyautomationio-1.0.3/automation/opcua/models.py +541 -0
  73. pyautomationio-1.0.3/automation/opcua/subscription.py +259 -0
  74. pyautomationio-1.0.3/automation/pages/__init__.py +0 -0
  75. pyautomationio-1.0.3/automation/pages/alarms.py +34 -0
  76. pyautomationio-1.0.3/automation/pages/alarms_history.py +21 -0
  77. pyautomationio-1.0.3/automation/pages/assets/styles.css +7 -0
  78. pyautomationio-1.0.3/automation/pages/callbacks/__init__.py +28 -0
  79. pyautomationio-1.0.3/automation/pages/callbacks/alarms.py +218 -0
  80. pyautomationio-1.0.3/automation/pages/callbacks/alarms_summary.py +20 -0
  81. pyautomationio-1.0.3/automation/pages/callbacks/db.py +222 -0
  82. pyautomationio-1.0.3/automation/pages/callbacks/filter.py +238 -0
  83. pyautomationio-1.0.3/automation/pages/callbacks/machines.py +29 -0
  84. pyautomationio-1.0.3/automation/pages/callbacks/machines_detailed.py +581 -0
  85. pyautomationio-1.0.3/automation/pages/callbacks/opcua.py +266 -0
  86. pyautomationio-1.0.3/automation/pages/callbacks/opcua_server.py +244 -0
  87. pyautomationio-1.0.3/automation/pages/callbacks/tags.py +495 -0
  88. pyautomationio-1.0.3/automation/pages/callbacks/trends.py +119 -0
  89. pyautomationio-1.0.3/automation/pages/communications.py +129 -0
  90. pyautomationio-1.0.3/automation/pages/components/__init__.py +123 -0
  91. pyautomationio-1.0.3/automation/pages/components/alarms.py +151 -0
  92. pyautomationio-1.0.3/automation/pages/components/alarms_summary.py +45 -0
  93. pyautomationio-1.0.3/automation/pages/components/database.py +128 -0
  94. pyautomationio-1.0.3/automation/pages/components/gaussian_filter.py +69 -0
  95. pyautomationio-1.0.3/automation/pages/components/machines.py +396 -0
  96. pyautomationio-1.0.3/automation/pages/components/opcua.py +384 -0
  97. pyautomationio-1.0.3/automation/pages/components/opcua_server.py +53 -0
  98. pyautomationio-1.0.3/automation/pages/components/tags.py +253 -0
  99. pyautomationio-1.0.3/automation/pages/components/trends.py +66 -0
  100. pyautomationio-1.0.3/automation/pages/database.py +26 -0
  101. pyautomationio-1.0.3/automation/pages/filter.py +55 -0
  102. pyautomationio-1.0.3/automation/pages/machines.py +20 -0
  103. pyautomationio-1.0.3/automation/pages/machines_detailed.py +41 -0
  104. pyautomationio-1.0.3/automation/pages/main.py +63 -0
  105. pyautomationio-1.0.3/automation/pages/opcua_server.py +28 -0
  106. pyautomationio-1.0.3/automation/pages/tags.py +40 -0
  107. pyautomationio-1.0.3/automation/pages/trends.py +35 -0
  108. pyautomationio-1.0.3/automation/singleton.py +30 -0
  109. pyautomationio-1.0.3/automation/state_machine.py +1672 -0
  110. pyautomationio-1.0.3/automation/tags/__init__.py +2 -0
  111. pyautomationio-1.0.3/automation/tags/cvt.py +1198 -0
  112. pyautomationio-1.0.3/automation/tags/filter.py +55 -0
  113. pyautomationio-1.0.3/automation/tags/tag.py +418 -0
  114. pyautomationio-1.0.3/automation/tests/__init__.py +10 -0
  115. pyautomationio-1.0.3/automation/tests/test_alarms.py +110 -0
  116. pyautomationio-1.0.3/automation/tests/test_core.py +257 -0
  117. pyautomationio-1.0.3/automation/tests/test_unit.py +21 -0
  118. pyautomationio-1.0.3/automation/tests/test_user.py +155 -0
  119. pyautomationio-1.0.3/automation/utils/__init__.py +164 -0
  120. pyautomationio-1.0.3/automation/utils/decorators.py +222 -0
  121. pyautomationio-1.0.3/automation/utils/npw.py +294 -0
  122. pyautomationio-1.0.3/automation/utils/observer.py +21 -0
  123. pyautomationio-1.0.3/automation/utils/units.py +118 -0
  124. pyautomationio-1.0.3/automation/variables/__init__.py +55 -0
  125. pyautomationio-1.0.3/automation/variables/adimentional.py +30 -0
  126. pyautomationio-1.0.3/automation/variables/current.py +71 -0
  127. pyautomationio-1.0.3/automation/variables/density.py +115 -0
  128. pyautomationio-1.0.3/automation/variables/eng_time.py +68 -0
  129. pyautomationio-1.0.3/automation/variables/force.py +90 -0
  130. pyautomationio-1.0.3/automation/variables/length.py +104 -0
  131. pyautomationio-1.0.3/automation/variables/mass.py +80 -0
  132. pyautomationio-1.0.3/automation/variables/mass_flow.py +101 -0
  133. pyautomationio-1.0.3/automation/variables/percentage.py +30 -0
  134. pyautomationio-1.0.3/automation/variables/power.py +113 -0
  135. pyautomationio-1.0.3/automation/variables/pressure.py +93 -0
  136. pyautomationio-1.0.3/automation/variables/temperature.py +168 -0
  137. pyautomationio-1.0.3/automation/variables/volume.py +70 -0
  138. pyautomationio-1.0.3/automation/variables/volumetric_flow.py +100 -0
  139. pyautomationio-1.0.3/automation/workers/__init__.py +2 -0
  140. pyautomationio-1.0.3/automation/workers/logger.py +164 -0
  141. pyautomationio-1.0.3/automation/workers/state_machine.py +207 -0
  142. pyautomationio-1.0.3/automation/workers/worker.py +36 -0
  143. pyautomationio-1.0.3/requirements.txt +23 -0
  144. pyautomationio-1.0.3/setup.cfg +4 -0
  145. pyautomationio-1.0.3/setup.py +47 -0
  146. pyautomationio-1.0.3/version.py +2 -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,5 @@
1
+ include automation/pages/assets/*
2
+ include requirements.txt
3
+ include version.py
4
+ include README.md
5
+ include LICENSE
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyAutomationIO
3
+ Version: 1.0.3
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
+ ![Core](docs/img/PyAutomationCore.svg)
59
+
60
+ In the image above, you can generally see the architecture and interaction of the different modules that make up the framework.
61
+
62
+ 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.
63
+
64
+ It has a memory persistence module for real-time variables that we call (CVT, Current Value Table).
65
+
66
+ There is also an alarm management system
67
+
68
+ And finally, the disk persistence of the variables to provide functionalities for historical trends of the field variables.
69
+
70
+ # Run Config Page
71
+
72
+ ## Crearte Virtual Environment
73
+
74
+ ```python
75
+ python3 -m venv venv
76
+ . venv/bin/activate
77
+ ```
78
+
79
+ ## Install Dependencies
80
+
81
+ ```python
82
+ pip install --upgrade pip
83
+ pip install -r requirements.txt
84
+ ```
85
+
86
+ ## Run Config page
87
+
88
+ ```python
89
+ python run.py
90
+ ```
91
+
92
+ or
93
+
94
+ ```python
95
+
96
+ ./docker-entrypoint.sh
97
+ ```
98
+
99
+ ## Deploy documentation on Development mode With mkautodoc
100
+
101
+ ### Install Wheel
102
+
103
+ ```python
104
+ pip install wheel
105
+ ```
106
+
107
+ ### Create PyAutomation's package
108
+
109
+ Execute this code where is setup.py file
110
+
111
+ ```python
112
+ python3 setup.py bdist_wheel
113
+ ```
114
+
115
+ This create some folders
116
+
117
+ - build
118
+ - dist
119
+ - PyAutomation.egg-info
120
+
121
+ ### Install PyAutomation Folder
122
+
123
+ Located into "dist" folder
124
+
125
+ ```python
126
+ pip install dist/PyAutomation-1.0.0-py3-none-any.whl
127
+ ```
128
+
129
+ After that, you can run mkdocs serve
130
+
131
+ # Deploy
132
+
133
+ Make the following `.env` file:
134
+
135
+ ```
136
+ PORT=5000
137
+ ```
138
+
139
+ ## Docker
140
+
141
+ Export environment variables
142
+
143
+ ```
144
+ export $(grep -v '^#' .env | xargs)
145
+ ```
146
+
147
+ Start the app
148
+
149
+ ```
150
+ sudo docker run -d \
151
+ --name PyAutomation \
152
+ -p ${PORT}:${PORT}\
153
+ -v $(pwd)/temp/db:/app/db \
154
+ -v $(pwd)/temp/logs:/app/logs \
155
+ -e PORT=${PORT} \
156
+ knowai/automation:1.0.0
157
+ ```
158
+
159
+ ## Docker Compose
160
+
161
+ If you want to deploy it using docker compose, make the following `docker-compose.yml` file:
162
+
163
+ ```YaMl
164
+ services:
165
+
166
+ automation:
167
+ container_name: "Automation"
168
+ image: "knowai/automation:${AUTOMATION_VERSION}"
169
+ restart: always
170
+ ports:
171
+ - ${AUTOMATION_PORT}:${AUTOMATION_PORT}
172
+ volumes:
173
+ - automation/db:/app/db
174
+ - automation/logs:/app/logs
175
+ environment:
176
+ - OPCUA_SERVER_PORT: ${AUTOMATION_OPCUA_SERVER_PORT}
177
+ logging:
178
+ driver: "json-file"
179
+ options:
180
+ max-size: "10m"
181
+ max-file: "3"
182
+ healthcheck:
183
+ 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"]
184
+ interval: 15s
185
+ timeout: 10s
186
+ retries: 3
187
+
188
+ volumes:
189
+ automation/db:
190
+ automation/logs:
191
+ ```
192
+
193
+ Start the docker compose file
194
+
195
+ ```
196
+ sudo docker-compose --env-file .env up -d
197
+ ```
198
+
199
+ Go to http://host:${PORT} to view the config page
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyAutomationIO
3
+ Version: 1.0.3
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
+ ![Core](docs/img/PyAutomationCore.svg)
59
+
60
+ In the image above, you can generally see the architecture and interaction of the different modules that make up the framework.
61
+
62
+ 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.
63
+
64
+ It has a memory persistence module for real-time variables that we call (CVT, Current Value Table).
65
+
66
+ There is also an alarm management system
67
+
68
+ And finally, the disk persistence of the variables to provide functionalities for historical trends of the field variables.
69
+
70
+ # Run Config Page
71
+
72
+ ## Crearte Virtual Environment
73
+
74
+ ```python
75
+ python3 -m venv venv
76
+ . venv/bin/activate
77
+ ```
78
+
79
+ ## Install Dependencies
80
+
81
+ ```python
82
+ pip install --upgrade pip
83
+ pip install -r requirements.txt
84
+ ```
85
+
86
+ ## Run Config page
87
+
88
+ ```python
89
+ python run.py
90
+ ```
91
+
92
+ or
93
+
94
+ ```python
95
+
96
+ ./docker-entrypoint.sh
97
+ ```
98
+
99
+ ## Deploy documentation on Development mode With mkautodoc
100
+
101
+ ### Install Wheel
102
+
103
+ ```python
104
+ pip install wheel
105
+ ```
106
+
107
+ ### Create PyAutomation's package
108
+
109
+ Execute this code where is setup.py file
110
+
111
+ ```python
112
+ python3 setup.py bdist_wheel
113
+ ```
114
+
115
+ This create some folders
116
+
117
+ - build
118
+ - dist
119
+ - PyAutomation.egg-info
120
+
121
+ ### Install PyAutomation Folder
122
+
123
+ Located into "dist" folder
124
+
125
+ ```python
126
+ pip install dist/PyAutomation-1.0.0-py3-none-any.whl
127
+ ```
128
+
129
+ After that, you can run mkdocs serve
130
+
131
+ # Deploy
132
+
133
+ Make the following `.env` file:
134
+
135
+ ```
136
+ PORT=5000
137
+ ```
138
+
139
+ ## Docker
140
+
141
+ Export environment variables
142
+
143
+ ```
144
+ export $(grep -v '^#' .env | xargs)
145
+ ```
146
+
147
+ Start the app
148
+
149
+ ```
150
+ sudo docker run -d \
151
+ --name PyAutomation \
152
+ -p ${PORT}:${PORT}\
153
+ -v $(pwd)/temp/db:/app/db \
154
+ -v $(pwd)/temp/logs:/app/logs \
155
+ -e PORT=${PORT} \
156
+ knowai/automation:1.0.0
157
+ ```
158
+
159
+ ## Docker Compose
160
+
161
+ If you want to deploy it using docker compose, make the following `docker-compose.yml` file:
162
+
163
+ ```YaMl
164
+ services:
165
+
166
+ automation:
167
+ container_name: "Automation"
168
+ image: "knowai/automation:${AUTOMATION_VERSION}"
169
+ restart: always
170
+ ports:
171
+ - ${AUTOMATION_PORT}:${AUTOMATION_PORT}
172
+ volumes:
173
+ - automation/db:/app/db
174
+ - automation/logs:/app/logs
175
+ environment:
176
+ - OPCUA_SERVER_PORT: ${AUTOMATION_OPCUA_SERVER_PORT}
177
+ logging:
178
+ driver: "json-file"
179
+ options:
180
+ max-size: "10m"
181
+ max-file: "3"
182
+ healthcheck:
183
+ 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"]
184
+ interval: 15s
185
+ timeout: 10s
186
+ retries: 3
187
+
188
+ volumes:
189
+ automation/db:
190
+ automation/logs:
191
+ ```
192
+
193
+ Start the docker compose file
194
+
195
+ ```
196
+ sudo docker-compose --env-file .env up -d
197
+ ```
198
+
199
+ Go to http://host:${PORT} to view the config page
@@ -0,0 +1,144 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ requirements.txt
5
+ setup.py
6
+ version.py
7
+ PyAutomationIO.egg-info/PKG-INFO
8
+ PyAutomationIO.egg-info/SOURCES.txt
9
+ PyAutomationIO.egg-info/dependency_links.txt
10
+ PyAutomationIO.egg-info/requires.txt
11
+ PyAutomationIO.egg-info/top_level.txt
12
+ automation/__init__.py
13
+ automation/buffer.py
14
+ automation/core.py
15
+ automation/models.py
16
+ automation/singleton.py
17
+ automation/state_machine.py
18
+ automation/alarms/__init__.py
19
+ automation/alarms/states.py
20
+ automation/alarms/trigger.py
21
+ automation/dbmodels/__init__.py
22
+ automation/dbmodels/alarms.py
23
+ automation/dbmodels/core.py
24
+ automation/dbmodels/events.py
25
+ automation/dbmodels/logs.py
26
+ automation/dbmodels/machines.py
27
+ automation/dbmodels/opcua.py
28
+ automation/dbmodels/opcua_server.py
29
+ automation/dbmodels/tags.py
30
+ automation/dbmodels/users.py
31
+ automation/extensions/__init__.py
32
+ automation/extensions/api.py
33
+ automation/extensions/cors.py
34
+ automation/filter/__init__.py
35
+ automation/iad/__init__.py
36
+ automation/iad/frozen_data.py
37
+ automation/iad/out_of_range.py
38
+ automation/iad/outliers.py
39
+ automation/logger/__init__.py
40
+ automation/logger/alarms.py
41
+ automation/logger/core.py
42
+ automation/logger/datalogger.py
43
+ automation/logger/events.py
44
+ automation/logger/logdict.py
45
+ automation/logger/logs.py
46
+ automation/logger/machines.py
47
+ automation/logger/opcua_server.py
48
+ automation/logger/users.py
49
+ automation/managers/__init__.py
50
+ automation/managers/alarms.py
51
+ automation/managers/db.py
52
+ automation/managers/opcua_client.py
53
+ automation/managers/state_machine.py
54
+ automation/modules/__init__.py
55
+ automation/modules/alarms/__init__.py
56
+ automation/modules/alarms/resources/__init__.py
57
+ automation/modules/alarms/resources/alarms.py
58
+ automation/modules/alarms/resources/summary.py
59
+ automation/modules/events/__init__.py
60
+ automation/modules/events/resources/__init__.py
61
+ automation/modules/events/resources/events.py
62
+ automation/modules/events/resources/logs.py
63
+ automation/modules/tags/__init__.py
64
+ automation/modules/tags/resources/__init__.py
65
+ automation/modules/tags/resources/tags.py
66
+ automation/modules/users/__init__.py
67
+ automation/modules/users/roles.py
68
+ automation/modules/users/users.py
69
+ automation/modules/users/resources/__init__.py
70
+ automation/modules/users/resources/roles.py
71
+ automation/modules/users/resources/users.py
72
+ automation/modules/users/resources/models/__init__.py
73
+ automation/modules/users/resources/models/roles.py
74
+ automation/modules/users/resources/models/users.py
75
+ automation/opcua/__init__.py
76
+ automation/opcua/models.py
77
+ automation/opcua/subscription.py
78
+ automation/pages/__init__.py
79
+ automation/pages/alarms.py
80
+ automation/pages/alarms_history.py
81
+ automation/pages/communications.py
82
+ automation/pages/database.py
83
+ automation/pages/filter.py
84
+ automation/pages/machines.py
85
+ automation/pages/machines_detailed.py
86
+ automation/pages/main.py
87
+ automation/pages/opcua_server.py
88
+ automation/pages/tags.py
89
+ automation/pages/trends.py
90
+ automation/pages/assets/styles.css
91
+ automation/pages/callbacks/__init__.py
92
+ automation/pages/callbacks/alarms.py
93
+ automation/pages/callbacks/alarms_summary.py
94
+ automation/pages/callbacks/db.py
95
+ automation/pages/callbacks/filter.py
96
+ automation/pages/callbacks/machines.py
97
+ automation/pages/callbacks/machines_detailed.py
98
+ automation/pages/callbacks/opcua.py
99
+ automation/pages/callbacks/opcua_server.py
100
+ automation/pages/callbacks/tags.py
101
+ automation/pages/callbacks/trends.py
102
+ automation/pages/components/__init__.py
103
+ automation/pages/components/alarms.py
104
+ automation/pages/components/alarms_summary.py
105
+ automation/pages/components/database.py
106
+ automation/pages/components/gaussian_filter.py
107
+ automation/pages/components/machines.py
108
+ automation/pages/components/opcua.py
109
+ automation/pages/components/opcua_server.py
110
+ automation/pages/components/tags.py
111
+ automation/pages/components/trends.py
112
+ automation/tags/__init__.py
113
+ automation/tags/cvt.py
114
+ automation/tags/filter.py
115
+ automation/tags/tag.py
116
+ automation/tests/__init__.py
117
+ automation/tests/test_alarms.py
118
+ automation/tests/test_core.py
119
+ automation/tests/test_unit.py
120
+ automation/tests/test_user.py
121
+ automation/utils/__init__.py
122
+ automation/utils/decorators.py
123
+ automation/utils/npw.py
124
+ automation/utils/observer.py
125
+ automation/utils/units.py
126
+ automation/variables/__init__.py
127
+ automation/variables/adimentional.py
128
+ automation/variables/current.py
129
+ automation/variables/density.py
130
+ automation/variables/eng_time.py
131
+ automation/variables/force.py
132
+ automation/variables/length.py
133
+ automation/variables/mass.py
134
+ automation/variables/mass_flow.py
135
+ automation/variables/percentage.py
136
+ automation/variables/power.py
137
+ automation/variables/pressure.py
138
+ automation/variables/temperature.py
139
+ automation/variables/volume.py
140
+ automation/variables/volumetric_flow.py
141
+ automation/workers/__init__.py
142
+ automation/workers/logger.py
143
+ automation/workers/state_machine.py
144
+ automation/workers/worker.py
@@ -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