Skip to content

Commit

Permalink
Merge pull request #7 from harp-tech/gl-dev
Browse files Browse the repository at this point in the history
Prepare package metadata for first release
  • Loading branch information
glopesdev authored Nov 2, 2023
2 parents 30640a3 + 6c998a2 commit d513077
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
__pycache__
*.pyc
*.egg-info
dist
dist

# Data files
data
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,31 @@ datamodel-codegen --input ./reflex-generator/schema/device.json --output harp/mo

> [!IMPORTANT]
> 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.
## How to use

### Read Harp device schema from YML file

```python
from harp.schema import read_schema
schema = read_schema('device.yml')
```

### Create device reader object from schema

```python
from harp.reader import create_reader
reader = create_reader(schema)
```

### Read data from named register

```python
reader.OperationControl.read("data/Behavior_10.bin")
```

### Access register metadata

```python
reader.OperationControl.register.address
```
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "harp-python"
authors = [
{name = "Goncalo Lopes", email = "g.lopes@neurogears.org"}
]
description = "A low-level interface to loading binary Harp protocol data"
description = "A low-level interface for loading binary Harp protocol data"
readme = "README.md"
requires-python = ">=3.9.0"
dynamic = ["version"]
Expand Down Expand Up @@ -34,7 +34,8 @@ dev = [
"black"
]
jupyter = [
"ipykernel"
"ipykernel",
"matplotlib"
]

[build-system]
Expand Down

0 comments on commit d513077

Please sign in to comment.