Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 1 addition & 3 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ on:
jobs:
build_and_deploy:
uses: sensirion/.github/.github/workflows/driver.python.pypi_publish.yml@main
secrets:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

secrets: inherit
2 changes: 2 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ on:
jobs:
documentation:
uses: sensirion/.github/.github/workflows/driver.python.documentation.yml@main
with:
use-project-requirements: true
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.1] - 2025-8-28

### Added

- Changed start_measurement example-value to enum
## [1.0.0] - 2025-8-25

### Added

- Inital release of SPS30 driver

[Unreleased]: https://github.com/Sensirion/python-uart-sps30/compare/1.0.0...HEAD
[Unreleased]: https://github.com/Sensirion/python-uart-sps30/compare/1.0.1...HEAD
[1.0.1]: https://github.com/Sensirion/python-uart-sps30/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/Sensirion/python-uart-sps30/releases/tag/1.0.0
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2025, Sensirion AG
Copyright (c) 2026, Sensirion AG
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

26 changes: 0 additions & 26 deletions ci/checkin_doc.sh

This file was deleted.

16 changes: 0 additions & 16 deletions ci/set_git_config.sh

This file was deleted.

9 changes: 2 additions & 7 deletions docs/build-documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,5 @@ The documentation is built with `Sphinx <http://www.sphinx-doc.org>`_:

.. code-block:: bash

python setup.py install # Install package
pip install -r docs/requirements.txt # Install requirements
cd docs # Change to docs folder
make html # Build documentation


The generated documentation is located in docs/_build/html.
python -m pip install .[docs] # Install doc requirements
sphinx-build -b html docs docs/_build/html # Build documentation
14 changes: 9 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html


import os
import sys
from datetime import datetime

import pkg_resources
import importlib.metadata as metadata
import sphinx_tabs.tabs

import sphinx.ext.autodoc

import sensirion_uart_sps30
Expand All @@ -17,16 +20,16 @@
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

# -- Project information -----------------------------------------------------
distribution = pkg_resources.get_distribution('sensirion_uart_sps30')
distribution = metadata.distribution("sensirion_uart_sps30")

project = u'sensirion_uart_sps30'
project = distribution.name
copyright = u'{} Sensirion AG, Switzerland'.format(datetime.now().year)
author = 'Sensirion AG'

# The short X.Y version
version = sensirion_uart_sps30.__version__
version = distribution.version
# The full version, including alpha/beta/rc tags
release = sensirion_uart_sps30.__version__
release = distribution.version

# -- General configuration ---------------------------------------------------

Expand All @@ -36,6 +39,7 @@
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx_tabs.tabs',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.githubpages',
'sphinx.ext.intersphinx',
Expand Down
45 changes: 45 additions & 0 deletions docs/dev-setup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
To prepare your development environment, check out the repository,
create a Python virtual environment, and activate it.
Then install the driver in editable mode using `pip`.

Check out the Git repository to your local machine:

.. code-block:: console
git clone <url-of-driver-repository>
cd <checkout-folder>
Create a Python virtual environment:

.. code-block:: console
python -m venv .venv
Activate the virtual environment:

.. tabs::

.. group-tab:: Bash

.. code-block:: console
source .venv/bin/activate
.. group-tab:: PowerShell

.. code-block:: console
.venv\Scripts\Activate.ps1
.. group-tab:: Command Prompt

.. code-block:: console
.venv\Scripts\activate.bat
Install the driver in editable mode together with the development dependencies:

.. code-block:: console
python -m pip install -e .
4 changes: 4 additions & 0 deletions docs/development.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Development
===========

For development, you first need to prepare your setup.

.. include:: dev-setup.rst

.. toctree::

run-tests
Expand Down
37 changes: 37 additions & 0 deletions docs/driver-installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
The driver installation consists of creating a Python virtual environment,
activating it, and installing the driver using `pip`.

Create a Python virtual environment:

.. code-block:: console

python -m venv .venv

Activate the virtual environment:

.. tabs::

.. group-tab:: Bash


.. code-block:: console

source .venv/bin/activate

.. group-tab:: PowerShell

.. code-block:: console

.venv\Scripts\Activate.ps1

.. group-tab:: Command Prompt

.. code-block:: console

.venv\Scripts\activate.bat

Install the driver:

.. code-block:: console

python -m pip install sensirion_uart_sps30
16 changes: 9 additions & 7 deletions docs/execute-measurements.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Execute measurements
====================
Install the SPS30 Driver
------------------------

The following steps show how to use this driver to execute a simple measurement on a Windows system.
.. include:: driver-installation.rst

1. Install the SPS30 sensor driver and all required packages as described in :ref:`Installation`.
2. Connect the SPS30 sensor to your system with the serial USB cable.
3. Run the example script from the root of the repository.
Run Usage-Example
-----------------

1. Connect the SPS30 sensor to your system with the serial USB cable.
2. Run the example script from the root of the repository.

By default the script assumes the sensor is connected to COM1 serial port. If this is different on your system,
pass the port in use with the :code:`--serial-port` parameter as outlined below.
Expand All @@ -15,7 +17,7 @@ The following steps show how to use this driver to execute a simple measurement
python examples/example_usage_uart_sps30.py --serial-port <your COM port>

Example script
--------------
~~~~~~~~~~~~~~

.. literalinclude:: ../examples/example_usage_uart_sps30.py
:language: python
9 changes: 3 additions & 6 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
Installation
============

The package can be installed with pip:
It is assumed that you have a working Python installation on your system.
If not, please install Python first including `pip <https://pip.pypa.io/en/stable/installation/>`_.

.. sourcecode:: bash

pip install sensirion_uart_sps30

Recommended usage is within a virtualenv.
.. include:: driver-installation.rst
4 changes: 4 additions & 0 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Quick Start
===========

Learn how to quickly get started with the SPS30 and perform your first measurements using
the provided usage examples.


.. toctree::

execute-measurements
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
click==8.0.4
jinja2~=3.1.0
sphinx~=7.1.0
sphinx-tabs~=3.5.0
sphinx_rtd_theme~=1.3.0
8 changes: 4 additions & 4 deletions examples/example_usage_uart_sps30.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2025 Sensirion AG, Switzerland
# (c) Copyright 2026 Sensirion AG, Switzerland
#
# THIS FILE IS AUTOMATICALLY GENERATED!
#
# Generator: sensirion-driver-generator 1.3.3
# Generator: sensirion-driver-generator 1.9.3
# Product: sps30
# Model-Version: 1.0.1
# Model-Version: 1.0.2
#

import time
Expand Down Expand Up @@ -35,7 +35,7 @@
product_type = sensor.read_product_type()
print(f"product_type: {product_type}; "
)
sensor.start_measurement(OutputFormat(261))
sensor.start_measurement(OutputFormat.OUTPUT_FORMAT_UINT16)
for i in range(50):
try:
time.sleep(1.0)
Expand Down
14 changes: 7 additions & 7 deletions metadata.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# driver generation metadata
generator_version: 1.3.3
model_version: 1.0.1
dg_status: released
is_manually_modified: false
first_generated: '2025-08-15 14:57'
last_generated: '2025-08-25 12:22'
# driver generation metadata
generator_version: 1.9.3
model_version: 1.0.2
dg_status: released
is_manually_modified: false
first_generated: '2025-08-15 14:57'
last_generated: '2026-10-05 08:44'
Loading
Loading