Python package e3sertools
A small collection of helper functions to use alongside e3series package.
Functionality
This package provides this functionality:
- Ability to resolve PID of target E3 process in a meaningful way:
check corresponding environment variable (
E3_SERIES_PID), if it is not set then check parent processes, if nothing from above works then just ask a user which process to connect to. This functionality is available asApplication.resolve_e3_pid()withApplicationfrome3sertools.extensionsmodule orapp.resolve_e3_pid()withappfrome3sertools.contextvars. - Control over COM-connection initialization and finalization by code.
Initialization happens at Python wrapper initialization and
finalization is available as
ReleaseComObject()method. Both are implemented forJobclass ine3sertools.extensionsmodule. The class supportsContextManagerprotocol and closes connection on context exit. - Global context variables for
ApplicationandJobconnections to reuse them between modules. Context variables forApplicationandJobclasses are available asappandjobfrome3sertools.contextvarsmodule. - [WIP] Proxy classes to reuse COM connections between different Python object instances. When these classes will be implemented their usage should improve COM interface perfomance and control over finalization of COM connections.
Examples
import e3series as e3
from e3sertools import contextvars
# Resolve PID of target E3.series application
pid = contextvars.app.resolve_e3_pid()
# Create COM connection to the target application by the PID
app = e3.Application(pid)
# Set the app as active context variable for usage in other functions & modules
contextvars.app.set(app)
# Create e3Job COM connection and use it as context manager
with contextvars.app.CreateJobObject() as job:
# Set the created job object as current by corresponding context variable
with contextvars.job.set(job):
... # operate with the contextvars.job object
# Here the e3Job COM connection is automatically closed by context manager
# Usage of job object after closing connection leads to exception:
print(job.GetName()) # AttributeError: COM-connection has been closed already
Using the multi-variable with syntax the thing can be written more concisely:
import e3series as e3
from e3sertools.contextvars import app, job
app.set(e3.Application(app.resolve_e3_pid()))
with app.CreateJobObject() as j, job.set(j):
... # operate with the job object (even in other modules)
# Here the e3Job COM connection is closed by context manager
Metadata
Release files for e3sertools 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| e3sertools-0.4.0.tar.gz | 11.3 kB | Without provenance | Details for e3sertools-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| e3sertools-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for e3sertools-0.4.0-py3-none-any.whl |
Total release size: 24.7 kB
Release files / e3sertools-0.4.0.tar.gz
| Download URL | e3sertools-0.4.0.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b5aa881c4b37f396872274fbc237c2c62cdfd3635f6cc90fad3329018230615
|
|
BLAKE2b-256 checksum How to use checksums |
e4cfe9be45cb5ed4a6ff28f7a5170117b9cdf4ef59bd2be944b00bf4257d3ee3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / e3sertools-0.4.0-py3-none-any.whl
| Download URL | e3sertools-0.4.0-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e347860a7c99f8fc26169d48f047fa52a088099f708015e558a183ef1deb269
|
|
BLAKE2b-256 checksum How to use checksums |
bbee0c4f347b76ec724177c24aa58a8ca5760f0f0515cfa38854fde9ce98c32b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for e3sertools 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.