axserve


Nameaxserve JSON
Version 0.1.5 PyPI version JSON
download
home_pageNone
SummaryAxServe python client that provides interfaces of COM or OCX components through a gRPC server.
upload_time2024-03-03 15:18:57
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords activex com cpp grpc ocx python qt6 windows
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Introduction

AxServe is a server program and client interface that provides functionalities of COM or OCX components through a gRPC server.

## Motivation

There are many ways to integrate COM or OCX components, such as creating native apps or using other libraries or frameworks. But they all have their own strengths and weaknesses.

Options that I had considered so far were:

Library | Module | Based On | Maintainer | Language
-- | -- | -- | -- | --
[Win32](https://learn.microsoft.com/en-us/windows/win32/) |   |   | [Microsoft](https://www.microsoft.com/) | C/C++
[MFC](https://learn.microsoft.com/en-us/cpp/mfc/mfc-desktop-applications?view=msvc-170) |   |   | [Microsoft](https://www.microsoft.com/) | C++
[Qt5](https://doc.qt.io/qt-5/) | [ActiveQt](https://doc.qt.io/qt-5/activeqt-index.html) | Win32 | [Qt Group](https://www.qt.io/) | C++
[Qt6](https://doc.qt.io/qt-6/) | [ActiveQt](https://doc.qt.io/qt-6/activeqt-index.html) | Win32 | [Qt Group](https://www.qt.io/) | C++
[pywin32](https://github.com/mhammond/pywin32) | [win32com.client](https://github.com/mhammond/pywin32/tree/main/com/win32com/client) | Win32 | [Mark Hammond](https://github.com/mhammond) | Python
[pywin32](https://github.com/mhammond/pywin32) | [pywin.mfc.activex](https://github.com/mhammond/pywin32/blob/main/Pythonwin/pywin/mfc/activex.py) | MFC | [Mark Hammond](https://github.com/mhammond) | Python
[PyQt5](https://www.riverbankcomputing.com/software/pyqt/) | [PyQt5.QAxContainer](https://www.riverbankcomputing.com/static/Docs/PyQt5/api/qaxcontainer/qaxcontainer-module.html) | Qt5 | [Riverbank Computing](https://www.riverbankcomputing.com/) | Python
[PyQt6](https://www.riverbankcomputing.com/software/pyqt/) | [PyQt6.QAxContainer](https://www.riverbankcomputing.com/static/Docs/PyQt6/api/qaxcontainer/qaxcontainer-module.html) | Qt6 | [Riverbank Computing](https://www.riverbankcomputing.com/) | Python
[PySide2](https://doc.qt.io/qtforpython-5/) | [PySide2.QtAxContainer](https://doc.qt.io/qt-5/activeqt-container.html) | Qt5 | [Qt Group](https://www.qt.io/) | Python
[PySide6](https://doc.qt.io/qtforpython-6/) | [PySide6.QtAxContainer](https://doc.qt.io/qt-6/activeqt-container.html) | Qt6 | [Qt Group](https://www.qt.io/) | Python

And Pros & Cons of each of these options that I had experienced while using some of them were as follows:

- Requires build step
    - (-) C/C++ Language options require build step
    - (+) Python Language options do not require built step
- Complexity in dependency resolution and installation
    - (-) Python Language options may have no proper python version that supports all requirements like target architecture (x86/x64) and version support (3.x)
    - (-) And Python Language options may require multiple python installations with some IPC (Inter-Process Communication) technique as workaround
    - (+) C/C++ Language options only require single installation for each target architecture once built
    - (-) But C/C++ Language options may have hard time in managing it's dependencies compared to python when it comes to installation and building
- Size of dependencies
    - (+) Microsoft Maintainer options require no further dependencies
    - (-) Other libraries and frameworks based options may require large amount of dependencies which might complicate things
- Ease of use, amount of learning materials and references, quality of documentation
    - (+) Qt based Python bindings options are easy to use, have lots of materials and references
    - (+) Qt based options have good documentation and sufficient references
    - (-) Other options may have less materials, might be harder to use
    - (+) Python Language options are generally considered as easy compared to C++
- Possibility of being deprecated or obsolete
    - (-) Qt5 Based options will become deprecated/obsolete over time in favor of Qt6
    - (+) Qt6 based options are latest version in Qt
- 32bit architecture support
    - (+) Qt5 Based options support 32bit architecture on windows naturally with prebuilt binaries ([link](https://doc.qt.io/qt-5/windows.html))
    - (-) Qt6 Based options do not provide prebuilt binaries for 32bit architecture on windows ([link](https://doc.qt.io/qt-6/windows.html))
- Applicability of acquired knowledge across domains
    - (+) Qt based options can leverage learned skills to create other applications for platforms other than windows
    - (-) Other options may be too platform specific
- License
    - (-) PyQt Based options require GPLv3 license, unless commercial license is used
    - (+) Qt Group Maintainer options (QtX and PySideX) require LGPLv3 license
    - (+) Pywin32 based options generally considered as PSF-2.0 ([issue](https://github.com/mhammond/pywin32/issues/1646))
    - (+) Microsoft Maintainer options have less license implications

My personal goal was to use 32bit COM/OCX feature in python. So based on the analysis and my goal, my final decision was:

- Not to bring the COM/OCX part of dependency to the python side
- But make the dependency loose by supporting the functionality using an IPC technique with some libraries like gRPC
- Learn Qt6 and use that for development
- Build Qt6 for 32bit architecture support on my own
- Build single server executable and use that in python
- More specifically, run the server executable using `subprocess` and connect to that using `grpcio`

And this project is the outcome of those choices.

# Usage

## Server

### GUI

1. Run the executable by double clicking.
2. Type the required information.
    - CLSID required to instantiate an Active-X or COM object.
    - Address URI for gRPC server to bind.
3. Press start button to start server.

![axserve](https://github.com/elbakramer/axserve/blob/main/axserve.png)

### Console

If built with console support, give required options to run the server as cli argument:

```
.\axserve-x86-console-debug.exe --clsid="{A1574A0D-6BFA-4BD7-9020-DED88711818D}" --address="localhost:8080" --no-gui
```

That `--no-gui` option makes the application run without GUI components. This can be useful for cases like embedding this executable in other things. FYI, technically it's not a pure non-gui application but just tries to hide or not to show the windows created internally.

The GUI version also accepts the same cli arguments. But note that it cannot print any messages since there is no console attached. FYI, the GUI version uses message boxes for that instead when needed (like printing errors).

## Client

Just started working on a Python client.

Check the following codes for more information, until relevant documentations are added:

- Example usage of it [example_client.py](https://github.com/elbakramer/axserve/blob/main/src/python/example_client.py)
- Example usages from tests:
  - Normal synchronous API: [test_iexplorer.py](https://github.com/elbakramer/axserve/blob/main/tests/test_iexplorer.py)
  - Asynchronous API under `asyncio` framework: [test_iexplorer_async.py](https://github.com/elbakramer/axserve/blob/main/tests/test_iexplorer_async.py)
- Python client implementation [stub.py](https://github.com/elbakramer/axserve/blob/main/src/python/axserve/client/stub.py)
- Proto file for gRPC service definition [active.proto](https://github.com/elbakramer/axserve/blob/main/src/proto/active.proto)

# Building

## Install Tools for Building Project

### Install MSVC BuildTools

https://learn.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2022

```
vs_buildtools.exe
    --add "Microsoft.VisualStudio.Workload.VCTools"
    --add "Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
    --add "Microsoft.VisualStudio.Component.VC.CMake.Project"
    --add "Microsoft.VisualStudio.Component.VC.ATL"
    --add "Microsoft.VisualStudio.Component.VC.ATLMFC"
    --includeRecommended
    --passive
    --norestart
```

### Install Chocolatey

https://chocolatey.org/install

```
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
```

### Install GIt

https://git-scm.com/

```
choco install git.install
```

### Install NASM

https://www.nasm.us/

```
choco install nasm
```

### Install Python

https://www.python.org/

```
choco install python311
```

### Install CMake

https://cmake.org/

```
choco install cmake
```

### Install Ninja

https://ninja-build.org/

```
choco install ninja
```

## Build Project using CMake

### List Configure Presets

```
cmake --list-presets
```

### Configure

```
cmake --preset x86-win32-debug .
```

### Build

```
cmake --build .\build\x86-win32-debug --parallel
```

## Build Project using Hatch and publish

### Build Project for Python client package

```
hatch build
```

## Publish to PyPI

```
hatch publish
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "axserve",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "Yunseong Hwang <kika1492@gmail.com>",
    "keywords": "activex,com,cpp,grpc,ocx,python,qt6,windows",
    "author": null,
    "author_email": "Yunseong Hwang <kika1492@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/45/3d/5830993834b0ffff977ee03c5d42c2cdb4af7f93c06dcce3997e5d9a479a/axserve-0.1.5.tar.gz",
    "platform": null,
    "description": "# Introduction\n\nAxServe is a server program and client interface that provides functionalities of COM or OCX components through a gRPC server.\n\n## Motivation\n\nThere are many ways to integrate COM or OCX components, such as creating native apps or using other libraries or frameworks. But they all have their own strengths and weaknesses.\n\nOptions that I had considered so far were:\n\nLibrary | Module | Based On | Maintainer | Language\n-- | -- | -- | -- | --\n[Win32](https://learn.microsoft.com/en-us/windows/win32/) | \u00a0 | \u00a0 | [Microsoft](https://www.microsoft.com/) | C/C++\n[MFC](https://learn.microsoft.com/en-us/cpp/mfc/mfc-desktop-applications?view=msvc-170) | \u00a0 | \u00a0 | [Microsoft](https://www.microsoft.com/) | C++\n[Qt5](https://doc.qt.io/qt-5/) | [ActiveQt](https://doc.qt.io/qt-5/activeqt-index.html) | Win32 | [Qt Group](https://www.qt.io/) | C++\n[Qt6](https://doc.qt.io/qt-6/) | [ActiveQt](https://doc.qt.io/qt-6/activeqt-index.html) | Win32 | [Qt Group](https://www.qt.io/) | C++\n[pywin32](https://github.com/mhammond/pywin32) | [win32com.client](https://github.com/mhammond/pywin32/tree/main/com/win32com/client) | Win32 | [Mark Hammond](https://github.com/mhammond) | Python\n[pywin32](https://github.com/mhammond/pywin32) | [pywin.mfc.activex](https://github.com/mhammond/pywin32/blob/main/Pythonwin/pywin/mfc/activex.py) | MFC | [Mark Hammond](https://github.com/mhammond) | Python\n[PyQt5](https://www.riverbankcomputing.com/software/pyqt/) | [PyQt5.QAxContainer](https://www.riverbankcomputing.com/static/Docs/PyQt5/api/qaxcontainer/qaxcontainer-module.html) | Qt5 | [Riverbank Computing](https://www.riverbankcomputing.com/) | Python\n[PyQt6](https://www.riverbankcomputing.com/software/pyqt/) | [PyQt6.QAxContainer](https://www.riverbankcomputing.com/static/Docs/PyQt6/api/qaxcontainer/qaxcontainer-module.html) | Qt6 | [Riverbank Computing](https://www.riverbankcomputing.com/) | Python\n[PySide2](https://doc.qt.io/qtforpython-5/) | [PySide2.QtAxContainer](https://doc.qt.io/qt-5/activeqt-container.html) | Qt5 | [Qt Group](https://www.qt.io/) | Python\n[PySide6](https://doc.qt.io/qtforpython-6/) | [PySide6.QtAxContainer](https://doc.qt.io/qt-6/activeqt-container.html) | Qt6 | [Qt Group](https://www.qt.io/) | Python\n\nAnd Pros & Cons of each of these options that I had experienced while using some of them were as follows:\n\n- Requires build step\n    - (-) C/C++ Language options require build step\n    - (+) Python Language options do not require built step\n- Complexity in dependency resolution and installation\n    - (-) Python Language options may have no proper python version that supports all requirements like target architecture (x86/x64) and version support (3.x)\n    - (-) And Python Language options may require multiple python installations with some IPC (Inter-Process Communication) technique as workaround\n    - (+) C/C++ Language options only require single installation for each target architecture once built\n    - (-) But C/C++ Language options may have hard time in managing it's dependencies compared to python when it comes to installation and building\n- Size of dependencies\n    - (+) Microsoft Maintainer options require no further dependencies\n    - (-) Other libraries and frameworks based options may require large amount of dependencies which might complicate things\n- Ease of use, amount of learning materials and references, quality of documentation\n    - (+) Qt based Python bindings options are easy to use, have lots of materials and references\n    - (+) Qt based options have good documentation and sufficient references\n    - (-) Other options may have less materials, might be harder to use\n    - (+) Python Language options are generally considered as easy compared to C++\n- Possibility of being deprecated or obsolete\n    - (-) Qt5 Based options will become deprecated/obsolete over time in favor of Qt6\n    - (+) Qt6 based options are latest version in Qt\n- 32bit architecture support\n    - (+) Qt5 Based options support 32bit architecture on windows naturally with prebuilt binaries ([link](https://doc.qt.io/qt-5/windows.html))\n    - (-) Qt6 Based options do not provide prebuilt binaries for 32bit architecture on windows ([link](https://doc.qt.io/qt-6/windows.html))\n- Applicability of acquired knowledge across domains\n    - (+) Qt based options can leverage learned skills to create other applications for platforms other than windows\n    - (-) Other options may be too platform specific\n- License\n    - (-) PyQt Based options require GPLv3 license, unless commercial license is used\n    - (+) Qt Group Maintainer options (QtX and PySideX) require LGPLv3 license\n    - (+) Pywin32 based options generally considered as PSF-2.0 ([issue](https://github.com/mhammond/pywin32/issues/1646))\n    - (+) Microsoft Maintainer options have less license implications\n\nMy personal goal was to use 32bit COM/OCX feature in python. So based on the analysis and my goal, my final decision was:\n\n- Not to bring the COM/OCX part of dependency to the python side\n- But make the dependency loose by supporting the functionality using an IPC technique with some libraries like gRPC\n- Learn Qt6 and use that for development\n- Build Qt6 for 32bit architecture support on my own\n- Build single server executable and use that in python\n- More specifically, run the server executable using `subprocess` and connect to that using `grpcio`\n\nAnd this project is the outcome of those choices.\n\n# Usage\n\n## Server\n\n### GUI\n\n1. Run the executable by double clicking.\n2. Type the required information.\n    - CLSID required to instantiate an Active-X or COM object.\n    - Address URI for gRPC server to bind.\n3. Press start button to start server.\n\n![axserve](https://github.com/elbakramer/axserve/blob/main/axserve.png)\n\n### Console\n\nIf built with console support, give required options to run the server as cli argument:\n\n```\n.\\axserve-x86-console-debug.exe --clsid=\"{A1574A0D-6BFA-4BD7-9020-DED88711818D}\" --address=\"localhost:8080\" --no-gui\n```\n\nThat `--no-gui` option makes the application run without GUI components. This can be useful for cases like embedding this executable in other things. FYI, technically it's not a pure non-gui application but just tries to hide or not to show the windows created internally.\n\nThe GUI version also accepts the same cli arguments. But note that it cannot print any messages since there is no console attached. FYI, the GUI version uses message boxes for that instead when needed (like printing errors).\n\n## Client\n\nJust started working on a Python client.\n\nCheck the following codes for more information, until relevant documentations are added:\n\n- Example usage of it [example_client.py](https://github.com/elbakramer/axserve/blob/main/src/python/example_client.py)\n- Example usages from tests:\n  - Normal synchronous API: [test_iexplorer.py](https://github.com/elbakramer/axserve/blob/main/tests/test_iexplorer.py)\n  - Asynchronous API under `asyncio` framework: [test_iexplorer_async.py](https://github.com/elbakramer/axserve/blob/main/tests/test_iexplorer_async.py)\n- Python client implementation [stub.py](https://github.com/elbakramer/axserve/blob/main/src/python/axserve/client/stub.py)\n- Proto file for gRPC service definition [active.proto](https://github.com/elbakramer/axserve/blob/main/src/proto/active.proto)\n\n# Building\n\n## Install Tools for Building Project\n\n### Install MSVC BuildTools\n\nhttps://learn.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2022\n\n```\nvs_buildtools.exe\n    --add \"Microsoft.VisualStudio.Workload.VCTools\"\n    --add \"Microsoft.VisualStudio.Component.VC.Tools.x86.x64\"\n    --add \"Microsoft.VisualStudio.Component.VC.CMake.Project\"\n    --add \"Microsoft.VisualStudio.Component.VC.ATL\"\n    --add \"Microsoft.VisualStudio.Component.VC.ATLMFC\"\n    --includeRecommended\n    --passive\n    --norestart\n```\n\n### Install Chocolatey\n\nhttps://chocolatey.org/install\n\n```\nSet-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))\n```\n\n### Install GIt\n\nhttps://git-scm.com/\n\n```\nchoco install git.install\n```\n\n### Install NASM\n\nhttps://www.nasm.us/\n\n```\nchoco install nasm\n```\n\n### Install Python\n\nhttps://www.python.org/\n\n```\nchoco install python311\n```\n\n### Install CMake\n\nhttps://cmake.org/\n\n```\nchoco install cmake\n```\n\n### Install Ninja\n\nhttps://ninja-build.org/\n\n```\nchoco install ninja\n```\n\n## Build Project using CMake\n\n### List Configure Presets\n\n```\ncmake --list-presets\n```\n\n### Configure\n\n```\ncmake --preset x86-win32-debug .\n```\n\n### Build\n\n```\ncmake --build .\\build\\x86-win32-debug --parallel\n```\n\n## Build Project using Hatch and publish\n\n### Build Project for Python client package\n\n```\nhatch build\n```\n\n## Publish to PyPI\n\n```\nhatch publish\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "AxServe python client that provides interfaces of COM or OCX components through a gRPC server.",
    "version": "0.1.5",
    "project_urls": {
        "Documentation": "https://github.com/elbakramer/axserve#readme",
        "Issues": "https://github.com/elbakramer/axserve/issues",
        "Source": "https://github.com/elbakramer/axserve"
    },
    "split_keywords": [
        "activex",
        "com",
        "cpp",
        "grpc",
        "ocx",
        "python",
        "qt6",
        "windows"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ed43fc83f4e98d9f4ddcb4f7627392409a969165c0e4a635e24cdb01399cefba",
                "md5": "d390c96faabd161e82cf360d9efa8026",
                "sha256": "2327bc4a4c586d39a81c383c520fd80a2ef76d2f012cfa16a5bec01024be95ab"
            },
            "downloads": -1,
            "filename": "axserve-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d390c96faabd161e82cf360d9efa8026",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 44224911,
            "upload_time": "2024-03-03T15:18:54",
            "upload_time_iso_8601": "2024-03-03T15:18:54.368349Z",
            "url": "https://files.pythonhosted.org/packages/ed/43/fc83f4e98d9f4ddcb4f7627392409a969165c0e4a635e24cdb01399cefba/axserve-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "453d5830993834b0ffff977ee03c5d42c2cdb4af7f93c06dcce3997e5d9a479a",
                "md5": "63d1598c67fe553ad5859e1e391e1fa0",
                "sha256": "e26e621b2e1dba85f624181723ba4e159da82227cddb38d5852902c1a4a5e2c2"
            },
            "downloads": -1,
            "filename": "axserve-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "63d1598c67fe553ad5859e1e391e1fa0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 95619,
            "upload_time": "2024-03-03T15:18:57",
            "upload_time_iso_8601": "2024-03-03T15:18:57.870945Z",
            "url": "https://files.pythonhosted.org/packages/45/3d/5830993834b0ffff977ee03c5d42c2cdb4af7f93c06dcce3997e5d9a479a/axserve-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-03 15:18:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "elbakramer",
    "github_project": "axserve#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "axserve"
}
        
Elapsed time: 0.20647s