Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e04a343
:change links due to update in docs
VigneshVSV Nov 1, 2025
17720bd
move upto test 3 to pytest
VigneshVSV Nov 1, 2025
e94528b
do test 4, 6 & 7
VigneshVSV Nov 16, 2025
2d27a1b
update doc
VigneshVSV Nov 16, 2025
2e9fa31
do test 8
VigneshVSV Nov 16, 2025
e401523
move test_10
VigneshVSV Nov 16, 2025
8ce7e79
do test 11 & 12 , but untested
VigneshVSV Nov 16, 2025
e7c148d
move pytest to top level of tests and away from its own folder
VigneshVSV Nov 16, 2025
5fec1f4
test 6 verify
VigneshVSV Nov 16, 2025
8e64c50
verify test 8
VigneshVSV Nov 16, 2025
857871a
lint bug report and feature request
VigneshVSV Nov 16, 2025
c3d954c
add ruff settings for isort
VigneshVSV Nov 16, 2025
5508754
isort conftest
VigneshVSV Nov 16, 2025
6ac9d54
isort test 1
VigneshVSV Nov 16, 2025
7ac5adb
isort 2-10
VigneshVSV Nov 16, 2025
87a9dd1
do test 11 & 12
VigneshVSV Nov 16, 2025
5bc0fd0
do test 5
VigneshVSV Nov 16, 2025
0abb182
add asyncio automode
VigneshVSV Nov 16, 2025
c394b0f
remove unnecessary fixtures in conftest
VigneshVSV Nov 16, 2025
581f842
general fixes
VigneshVSV Nov 19, 2025
be9373a
complete E2E test with class structure
VigneshVSV Nov 19, 2025
764846a
run all tests at once
VigneshVSV Nov 19, 2025
cb063ac
optimize some things
VigneshVSV Nov 20, 2025
c25abf0
add tests_13 1-10
VigneshVSV Nov 20, 2025
eda9f6b
clean most HTTP tests
VigneshVSV Nov 21, 2025
7715368
remove old test HTTP
VigneshVSV Nov 21, 2025
1d29886
do test 09 finally
VigneshVSV Nov 21, 2025
db084c5
delete test thing basic file
VigneshVSV Nov 21, 2025
8318fbe
sort imports test thing
VigneshVSV Nov 21, 2025
b57fa00
rename test files numbers
VigneshVSV Nov 21, 2025
b61d59d
refactor folder structure
VigneshVSV Nov 21, 2025
7e19ef3
cleanup all tests
VigneshVSV Nov 22, 2025
e1dba1a
update pyproject.toml
VigneshVSV Nov 22, 2025
5a5d600
catch stop iteration in tornado close
VigneshVSV Nov 22, 2025
283c500
ruff test_14_rpc unintegrated
VigneshVSV Nov 22, 2025
330be52
move unittest to pytest in CI pipeline
VigneshVSV Nov 22, 2025
120a24e
remove pytest dev file
VigneshVSV Nov 22, 2025
de048fb
remove isort rules for ruff
VigneshVSV Nov 22, 2025
b93c632
install project into own env for tests
VigneshVSV Nov 22, 2025
c74acc8
add asyncio loop fixture around all classes
VigneshVSV Nov 22, 2025
e4ae1c4
set session scoped event loop
VigneshVSV Nov 22, 2025
8047fe0
skip subscribe_event test if no event received
VigneshVSV Nov 22, 2025
c36422b
try forwarding port numbers to see if subscription works
VigneshVSV Nov 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior.
- code snippet or fully functional code block .
- log statements

- code snippet or fully functional code block .
- log statements

**Expected behavior**
A clear and concise description of what you expected to happen.

**OS/python version:**
- windows/linux
- python 3.11/3.12 or 13?

- windows/linux
- python 3.11/3.12 or 13?

**Additional context**
Add any other context about the problem here.
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Please describe.**
Expand All @@ -14,7 +13,7 @@ A clear and concise description of what the feature achieves
Practical use cases where this feature would be useful (if any)

**Describe the solution you'd like**
Final API, code snippets etc., a clear and concise description of what you want to happen.
Final API, code snippets etc., a clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,33 +76,32 @@ jobs:
run: |
uv venv .venv
source .venv/bin/activate
uv sync --no-install-project --group test --group dev
uv sync --group test --group dev

- name: install dependencies (windows)
if: runner.os == 'Windows'
run: |
uv venv .venv
.venv\Scripts\activate
uv sync --no-install-project --group test --group dev
uv sync --group test --group dev

- name: run unit tests (linux/macOS)
if: runner.os != 'Windows' && matrix.python-version != 3.13
run: |
source .venv/bin/activate
uv run coverage run -m unittest discover -s tests -p 'test_*.py'
pytest -s -v

- name: run unit tests (Windows)
if: runner.os == 'Windows'
run: |
.venv\Scripts\activate
uv run coverage run -m unittest discover -s tests -p "test_*.py"
pytest -s -v

- name: run unit tests and generate coverage report (linux/macOS python 3.13)
if: runner.os != 'Windows' && matrix.python-version == 3.13
run: |
source .venv/bin/activate
uv run coverage run -m unittest discover -s tests -p 'test_*.py'
uv run coverage xml -o coverage.xml
pytest -s -v --cov=hololinked --cov-report=xml:coverage.xml

- name: upload coverage report as artifact
uses: actions/upload-artifact@v4
Expand Down
100 changes: 0 additions & 100 deletions .github/workflows/pytest-dev.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__/
*.py[cod]
*$py.class
*.crt
test*.db

# C extensions
*.so
Expand Down
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
{
// VS code settings used for this project
// Please consider installing and using these extensions to make
// PRs consistent in terms of formatting and linting
"editor.rulers": [
80, 120
],
"editor.formatOnSave": true,

"ruff.lineLength": 120,
"ruff.organizeImports": true,
"ruff.lint.enable": true,

"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports.ruff": "explicit",
"source.fixAll.ruff": "explicit"
}
},

"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Partial contributions are also taken if its easier to continue working on it. In
To start developing and complete the contribution, following steps may be followed:

