|
|
# Installation Guide: ECMind client library for enaio server-API
|
|
|
|
|
|
## What is ECMind blue client?
|
|
|
|
|
|
ECMind blue client is a Python-based client-library to communicate with a enaio-server instance via different communication-protocols: - SOAP (deprected) - TCP
|
|
|
|
|
|
It includes a support for pooled connections with the TCPPoolClient.
|
|
|
|
|
|
The library can be included on projects, which need to communicate with the enaio-server-api.
|
|
|
[enaio Server-API](https://help.optimal-systems.com/enaio/v90/admin/PDF/OS_ServerApi_de.pdf)
|
|
|
|
|
|
## How to use it?
|
|
|
|
|
|
Install the ECMind blue client via pip within a project-directory (f.e. a GIT repository) like described below.
|
|
|
|
|
|
## Prerequisits
|
|
|
|
|
|
- Working enaio, reachable via TCP and Port 4000 or local installation of enaio
|
|
|
- Project-Directory on your local machine
|
|
|
|
|
|
## Installation: Local development Environment
|
|
|
|
|
|
### 1. Create new Environment via console
|
|
|
|
|
|
- Open system console
|
|
|
- Switch to your Development directory or create a new one
|
|
|
- use `> python -m venv env` to establish a new python environment
|
|
|
|
|
|
> This will generate a Python-Environment usable with most editors.
|
|
|
|
|
|
### 2. Open env in Visual Studio Code
|
|
|
|
|
|
- `> code .` (don't forget the dot!)
|
|
|
|
|
|
> Any other editor can be taken, which is usable for development.
|
|
|
|
|
|
> Recommendation:
|
|
|
> An Editor like Jetbrains PyCharm or Visual Studio Code which is capable of a own Terminal
|
|
|
|
|
|
### 3. Get the project
|
|
|
|
|
|
- Open a Terminal in your Editor or use a system console
|
|
|
- make sure that you are in your environment directory `env/` with the terminal
|
|
|
- `/env/>` `pip install ecmind_blue_client[TcpClient]` will install the project
|
|
|
|
|
|
### 4. Test the environment
|
|
|
|
|
|
Use a Python file containing following code for testing the connection:
|
|
|
|
|
|
```python
|
|
|
from ecmind_blue_client.tcp_client import Connection
|
|
|
from ecmind_blue_client import Job
|
|
|
|
|
|
with Connection(appname="BlueClient", hostname="YourEnaioMachineName",port=4000, username="YourEnaioUsername" password="YourEnaioPassword") as client:
|
|
|
|
|
|
test_job = Job('krn.GetServerInfo', Flags=0, Info=6)
|
|
|
result = client.execute(test_job)
|
|
|
print(result)
|
|
|
```
|
|
|
|
|
|
## Other relations
|
|
|
|
|
|
### Within Git-Projects
|
|
|
|
|
|
If the client library is used within a repository, add a `.gitignore`-file and add the `env/`directory to it.
|
|
|
|
|
|
### Python Package-Manager: requirements.txt
|
|
|
|
|
|
Register the package in a requirements.txt file and add `ecmind_blue_client[TcpClient]`
|
|
|
|
|
|
## Troubleshooting
|
|
|
|
|
|
### Setup-Tools (May 2022)
|
|
|
|
|
|
On some versions problems with the current ProtLib occur, because there are compatibility Problems Setup-Tools Version 0.5.8 or higher and Python 10.3 or higher.
|
|
|
|
|
|
This should be solved using the `> pip install ecmind_blue_client[TcpClient]` command, which installs necessary dependencies and working versions. |
|
|
\ No newline at end of file |