You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,9 @@
3
3
4
4
# labthings-fastapi
5
5
6
-
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], replacing Flask 1 and Marshmallow with FastAPI and Pydantic. It is the underlying framework for v3 of the [OpenFlexure Microscope software].
6
+
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].
7
+
8
+
Documentation, including install instructions, is available on [readthedocs].
7
9
8
10
Features include:
9
11
@@ -18,7 +20,7 @@ Features include:
18
20
- Dependency injection is used to manage relationships between Things and dependency on the server
19
21
* Async HTTP handling
20
22
- Starlette (used by FastAPI) can handle requests asynchronously - potential for websockets/events (not used much yet)
21
-
-`Thing` code is still, for now, threaded. I intend to make it possible to write async things in the future, but don't intend it to become mandatory
23
+
-`Thing` code is still, for now, threaded. It may become possible to write async things in the future, but won't become mandatory
22
24
* Smaller codebase
23
25
- FastAPI more or less completely eliminates OpenAPI generation code from our codebase
24
26
- Thing Description generation is very much simplified by the new structure (multiple Things instead of one massive Thing with many extensions)
@@ -28,11 +30,11 @@ Features include:
28
30
29
31
## Installation
30
32
31
-
You can install this repository with `pip install labthings-fastapi`. It may at some point be renamed to `labthings` v2. For the latest development version, either clone it and run `pip install -e .[dev]` to work on it, or just `pip install https://gitlab.com/rwb27/labthings-fastapi.git`.
33
+
See [readthedocs] for installation instructions that are automatically tested. You can install this package with `pip install labthings-fastapi`. It may at some point be renamed to `labthings` v2. For the latest development version, either clone it and run `pip install -e .[dev]` to work on it, or just `pip install https://gitlab.com/rwb27/labthings-fastapi.git`.
32
34
33
35
## Developer notes
34
36
35
-
The code is linted with `ruff .`, type checked with `mypy src`, and tested with `pytest`. These all run in CI with GitHub Actions. The codebase is not even `v0.1` yet so it's still subject to summary rearrangement. We recommend a [pre-commit hook] to ensure `ruff` passes on every commit.
37
+
The code is linted with `ruff .`, type checked with `mypy src`, and tested with `pytest`. These all run in CI with GitHub Actions. The codebase is not even `v0.1` yet so it's still subject to summary rearrangement. 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`.
36
38
37
39
Dependencies are defined in `pyproject.toml` and can be compiled to `dev-requirements.txt` with:
38
40
```
@@ -44,9 +46,10 @@ All changes to the codebase should go via pull requests, and should only be merg
44
46
45
47
## Demo
46
48
47
-
See the [examples folder](./examples/) for a runnable demo.
0 commit comments