Skip to content

Commit eae7701

Browse files
committed
Add instructions on generating data models
1 parent 2c98398 commit eae7701

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
# harp-python
22

33
A low-level interface to data collected with the [Harp](https://harp-tech.org/) binary protocol.
4+
5+
## Data model
6+
7+
To regenerate Pydantic data models from device schema definitions, activate a virtual environment with `dev` dependencies, and run:
8+
9+
```
10+
datamodel-codegen --input ./reflex-generator/schema/device.json --output harp/model.py --output-model-type pydantic_v2.BaseModel
11+
```
12+
13+
> [!IMPORTANT]
14+
> Currently code generation adds an unwanted field at the very end of the data model definition `registers: Optional[Any] = None`. This declaration needs to be removed for serialization to work properly.

0 commit comments

Comments
 (0)