Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
302c4343
Commit
302c4343
authored
Oct 30, 2024
by
Olivier
Committed by
oroulet
Oct 30, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes in pyproject.toml, update readme to use uv
parent
44266819
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
104 deletions
+81
-104
README.md
README.md
+76
-81
pyproject.toml
pyproject.toml
+5
-3
run-tests.sh
run-tests.sh
+0
-20
No files found.
README.md
View file @
302c4343
...
...
@@ -27,9 +27,9 @@ Version 0.9.9 introduces some argument renaming due to more automatic code gener
# Installation
With pip
With
uv/
pip
pip install asyncua
uv
pip install asyncua
# Usage
...
...
@@ -85,16 +85,16 @@ Minimal server example: https://github.com/FreeOpcUa/opcua-asyncio/blob/master/e
A set of command line tools also available: https://github.com/FreeOpcUa/opcua-asyncio/tree/master/tools
-
`uadiscover `
(find_servers, get_endpoints and find_servers_on_network calls)
-
`uals `
(list children of a node)
-
`uahistoryread`
-
`uaread `
(read attribute of a node)
-
`uawrite `
(write attribute of a node)
-
`uacall `
(call method of a node)
-
`uasubscribe `
(subscribe to a node and print datachange events)
-
`uaclient `
(connect to server and start python shell)
-
`uaserver `
(starts a demo OPC UA server)
`tools/uaserver --populate --certificate cert.pem --private_key pk.pem`
-
`uadiscover `
(find_servers, get_endpoints and find_servers_on_network calls)
-
`uals `
(list children of a node)
-
`uahistoryread`
-
`uaread `
(read attribute of a node)
-
`uawrite `
(write attribute of a node)
-
`uacall `
(call method of a node)
-
`uasubscribe `
(subscribe to a node and print datachange events)
-
`uaclient `
(connect to server and start python shell)
-
`uaserver `
(starts a demo OPC UA server)
`tools/uaserver --populate --certificate cert.pem --private_key pk.pem`
How to generate certificate: https://github.com/FreeOpcUa/opcua-asyncio/tree/master/examples/generate_certificate.sh
...
...
@@ -102,61 +102,61 @@ How to generate certificate: https://github.com/FreeOpcUa/opcua-asyncio/tree/mas
What works:
-
connection to server, opening channel, session
-
browsing and reading attributes value
-
getting nodes by path and nodeids
-
creating subscriptions
-
subscribing to items for data change
-
subscribing to events
-
adding nodes
-
method call
-
user and password
-
history read
-
login with certificate
-
communication encryption
-
removing nodes
-
connection to server, opening channel, session
-
browsing and reading attributes value
-
getting nodes by path and nodeids
-
creating subscriptions
-
subscribing to items for data change
-
subscribing to events
-
adding nodes
-
method call
-
user and password
-
history read
-
login with certificate
-
communication encryption
-
removing nodes
Tested servers: freeopcua C++, freeopcua Python, prosys, kepware, beckhoff, winCC, B&R, …
Not implemented yet:
-
localized text feature
-
XML protocol
-
UDP (PubSub stuff)
-
WebSocket
-
maybe automatic reconnection...
-
localized text feature
-
XML protocol
-
UDP (PubSub stuff)
-
WebSocket
-
maybe automatic reconnection...
## Server support
What works:
-
creating channel and sessions
-
read/set attributes and browse
-
getting nodes by path and nodeids
-
autogenerate address space from spec
-
adding nodes to address space
-
datachange events
-
events
-
methods
-
basic user implementation (one existing user called admin, which can be disabled, all others are read only)
-
encryption
-
certificate handling
-
removing nodes
-
history support for data change and events
-
more high level solution to create custom structures
-
creating channel and sessions
-
read/set attributes and browse
-
getting nodes by path and nodeids
-
autogenerate address space from spec
-
adding nodes to address space
-
datachange events
-
events
-
methods
-
basic user implementation (one existing user called admin, which can be disabled, all others are read only)
-
encryption
-
certificate handling
-
removing nodes
-
history support for data change and events
-
more high level solution to create custom structures
Tested clients: freeopcua C++, freeopcua Python, uaexpert, prosys, quickopc
Not yet implemented:
-
UDP (PubSub stuff)
-
WebSocket
-
session restore
-
alarms
-
XML protocol
-
views
-
localized text features
-
better security model with users and password
-
UDP (PubSub stuff)
-
WebSocket
-
session restore
-
alarms
-
XML protocol
-
views
-
localized text features
-
better security model with users and password
### Running a server on a Raspberry Pi
...
...
@@ -172,53 +172,48 @@ from XML definition.
All protocol code is under opcua directory
-
`asyncua/ua`
contains all UA structures from specification, most are autogenerated
-
`asyncua/common`
contains high level objects and methods used both in server and client
-
`asyncua/client`
contains client specific code
-
`asyncua/server`
contains server specific code
-
`asyncua/utils`
contains some utilities function and classes
-
`asyncua/tools`
contains code for command lines tools
-
`schemas`
contains the XML and text files from specification and the python scripts used to autogenerate code
-
`tests`
contains tests
-
`docs`
contains files to auto generate documentation from doc strings
-
`examples`
contains many example files
-
`examples/sync`
contains many example files using sync API
-
`tools`
contains python scripts that can be used to run command line tools from repository without installing
## Running
tests
:
-
`asyncua/ua`
contains all UA structures from specification, most are autogenerated
-
`asyncua/common`
contains high level objects and methods used both in server and client
-
`asyncua/client`
contains client specific code
-
`asyncua/server`
contains server specific code
-
`asyncua/utils`
contains some utilities function and classes
-
`asyncua/tools`
contains code for command lines tools
-
`schemas`
contains the XML and text files from specification and the python scripts used to autogenerate code
-
`tests`
contains tests
-
`docs`
contains files to auto generate documentation from doc strings
-
`examples`
contains many example files
-
`examples/sync`
contains many example files using sync API
-
`tools`
contains python scripts that can be used to run command line tools from repository without installing
## Running
a command for testing
:
```
python -m pip install -r requirements.txt
python -m pip install -r dev_requirements.txt
pytest -v -s
uv run uals -u opc.tcp://localhost:4840/myserver
```
Or
## Running tests:
```
./run-test.sh -v -
s
uv run pytest -v -s test
s
```
## Coverage
```
pytest -v -s --cov asyncua --cov-report=html
```
Or
```
./run-test.sh -v -s --cov asyncua --cov-report=html
uv run pytest -v -s --cov asyncua --cov-report=html
```
## Linting
To apply linting checks (including ruff, and mypy) at each commit run,
```
bash
pip
install
pre-commi
t
pre-commit
install
uv
sync
--group
lin
t
uv run
pre-commit
install
```
You can also run all linters on all files with,
```
bash
pre-commit run
-a
uv run
pre-commit run
-a
```
pyproject.toml
View file @
302c4343
...
...
@@ -36,9 +36,8 @@ classifiers = [
"Programming Language :: Python :: 3.13"
,
"Topic :: Software Development :: Libraries :: Python Modules"
,
]
[tool.uv]
dev-dependencies
=
[
[dependency-groups]
dev
=
[
"pytest"
,
"pytest-asyncio == 0.21.2"
,
"coverage"
,
...
...
@@ -50,7 +49,10 @@ dev-dependencies = [
"types-pyOpenSSL"
,
"types-python-dateutil"
,
"types-pytz"
,
"ruff"
,
]
lint
=
[
"ruff"
,
"mypy"
,
"pre-commit"
]
[project.scripts]
uabrowse
=
"asyncua.tools:uals"
...
...
run-tests.sh
deleted
100755 → 0
View file @
44266819
#!/bin/sh -e
# Check if virtualenv is available and if it is use it
if
command
-v
virtualenv
;
then
# Create a virtual venv in order not to pollute
# the main python libs if the venv already
# exist no harm is done
virtualenv
-p
python3 venv
.
venv/bin/activate
# install requirements
python3
-m
pip
install
-r
requirements.txt
python3
-m
pip
install
-r
dev_requirements.txt
# Execute pytest and pass along the arguments
# used to call this script
pytest
$@
else
echo
"virtualenv not installed"
# Execute pytest and pass along the arguments
# used to call this script
pytest
$@
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment