Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dostuffthatmatters committed Sep 18, 2023
1 parent c984109 commit 643bcfd
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 33 deletions.
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
# 🐙 Tenta Python Client
# Tenta Python Client

This is a Python client library for [Tenta](https//github.com/iterize/tenta), a sensor network management tool. This library uses [Paho MQTT](https://github.com/eclipse/paho.mqtt.python) to communicate with a Tenta server connected to the same broker. The library provides type-safe interfaces to create an MQTT client, send out messages (logs, measurements, and acknowledgements) to the server and receive parameters (configuration messages) from the server.
This is a Python client library for [Tenta](https://github.com/iterize/tenta), a sensor network management tool. This library uses [Paho MQTT](https://github.com/eclipse/paho.mqtt.python) to communicate with a Tenta server connected to the same broker. The library provides type-safe interfaces to create an MQTT client, send messages (logs, measurements, and acknowledgments) to the server, and receive parameters (configuration messages) from the server.

Please contact [Moritz Makowski]([email protected]) if you have any questions or feedback that goes beyong the scope of a GitHub issue.

The documentation for this client library can be found at [tenta-python-client.onrender.com](https://tenta-python-client.onrender.com).
Please contact [Moritz Makowski](mailto:[email protected]) if you have any questions or feedback that goes beyond the scope of a GitHub issue. The documentation for this client library is hosted at [tenta-python-client.onrender.com](https://tenta-python-client.onrender.com).

<br/>

## Usage

1. Install it with Pip or [Poetry](https://github.com/python-poetry/poetry)
Install it with Pip or [Poetry](https://github.com/python-poetry/poetry):

```bash
pip install tenta
# or
poetry add tenta
```

2. Start using it
Import and use it in your project:

```python
import tenta
Expand Down Expand Up @@ -62,20 +60,18 @@ config_message: typing.Optional[
tenta_client.teardown()
```

1. Read the [documentation](https://tenta-python-client.onrender.com) to learn about all the client features

<br/>

## About

**Why does this client exist?** The Tenta specification of how sensor should publish their data is very concise. Still in order to actually use Tenta in a project, one needs to write code that sends out these messages via an Python MQTT library, like Paho. This is not that much code, but need to be implemented, documented and tested in every single Project that wants to use Tenta. Hence, this client library is fully tested, documented and makes onboarding to Tenta significantly easier.
**Why does this client exist?** The Tenta specification of how a sensor should publish its data is simple, but to actually use Tenta in a project, one needs to write code that sends out these messages via a Python MQTT library, like Paho. This implementation code is relatively simple but needs to be written, documented, and tested in every single project that wants to use Tenta. This client library is thoroughly tested and documented. Hence, it makes onboarding to Tenta significantly easier.

**Compatibility:** Client library version `0.X.*` will be compatible with the Tenta specification `0.X.*`. Client library versions `Y.*.*` will be compatible with Tenta specification `Y.*.*`.

**Adhering to semantic versioning:** The same function calls will produce the same MQTT messages within non-breaking releases, i.e. the function call `tenta_client.function(args)` will produce the same MQTT messages in library versions `0.1.0` and `0.1.3` even if the Tenta specification provides a new feature in `0.1.3`. New non-breaking features in Tenta will alway be opt-in, i.e. `tenta_client.function(args, enable_new_feature=True)´ will opt-into that new feature. This way, the behaviour of sensors does not change with the same code even if they upgrade to non-breaking client library releases (automatically).
**Adhering to semantic versioning:** The same function calls will produce the same MQTT messages within non-breaking releases, i.e., the function call `tenta_client.function(args)` will produce the same MQTT messages in library versions `0.1.0` and `0.1.3` even if the Tenta specification provides a new feature in `0.1.3`. New non-breaking features in Tenta will always be opt-in, i.e., `tenta_client.function(args, enable_new_feature=True)` will opt into that new feature. This way, the behavior of sensors does not change with the same code even if they upgrade to non-breaking client library releases (automatically).

**Open-Source:** Issues and Pull Requests are welcome! Every PR undergoes a review process to ensure quality and semantic versioning.

**Testing:** The library is statically typed and is strictly checked using [Mypy](https://github.com/python/mypy). The tests cover publishing all message types, receiving configuration messages and connecting to the MQTT broker with and without TLS encryption with valid and invalid connection details. The tests are run for all supported Python versions (3.8, 3.9, 3.10, 3.11).
**Testing:** The library is statically typed and is strictly checked using [Mypy](https://github.com/python/mypy). The tests cover publishing all message types, receiving configuration messages, and connecting to the MQTT broker with and without TLS encryption with valid and invalid connection details. The tests run for all supported Python versions (3.8, 3.9, 3.10, 3.11).

**Documentation:** The documentation is built using [Nextra](https://nextra.site/) and [Pydoc-Markdown](https://github.com/NiklasRosenstein/pydoc-markdown).
9 changes: 8 additions & 1 deletion docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "tenta-python-client-docs",
"version": "0.1.0",
"description": "Documentation of the Python client library for Tenta, a sensor network management tool",
"contributors": [
{
"name": "Moritz Makowski",
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"index": "Overview",
"examples": "Examples",
"api": "API Reference"
"api-reference": "API Reference"
}
File renamed without changes.
20 changes: 8 additions & 12 deletions docs/pages/index.mdx
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
# 🐙 Tenta Python Client
# Tenta Python Client

This is a Python client library for [Tenta](https//github.com/iterize/tenta), a sensor network management tool. This library uses [Paho MQTT](https://github.com/eclipse/paho.mqtt.python) to communicate with a Tenta server connected to the same broker. The library provides type-safe interfaces to create an MQTT client, send out messages (logs, measurements, and acknowledgements) to the server and receive parameters (configuration messages) from the server.
This is a Python client library for [Tenta](https://github.com/iterize/tenta), a sensor network management tool. This library uses [Paho MQTT](https://github.com/eclipse/paho.mqtt.python) to communicate with a Tenta server connected to the same broker. The library provides type-safe interfaces to create an MQTT client, send messages (logs, measurements, and acknowledgments) to the server, and receive parameters (configuration messages) from the server.

Please contact [Moritz Makowski]([email protected]) if you have any questions or feedback that goes beyong the scope of a GitHub issue.

The documentation for this client library can be found at [tenta-python-client.onrender.com](https://tenta-python-client.onrender.com).
Please contact [Moritz Makowski](mailto:[email protected]) if you have any questions or feedback that goes beyond the scope of a GitHub issue. The documentation for this client library is hosted at [tenta-python-client.onrender.com](https://tenta-python-client.onrender.com).

<br/>

## Usage

1. Install it with Pip or [Poetry](https://github.com/python-poetry/poetry)
Install it with Pip or [Poetry](https://github.com/python-poetry/poetry):

```bash
pip install tenta
# or
poetry add tenta
```

2. Start using it
Import and use it in your project:

```python
import tenta
Expand Down Expand Up @@ -62,20 +60,18 @@ config_message: typing.Optional[
tenta_client.teardown()
```

1. Read the [documentation](https://tenta-python-client.onrender.com) to learn about all the client features

<br/>

## About

**Why does this client exist?** The Tenta specification of how sensor should publish their data is very concise. Still in order to actually use Tenta in a project, one needs to write code that sends out these messages via an Python MQTT library, like Paho. This is not that much code, but need to be implemented, documented and tested in every single Project that wants to use Tenta. Hence, this client library is fully tested, documented and makes onboarding to Tenta significantly easier.
**Why does this client exist?** The Tenta specification of how a sensor should publish its data is simple, but to actually use Tenta in a project, one needs to write code that sends out these messages via a Python MQTT library, like Paho. This implementation code is relatively simple but needs to be written, documented, and tested in every single project that wants to use Tenta. This client library is thoroughly tested and documented. Hence, it makes onboarding to Tenta significantly easier.

**Compatibility:** Client library version `0.X.*` will be compatible with the Tenta specification `0.X.*`. Client library versions `Y.*.*` will be compatible with Tenta specification `Y.*.*`.

**Adhering to semantic versioning:** The same function calls will produce the same MQTT messages within non-breaking releases, i.e. the function call `tenta_client.function(args)` will produce the same MQTT messages in library versions `0.1.0` and `0.1.3` even if the Tenta specification provides a new feature in `0.1.3`. New non-breaking features in Tenta will alway be opt-in, i.e. `tenta_client.function(args, enable_new_feature=True)´ will opt-into that new feature. This way, the behaviour of sensors does not change with the same code even if they upgrade to non-breaking client library releases (automatically).
**Adhering to semantic versioning:** The same function calls will produce the same MQTT messages within non-breaking releases, i.e., the function call `tenta_client.function(args)` will produce the same MQTT messages in library versions `0.1.0` and `0.1.3` even if the Tenta specification provides a new feature in `0.1.3`. New non-breaking features in Tenta will always be opt-in, i.e., `tenta_client.function(args, enable_new_feature=True)` will opt into that new feature. This way, the behavior of sensors does not change with the same code even if they upgrade to non-breaking client library releases (automatically).

**Open-Source:** Issues and Pull Requests are welcome! Every PR undergoes a review process to ensure quality and semantic versioning.

**Testing:** The library is statically typed and is strictly checked using [Mypy](https://github.com/python/mypy). The tests cover publishing all message types, receiving configuration messages and connecting to the MQTT broker with and without TLS encryption with valid and invalid connection details. The tests are run for all supported Python versions (3.8, 3.9, 3.10, 3.11).
**Testing:** The library is statically typed and is strictly checked using [Mypy](https://github.com/python/mypy). The tests cover publishing all message types, receiving configuration messages, and connecting to the MQTT broker with and without TLS encryption with valid and invalid connection details. The tests run for all supported Python versions (3.8, 3.9, 3.10, 3.11).

**Documentation:** The documentation is built using [Nextra](https://nextra.site/) and [Pydoc-Markdown](https://github.com/NiklasRosenstein/pydoc-markdown).
6 changes: 3 additions & 3 deletions docs/theme.config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 5334 2792"
className="h-[var(--nextra-navbar-height)] p-[1.375rem] bg-slate-900 text-slate-50 border-r border-slate-300 dark:border-slate-700 dark:bg-transparent"
className="h-[var(--nextra-navbar-height)] p-[1.1rem] bg-slate-900 text-slate-50 border-r border-slate-300 dark:border-slate-700 dark:bg-transparent"
>
<path
d="M4266.67,2791.67l-0,-2258.33l533.333,0l0,2258.33l533.333,-0l0,-2791.67l-2666.67,0l-0,2258.33l-533.334,0l0,-2258.33l-2133.33,0l0,533.333l533.333,0l0,2258.33l533.334,-0l-0,-2258.33l533.333,0l0,2258.33l1600,-0l0,-2258.33l533.333,0l0,2258.33l533.334,-0Z"
Expand All @@ -18,7 +18,7 @@ export default {
</div>
),
project: {
link: "https://github.com/iterize/tenta",
link: "https://github.com/tum-esm/tenta-client",
icon: (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -41,7 +41,7 @@ export default {
</svg>
),
},
docsRepositoryBase: "https://github.com/tum-esm/tenta-client/tree/main",
docsRepositoryBase: "https://github.com/tum-esm/tenta-client/blob/main/docs",
//primaryHue: 43,
navigation: true,
useNextSeoProps() {
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[tool.poetry]
name = "tenta"
version = "0.1.0"
description = ""
authors = ["Moritz Makowski <moritz@dostuffthatmatters.dev>"]
description = "Python client library for Tenta, a sensor network management tool"
authors = ["Moritz Makowski <moritz[email protected]>"]
readme = "README.md"
packages = [{ include = "tenta" }]
repository = "https://github.com/tum-esm/tenta-client"
documentation = "https://tenta-python-client.onrender.com"
license = "AGPL-3.0-only"

[tool.poetry.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
INDEX_DST = os.path.join(PROJECT_DIR, "docs", "pages", "index.mdx")
EXAMPLE_SRC = os.path.join(PROJECT_DIR, "example.py")
EXAMPLE_DST = os.path.join(PROJECT_DIR, "docs", "pages", "examples.mdx")
API_DST = os.path.join(PROJECT_DIR, "docs", "pages", "api.mdx")
API_DST = os.path.join(PROJECT_DIR, "docs", "pages", "api-reference.mdx")


# copy index file to docs folder
Expand Down
2 changes: 1 addition & 1 deletion tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DOCS_PAGES_DIR = os.path.join(PROJECT_DIR, "docs", "pages")
FILENAMES = ["index.mdx", "examples.mdx", "api.mdx"]
FILENAMES = ["index.mdx", "examples.mdx", "api-reference.mdx"]


@pytest.mark.order(4)
Expand Down

0 comments on commit 643bcfd

Please sign in to comment.