1. Fork the repository and clone it to your local machine.
2. Setup python environment, preferably using `uv`, instructions are in the [README](https://github.com/hololinked-dev/hololinked/blob/main/README.md#contributing).
2. Setup python environment, preferably using `uv`, instructions are in the [docs]([setup development environment](https://docs.hololinked.dev/introduction/contributing#setup-development-environment).
3. There are some test things under `tests/helper-scripts` directory or in the [examples repository](https://gitlab.com/hololinked/examples), especially the simulators (they may not be up to date, one could take what one needs). These can be used to test your changes.
4. All code must follow [PEP 8](https://peps.python.org/pep-0008/) style guide. One needs to use ruff to check for style issues - `uvx ruff check hololinked`.
5. Unit/Integration tests are recommended to be added for any new feature or bug fix. These tests can be run with `python -m unittest` under the `tests` directory.
Expand Down
112 changes: 4 additions & 108 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

As a novice, you have a requirement to control and capture data from your hardware, say in your electronics or science lab, and you want to show the data in a dashboard, provide a PyQt GUI or run automated scripts, `hololinked` can help. Even for isolated desktop applications or a small setup without networking, one can still separate the concerns of the tools that interact with the hardware & the hardware itself.

If you are a web developer or an industry professional looking for a web standards compatible (high-speed) IoT runtime, `hololinked` can be a decent choice. By conforming to [W3C Web of Things](https://www.w3.org/WoT/), one can expect a consistent API and flexible bidirectional message flow to interact with your devices, irrespective of the underlying protocol. Currently HTTP, MQTT & ZMQ are supported. See [Use Cases Table](#use-cases-table).
If you are a web developer or an industry professional looking for a web standards compatible (high-speed) IoT runtime, `hololinked` can be a decent choice. By conforming to [W3C Web of Things](https://www.w3.org/WoT/), one can expect a consistent API and flexible bidirectional message flow to interact with your devices, irrespective of the underlying protocol. Currently HTTP, MQTT & ZMQ are supported. See [Use Cases Table](https://docs.hololinked.dev/introduction/use-cases).

This implementation is based on RPC, built ground-up in python keeping both the latest web technologies and python principles in mind.

[![Documentation Status](https://img.shields.io/github/actions/workflow/status/hololinked-dev/docs/ci.yaml?label=Build%20And%20Publish%20Docs)](https://github.com/hololinked-dev/docs) [![CI Pipeline](https://github.com/hololinked-dev/hololinked/actions/workflows/ci-pipeline.yml/badge.svg)](https://github.com/hololinked-dev/hololinked/actions/workflows/ci-pipeline.yml) ![Ruff](https://img.shields.io/badge/linter-ruff-blue?logo=ruff&logoColor=white) [![PyPI](https://img.shields.io/pypi/v/hololinked?label=pypi%20package)](https://pypi.org/project/hololinked/) [![Anaconda](https://anaconda.org/conda-forge/hololinked/badges/version.svg)](https://anaconda.org/conda-forge/hololinked) [![codecov](https://codecov.io/github/hololinked-dev/hololinked/graph/badge.svg?token=5DI4XJ2KX9)](https://codecov.io/github/hololinked-dev/hololinked) [![Conda Downloads](https://img.shields.io/conda/d/conda-forge/hololinked)](https://anaconda.org/conda-forge/hololinked) [![PyPI - Downloads](https://img.shields.io/pypi/dm/hololinked?label=pypi%20downloads)](https://pypistats.org/packages/hololinked) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15155942.svg)](https://doi.org/10.5281/zenodo.12802841) [![Discord](https://img.shields.io/discord/1265289049783140464?label=Discord%20Members&logo=discord)](https://discord.com/invite/kEz87zqQXh) [![email](https://img.shields.io/badge/email-brown)](mailto:info@hololinked.dev) [![Feedback Form](https://img.shields.io/badge/feedback-form-green)](https://forms.gle/FB4XwkUDt1wV4GGPA)
[![Documentation Status](https://img.shields.io/github/actions/workflow/status/hololinked-dev/docs/ci.yaml?label=Build%20And%20Publish%20Docs)](https://github.com/hololinked-dev/docs) [![CI Pipeline](https://github.com/hololinked-dev/hololinked/actions/workflows/ci-pipeline.yml/badge.svg)](https://github.com/hololinked-dev/hololinked/actions/workflows/ci-pipeline.yml) ![Ruff](https://img.shields.io/badge/linter-ruff-blue?logo=ruff&logoColor=white) [![PyPI](https://img.shields.io/pypi/v/hololinked?label=pypi%20package)](https://pypi.org/project/hololinked/) [![Anaconda](https://anaconda.org/conda-forge/hololinked/badges/version.svg)](https://anaconda.org/conda-forge/hololinked) [![codecov](https://codecov.io/github/hololinked-dev/hololinked/graph/badge.svg?token=5DI4XJ2KX9)](https://codecov.io/github/hololinked-dev/hololinked) [![Conda Downloads](https://img.shields.io/conda/d/conda-forge/hololinked)](https://anaconda.org/conda-forge/hololinked) [![PyPI - Downloads](https://img.shields.io/pypi/dm/hololinked?label=pypi%20downloads)](https://pypistats.org/packages/hololinked) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15155942.svg)](https://doi.org/10.5281/zenodo.12802841) [![Discord](https://img.shields.io/discord/1265289049783140464?label=Discord%20Members&logo=discord)](https://discord.com/invite/kEz87zqQXh) [![email](https://img.shields.io/badge/email-brown)](mailto:info@hololinked.dev) [![Feedback Form](https://img.shields.io/badge/feedback%20%form-red)](https://forms.gle/FB4XwkUDt1wV4GGPA)

## To Install

Expand Down Expand Up @@ -544,121 +544,17 @@ In React, the Thing Description may be fetched inside `useEffect` hook, the clie
See [organization info](https://github.com/hololinked-dev) for details regarding contributing to this package. There are:

- [good first issues](https://github.com/hololinked-dev/hololinked/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
- [setup development environment](https://docs.hololinked.dev/introduction/contributing#setup-development-environment)
- [discord group](https://discord.com/invite/kEz87zqQXh)
- [weekly meetings](https://github.com/hololinked-dev/#monthly-meetings) and
- [project planning](https://github.com/orgs/hololinked-dev/projects/4) to discuss activities around this repository.

### Development with UV

One can setup a development environment with [uv](https://docs.astral.sh/uv/) as follows:

##### Setup Development Environment

1. Install uv if you don't have it already: https://docs.astral.sh/uv/getting-started/installation/
2. Create and activate a virtual environment:

```bash
uv venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```

3. Install the package in development mode with all dependencies:

```bash
uv pip install -e .
uv pip install -e ".[dev,test]"
```

##### Running Tests

To run the tests with uv:

In linux:

```bash
uv run --active coverage run -m unittest discover -s tests -p 'test_*.py'
uv run --active coverage report -m
```

In windows:

```bash
python -m unittest
```

## Currently Supported Features

Some other features that are currently supported:

- control method execution and property write with a custom finite state machine.
- use a custom finite state machine.
- database (Postgres, MySQL, SQLite - based on SQLAlchemy) support for storing and loading properties when the object dies and restarts.
- auto-generate Thing Description for Web of Things applications.
- use serializer of your choice (except for HTTP) - MessagePack, JSON, pickle etc. & extend serialization to suit your requirement
- asyncio event loops on server side

## Use Cases <a name="use-cases-table"></a>

<table>
<tr>
<th>Protocol</th>
<th>Plausible Use Cases</th>
<th>Operations</th>
</tr>
<tr>
<td>HTTP</td>
<td>Web Apps</td>
<td rowspan="4">
<code>readproperty</code>,
<code>writeproperty</code>,
<code>observeproperty</code>,
<code>unobserveproperty</code>,
<code>invokeaction</code>,
<code>subscribeevent</code>,
<code>unsubscribeevent</code>,
<code>readmultipleproperties</code>,
<code>writemultipleproperties</code>,
<code>readallproperties</code>,
<code>writeallproperties</code>
<br>
properties and actions can be operated in a oneway and no-block manner (issue and query later format) as well
</td>
</tr>
<tr>
<td>ZMQ TCP</td>
<td>Networked Control Systems, subnet protected containerized apps like in Kubernetes</td>
</tr>
<tr>
<td>ZMQ IPC</td>
<td>Desktop Applications, Python Dashboards without exposing device API directly on network</td>
</tr>
<tr>
<td>ZMQ INPROC</td>
<td>
High Speed Desktop Applications (again, not exposed on network), currently you will need some CPP magic or disable GIL to leverage it fully
</td>
</tr>
<tr>
<td>MQTT</td>
<td>
Reliable pub-sub & incorporating into existing systems that use MQTT for <br> lightweight messaging
</td>
<td>
<code>observeproperty</code>,
<code>unobserveproperty</code>,
<code>subscribeevent</code>,
<code>unsubscribeevent</code>
</td>
</tr>
<tr>
<td>MQTT with websockets</td>
<td>
Reliable pub-sub for web applications, planned for November 2025 release.
</td>
<td>
<code>observeproperty</code>,
<code>unobserveproperty</code>,
<code>subscribeevent</code>,
<code>unsubscribeevent</code>
</td>
</tr>
</table>
2 changes: 1 addition & 1 deletion doc
Submodule doc updated from d4e965 to e8ec16
Loading