An implementation of LabThings using FastAPI
Project description
labthings-fastapi
A FastAPI based library to implement a Web of Things interface for laboratory hardware using Python. This is a ground-up rewrite of python-labthings, based on FastAPI and Pydantic. It is the underlying framework for v3 of the OpenFlexure Microscope software.
Documentation, including install instructions, is available on readthedocs.
Installation
See readthedocs for installation instructions that are automatically tested. You can install this package with pip install labthings-fastapi.
Developer notes
For the latest development version, clone this repository and run pip install -e .[dev].
The code is linted with ruff ., type checked with mypy, and tested with pytest. These all run in CI with GitHub Actions. We recommend a pre-commit hook to ensure ruff passes on every commit. flake8 is also run in CI, primarily to enable stricter checks on docstrings. It is run as flake8 src. ruff and flake8 are both configured from pyproject.toml.
All changes to the codebase should go via pull requests, and should only be merged once all the checks in the test job are passing. It is preferable to merge code where the test-with-unpinned-dependencies job fails, and deal with the dependency issues in another PR, particularly where the required changes are distinct from the code in the PR.
Dependencies are defined in pyproject.toml and can be compiled to dev-requirements.txt with:
uv pip compile --extra dev pyproject.toml --output-file dev-requirements.txt
If you're not using uv, just regular pip-compile from pip-tools should do the same thing.
Demo
See readthedocs for a runnable demo.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file labthings_fastapi-0.0.14.tar.gz.
File metadata
- Download URL: labthings_fastapi-0.0.14.tar.gz
- Upload date:
- Size: 117.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d2d09fe8c4ea8d640cf00c7651dfcd2e3939be7dc19508af28b27e1cfda437a
|
|
| MD5 |
99ab0b985d30e58014427eebb60782d8
|
|
| BLAKE2b-256 |
d6b65f4d90efd28133ac3e416cadac95b9842dca21c4d00ffe93f292dc55db52
|
Provenance
The following attestation bundles were made for labthings_fastapi-0.0.14.tar.gz:
Publisher:
publish.yml on labthings/labthings-fastapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
labthings_fastapi-0.0.14.tar.gz -
Subject digest:
9d2d09fe8c4ea8d640cf00c7651dfcd2e3939be7dc19508af28b27e1cfda437a - Sigstore transparency entry: 810230573
- Sigstore integration time:
-
Permalink:
labthings/labthings-fastapi@dafb8f9ab8262485a8d8d2b2d16d3e165625af81 -
Branch / Tag:
refs/tags/v0.0.14 - Owner: https://github.com/labthings
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dafb8f9ab8262485a8d8d2b2d16d3e165625af81 -
Trigger Event:
push
-
Statement type:
File details
Details for the file labthings_fastapi-0.0.14-py3-none-any.whl.
File metadata
- Download URL: labthings_fastapi-0.0.14-py3-none-any.whl
- Upload date:
- Size: 142.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
787cd5aab6d0dbd42619794ad9482ff0b2d2f20d5621eb918655df2e0887c6f4
|
|
| MD5 |
bb0e31f6a8a53ae6a2729b9b32442298
|
|
| BLAKE2b-256 |
a4fd0bce0d2342ac29594169dbe88b00b495fa4fdde4e0b7019396f5615ffcf9
|
Provenance
The following attestation bundles were made for labthings_fastapi-0.0.14-py3-none-any.whl:
Publisher:
publish.yml on labthings/labthings-fastapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
labthings_fastapi-0.0.14-py3-none-any.whl -
Subject digest:
787cd5aab6d0dbd42619794ad9482ff0b2d2f20d5621eb918655df2e0887c6f4 - Sigstore transparency entry: 810230578
- Sigstore integration time:
-
Permalink:
labthings/labthings-fastapi@dafb8f9ab8262485a8d8d2b2d16d3e165625af81 -
Branch / Tag:
refs/tags/v0.0.14 - Owner: https://github.com/labthings
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dafb8f9ab8262485a8d8d2b2d16d3e165625af81 -
Trigger Event:
push
-
Statement type: