festo-vaem 0.1.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.
- festo_vaem-0.1.0/PKG-INFO +51 -0
- festo_vaem-0.1.0/README.md +29 -0
- festo_vaem-0.1.0/pyproject.toml +96 -0
- festo_vaem-0.1.0/src/vaem/__init__.py +11 -0
- festo_vaem-0.1.0/src/vaem/utils/__init__.py +1 -0
- festo_vaem-0.1.0/src/vaem/utils/logging.py +65 -0
- festo_vaem-0.1.0/src/vaem/vaem.py +511 -0
- festo_vaem-0.1.0/src/vaem/vaem_communication.py +1161 -0
- festo_vaem-0.1.0/src/vaem/vaem_config.py +64 -0
- festo_vaem-0.1.0/src/vaem/vaem_helper.py +116 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: festo-vaem
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Library to control Festo Lifetech VAEM 8 Channel Valve Control Device
|
|
5
|
+
Keywords: Festo,Valve,Valves,Actuation,Valve Controller,Controller
|
|
6
|
+
Author: Joshua Dang, Kyle Wardlow
|
|
7
|
+
Author-email: Joshua Dang <joshua.dang@festo.com>, Kyle Wardlow <kyle.wardlow@festo.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Requires-Dist: pymodbus<=3.11.4
|
|
14
|
+
Requires-Dist: rich>=14.0.0
|
|
15
|
+
Requires-Dist: pyserial<=3.5 ; extra == 'serial'
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Project-URL: Homepage, https://github.com/Festo-se/festo-vaem
|
|
18
|
+
Project-URL: Repository, https://github.com/Festo-se/festo-vaem.git
|
|
19
|
+
Project-URL: Issues, https://github.com/Festo-se/festo-vaem/issues
|
|
20
|
+
Provides-Extra: serial
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# VAEM
|
|
24
|
+
|
|
25
|
+
`festo-vaem` is a python package which allows for driver like capabilites and usage over Festo's 8 Channel Valve controller (VAEM) device.
|
|
26
|
+
|
|
27
|
+
Documentation can be found [here](https://festo-se.github.io/festo-vaem/).
|
|
28
|
+
|
|
29
|
+
Examples can be found [here](https://github.com/Festo-se/festo-vaem/tree/main/examples) and [here](https://festo-se.github.io/festo-vaem/examples/examples)
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
### Release (PENDING)
|
|
34
|
+
|
|
35
|
+
The lastest released version of this package can be found on the PyPi repo.
|
|
36
|
+
Install using pip:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
pip install festo-vaem
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### From git repository
|
|
43
|
+
|
|
44
|
+
The `festo-vaem` source code can also be installed directly from Github. Users can then choose to package it with pip locally if they wish
|
|
45
|
+
```
|
|
46
|
+
pip install git+https://github.com/Festo-se/festo-vaem.git
|
|
47
|
+
```
|
|
48
|
+
or using [`uv`](https://docs.astral.sh/uv/getting-started/installation/)
|
|
49
|
+
```
|
|
50
|
+
uv add "festo-vaem @ git+https://github.com/Festo-se/festo-vaem.git"
|
|
51
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# VAEM
|
|
2
|
+
|
|
3
|
+
`festo-vaem` is a python package which allows for driver like capabilites and usage over Festo's 8 Channel Valve controller (VAEM) device.
|
|
4
|
+
|
|
5
|
+
Documentation can be found [here](https://festo-se.github.io/festo-vaem/).
|
|
6
|
+
|
|
7
|
+
Examples can be found [here](https://github.com/Festo-se/festo-vaem/tree/main/examples) and [here](https://festo-se.github.io/festo-vaem/examples/examples)
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
### Release (PENDING)
|
|
12
|
+
|
|
13
|
+
The lastest released version of this package can be found on the PyPi repo.
|
|
14
|
+
Install using pip:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
pip install festo-vaem
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### From git repository
|
|
21
|
+
|
|
22
|
+
The `festo-vaem` source code can also be installed directly from Github. Users can then choose to package it with pip locally if they wish
|
|
23
|
+
```
|
|
24
|
+
pip install git+https://github.com/Festo-se/festo-vaem.git
|
|
25
|
+
```
|
|
26
|
+
or using [`uv`](https://docs.astral.sh/uv/getting-started/installation/)
|
|
27
|
+
```
|
|
28
|
+
uv add "festo-vaem @ git+https://github.com/Festo-se/festo-vaem.git"
|
|
29
|
+
```
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "festo-vaem"
|
|
3
|
+
description = "Library to control Festo Lifetech VAEM 8 Channel Valve Control Device"
|
|
4
|
+
readme = {file = "README.md", content-type = "text/markdown"}
|
|
5
|
+
authors = [
|
|
6
|
+
{name = "Joshua Dang", email = "joshua.dang@festo.com"},
|
|
7
|
+
{name = "Kyle Wardlow", email = "kyle.wardlow@festo.com"}
|
|
8
|
+
]
|
|
9
|
+
license = {text = "MIT"}
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Programming Language :: Python :: 3",
|
|
12
|
+
"Development Status :: 4 - Beta",
|
|
13
|
+
"License :: OSI Approved :: MIT License",
|
|
14
|
+
"Operating System :: OS Independent",
|
|
15
|
+
]
|
|
16
|
+
keywords = ["Festo", "Valve", "Valves", "Actuation", "Valve Controller", "Controller"]
|
|
17
|
+
version = "0.1.0"
|
|
18
|
+
requires-python = ">=3.10"
|
|
19
|
+
dependencies = [
|
|
20
|
+
"pymodbus<=3.11.4",
|
|
21
|
+
'rich>=14.0.0',
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Homepage = "https://github.com/Festo-se/festo-vaem"
|
|
26
|
+
Repository = "https://github.com/Festo-se/festo-vaem.git"
|
|
27
|
+
Issues = "https://github.com/Festo-se/festo-vaem/issues"
|
|
28
|
+
|
|
29
|
+
[project.optional-dependencies]
|
|
30
|
+
serial = [
|
|
31
|
+
"pyserial<=3.5",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[build-system]
|
|
35
|
+
requires = ["uv_build>=0.9.17,<0.10.0"]
|
|
36
|
+
build-backend = "uv_build"
|
|
37
|
+
|
|
38
|
+
[dependency-groups]
|
|
39
|
+
dev = [
|
|
40
|
+
"pyserial<=3.5",
|
|
41
|
+
"pymodbus[simulator]<=3.11.4",
|
|
42
|
+
"pytest>=9.0.1",
|
|
43
|
+
"ruff"
|
|
44
|
+
]
|
|
45
|
+
docs = [
|
|
46
|
+
"mkdocs>=1.6.1",
|
|
47
|
+
"mkdocs-autoapi>=0.4.1",
|
|
48
|
+
"mkdocs-autorefs>=1.4.2",
|
|
49
|
+
"mkdocs-include-markdown-plugin>=7.1.5",
|
|
50
|
+
"mkdocs-material>=9.6.14",
|
|
51
|
+
"mkdocstrings[python]>=0.29.1",
|
|
52
|
+
"mkdocs-codeinclude-plugin>=0.2.1",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[tool.uv]
|
|
56
|
+
cache-keys = [{ file = "pyproject.toml" }, { git = { commit = true } }]
|
|
57
|
+
|
|
58
|
+
[tool.uv.build-backend]
|
|
59
|
+
module-name = "vaem"
|
|
60
|
+
|
|
61
|
+
[tool.ruff]
|
|
62
|
+
line-length = 120
|
|
63
|
+
indent-width = 4
|
|
64
|
+
target-version = "py311"
|
|
65
|
+
src = ["src", "examples"]
|
|
66
|
+
exclude = [
|
|
67
|
+
".git",
|
|
68
|
+
"__pycache__",
|
|
69
|
+
".vscode",
|
|
70
|
+
".venv",
|
|
71
|
+
".pytest_cache",
|
|
72
|
+
"tests",
|
|
73
|
+
]
|
|
74
|
+
fix = true
|
|
75
|
+
show-fixes = true
|
|
76
|
+
|
|
77
|
+
[tool.ruff.lint]
|
|
78
|
+
select = ["D", "E4", "E7", "E9", "F", "C901", "B", "S"]
|
|
79
|
+
ignore = ["D203", "D212"]
|
|
80
|
+
|
|
81
|
+
[tool.ruff.lint.pydocstyle]
|
|
82
|
+
convention = "google"
|
|
83
|
+
|
|
84
|
+
[tool.ruff.format]
|
|
85
|
+
indent-style = "space"
|
|
86
|
+
quote-style = "double"
|
|
87
|
+
line-ending = "auto"
|
|
88
|
+
docstring-code-format = true
|
|
89
|
+
exclude = [
|
|
90
|
+
".git",
|
|
91
|
+
"__pycache__",
|
|
92
|
+
".vscode",
|
|
93
|
+
".venv",
|
|
94
|
+
".pytest_cache",
|
|
95
|
+
"tests",
|
|
96
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Utils Submodule."""
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"""Logger for VAEM device."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
|
|
5
|
+
from rich.logging import RichHandler
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Logging:
|
|
9
|
+
"""Class that contains common functions for logging."""
|
|
10
|
+
|
|
11
|
+
logger = logging.getLogger("vaem")
|
|
12
|
+
|
|
13
|
+
def __init__(self, logging_level=logging.INFO, filename=None) -> None:
|
|
14
|
+
"""
|
|
15
|
+
Constructor for logging class.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
logging_level (int): Logging level from logging module
|
|
19
|
+
filename (str): If provided, enables file logging to the given filename.
|
|
20
|
+
|
|
21
|
+
Returns:
|
|
22
|
+
None
|
|
23
|
+
"""
|
|
24
|
+
logging.basicConfig(format="%(message)s", datefmt="[%X]", handlers=[RichHandler()])
|
|
25
|
+
|
|
26
|
+
Logging.logger.setLevel(logging_level)
|
|
27
|
+
Logging.logger.propagate = False
|
|
28
|
+
|
|
29
|
+
if filename:
|
|
30
|
+
self.enable_file_logging(logging_level, filename)
|
|
31
|
+
else:
|
|
32
|
+
self.enable_stream_logging(logging_level)
|
|
33
|
+
|
|
34
|
+
def enable_stream_logging(self, logging_level=logging.INFO) -> None:
|
|
35
|
+
"""
|
|
36
|
+
Enables logging to stream using the provided log level with rich log formatting.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
logging_level (int): Logging level from logging module
|
|
40
|
+
|
|
41
|
+
Returns:
|
|
42
|
+
None
|
|
43
|
+
"""
|
|
44
|
+
handler = RichHandler()
|
|
45
|
+
handler.setLevel(logging_level)
|
|
46
|
+
formatter = logging.Formatter(fmt="%(message)s", datefmt="[%X]")
|
|
47
|
+
handler.setFormatter(formatter)
|
|
48
|
+
Logging.logger.addHandler(handler)
|
|
49
|
+
|
|
50
|
+
def enable_file_logging(self, logging_level=logging.INFO, filename=None) -> None:
|
|
51
|
+
"""
|
|
52
|
+
Enables logging to a file using the provided filename and log level.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
logging_level (int): Logging level from logging module
|
|
56
|
+
filename (str): Filename to log to.
|
|
57
|
+
|
|
58
|
+
Returns:
|
|
59
|
+
None
|
|
60
|
+
"""
|
|
61
|
+
handler = logging.FileHandler(filename)
|
|
62
|
+
handler.setLevel(logging_level)
|
|
63
|
+
formatter = logging.Formatter(fmt="%(asctime)s - %(name)s - %(levelname)s - %(message)s", datefmt="[%X]")
|
|
64
|
+
handler.setFormatter(formatter)
|
|
65
|
+
Logging.logger.addHandler(handler)
|