Skip to content

Commit d513077

Browse files
authored
Merge pull request #7 from harp-tech/gl-dev
Prepare package metadata for first release
2 parents 30640a3 + 6c998a2 commit d513077

3 files changed

Lines changed: 35 additions & 3 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@
66
__pycache__
77
*.pyc
88
*.egg-info
9-
dist
9+
dist
10+
11+
# Data files
12+
data

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,31 @@ datamodel-codegen --input ./reflex-generator/schema/device.json --output harp/mo
1212

1313
> [!IMPORTANT]
1414
> 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.
15+
16+
## How to use
17+
18+
### Read Harp device schema from YML file
19+
20+
```python
21+
from harp.schema import read_schema
22+
schema = read_schema('device.yml')
23+
```
24+
25+
### Create device reader object from schema
26+
27+
```python
28+
from harp.reader import create_reader
29+
reader = create_reader(schema)
30+
```
31+
32+
### Read data from named register
33+
34+
```python
35+
reader.OperationControl.read("data/Behavior_10.bin")
36+
```
37+
38+
### Access register metadata
39+
40+
```python
41+
reader.OperationControl.register.address
42+
```

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "harp-python"
33
authors = [
44
{name = "Goncalo Lopes", email = "g.lopes@neurogears.org"}
55
]
6-
description = "A low-level interface to loading binary Harp protocol data"
6+
description = "A low-level interface for loading binary Harp protocol data"
77
readme = "README.md"
88
requires-python = ">=3.9.0"
99
dynamic = ["version"]
@@ -34,7 +34,8 @@ dev = [
3434
"black"
3535
]
3636
jupyter = [
37-
"ipykernel"
37+
"ipykernel",
38+
"matplotlib"
3839
]
3940

4041
[build-system]

0 commit comments

Comments
 (0)