Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<p align="center">
<img src="https://raw.githubusercontent.com/harp-tech/pyharp/c0c8c23cc1a965c41834a106fe686be76c2f0520/docs/assets/logo.svg" alt="Harp logo" width="400">
<img src="https://raw.githubusercontent.com/harp-tech/python/c0c8c23cc1a965c41834a106fe686be76c2f0520/docs/assets/logo.svg" alt="Harp logo" width="400">
</p>

# harp

This project includes four main packages:

- **harp-protocol**: Provides the core protocol definitions and utilities for the Harp protocol. See [Protocol API Documentation](https://harp-tech.org/pyharp/api/protocol) for details.
- **harp-protocol**: Provides the core protocol definitions and utilities for the Harp protocol. See [Protocol API Documentation](https://harp-tech.org/python/api/protocol) for details.

- **harp-serial**: Implements serial communication functionalities for generic Harp devices. See [Serial API Documentation](https://harp-tech.org/pyharp/api/serial) for more information.
- **harp-serial**: Implements serial communication functionalities for generic Harp devices. See [Serial API Documentation](https://harp-tech.org/python/api/serial) for more information.

- **harp-device**: Implements the transport-agnostic `Device` interface, the common register map, and the shared registers and enums. See [Device API Documentation](https://harp-tech.org/pyharp/api/device) for details.
- **harp-device**: Implements the transport-agnostic `Device` interface, the common register map, and the shared registers and enums. See [Device API Documentation](https://harp-tech.org/python/api/device) for details.

- **harp-data**: Parses register binary dumps into pandas DataFrames. See [Data API Documentation](https://harp-tech.org/pyharp/api/data) for more information.
- **harp-data**: Parses register binary dumps into pandas DataFrames. See [Data API Documentation](https://harp-tech.org/python/api/data) for more information.

## Installation

Expand Down Expand Up @@ -100,7 +100,7 @@ AnalogData = behavior.AnalogData # registers are reached by name
assert behavior.REGISTER_MAP[44] is AnalogData # or by address
```

See the [Examples](https://harp-tech.org/pyharp/examples/) for the full walkthroughs, including subscribing to device events and working with custom interface-type converters.
See the [Examples](https://harp-tech.org/python/examples/) for the full walkthroughs, including subscribing to device events and working with custom interface-type converters.

## Contributing

Expand Down
7 changes: 4 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
site_name: harp
repo_url: https://github.com/harp-tech/pyharp
repo_name: "harp-tech/pyharp"
site_url: https://harp-tech.org/python/
repo_url: https://github.com/harp-tech/python
repo_name: "harp-tech/python"
copyright: Copyright (c) harp-tech and Contributors

exclude_docs: |
Expand Down Expand Up @@ -87,7 +88,7 @@ nav:
extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/harp-tech/pyharp
link: https://github.com/harp-tech/python

extra_css:
- stylesheets/extra.css
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ dependencies = [

[project.urls]
Homepage = "https://harp-tech.org/"
Repository = "https://github.com/harp-tech/pyharp/"
Documentation = "https://harp-tech.org/pyharp/"
"Bug Tracker" = "https://github.com/harp-tech/pyharp/issues"
Changelog = "https://github.com/harp-tech/pyharp/releases"
Repository = "https://github.com/harp-tech/python/"
Documentation = "https://harp-tech.org/python/"
"Bug Tracker" = "https://github.com/harp-tech/python/issues"
Changelog = "https://github.com/harp-tech/python/releases"

[build-system]
requires = ["setuptools>=77", "setuptools-scm>=8"]
Expand Down
23 changes: 23 additions & 0 deletions src/packages/harp-data/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
MIT License

Copyright (c) 2020 OEPS & Filipe Carvalho
Copyright (c) 2025 Hardware and Software Platform, Champalimaud Foundation
Copyright (c) harp-tech and Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 2 additions & 2 deletions src/packages/harp-data/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# harp-data

Load Harp register data into pandas DataFrames. This is the package that pulls in `pandas`. [`harp-protocol`](../harp-protocol) stays numpy-only and exposes a pandas-free `ColumnData` view that this package assembles into a DataFrame.
Load Harp register data into pandas DataFrames. This is the package that pulls in `pandas`. [`harp-protocol`](https://github.com/harp-tech/python/tree/main/src/packages/harp-protocol) stays numpy-only and exposes a pandas-free `ColumnData` view that this package assembles into a DataFrame.

There are two ways in, depending on what is on disk:

Expand All @@ -19,7 +19,7 @@ A Harp acquisition is usually saved as a de-multiplexed folder, one binary file
┗ 📜 device.yml
```

Reading is based on a [device module](../harp-device) that describes how to decode each register. `open_dataset` supplies one automatically. It finds the `device.yml` in the folder, builds the module, and returns a ready-to-use reader:
Reading is based on a [device module](https://github.com/harp-tech/python/tree/main/src/packages/harp-device) that describes how to decode each register. `open_dataset` supplies one automatically. It finds the `device.yml` in the folder, builds the module, and returns a ready-to-use reader:

```python
from harp import data
Expand Down
25 changes: 25 additions & 0 deletions src/packages/harp-data/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,39 @@
name = "harp-data"
dynamic = ["version"]
description = "Load Harp device data into pandas DataFrames"
authors = [{ name = "harp-tech", email = "contact@harp-tech.org" }]
license = "MIT"
license-files = ["LICENSE"]
readme = 'README.md'
requires-python = ">=3.11"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: System :: Hardware :: Hardware Drivers",
]
dependencies = [
"harp-protocol",
"harp-device",
"numpy>=1.24",
"pandas>=2.0",
]

[project.urls]
Homepage = "https://harp-tech.org/"
Repository = "https://github.com/harp-tech/python/"
Documentation = "https://harp-tech.org/python/"
"Bug Tracker" = "https://github.com/harp-tech/python/issues"
Changelog = "https://github.com/harp-tech/python/releases"

[build-system]
requires = ["setuptools>=77", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"
Expand Down
23 changes: 23 additions & 0 deletions src/packages/harp-device/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
MIT License

Copyright (c) 2020 OEPS & Filipe Carvalho
Copyright (c) 2025 Hardware and Software Platform, Champalimaud Foundation
Copyright (c) harp-tech and Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion src/packages/harp-device/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# harp-device

The transport-agnostic device layer for the Harp protocol: the common Harp registers and a `Device` base that handles framing, request/reply and register access. It depends only on [`harp-protocol`](../harp-protocol), with no transport dependencies. Pair it with a transport such as [`harp-serial`](../harp-serial).
The transport-agnostic device layer for the Harp protocol: the common Harp registers and a `Device` base that handles framing, request/reply and register access. It depends only on [`harp-protocol`](https://github.com/harp-tech/python/tree/main/src/packages/harp-protocol), with no transport dependencies. Pair it with a transport such as [`harp-serial`](https://github.com/harp-tech/python/tree/main/src/packages/harp-serial).

## Read/write registers

Expand Down
25 changes: 25 additions & 0 deletions src/packages/harp-device/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,38 @@
name = "harp-device"
dynamic = ["version"]
description = "Transport-agnostic Harp device protocol layer"
authors = [{ name = "harp-tech", email = "contact@harp-tech.org" }]
license = "MIT"
license-files = ["LICENSE"]
readme = 'README.md'
requires-python = ">=3.11"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: System :: Hardware :: Hardware Drivers",
]
dependencies = [
"harp-protocol",
"pydantic>=2",
"pydantic-yaml>=1",
]

[project.urls]
Homepage = "https://harp-tech.org/"
Repository = "https://github.com/harp-tech/python/"
Documentation = "https://harp-tech.org/python/"
"Bug Tracker" = "https://github.com/harp-tech/python/issues"
Changelog = "https://github.com/harp-tech/python/releases"

[build-system]
requires = ["setuptools>=77", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"
Expand Down
23 changes: 23 additions & 0 deletions src/packages/harp-protocol/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
MIT License

Copyright (c) 2020 OEPS & Filipe Carvalho
Copyright (c) 2025 Hardware and Software Platform, Champalimaud Foundation
Copyright (c) harp-tech and Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion src/packages/harp-protocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ np.uint16(65535) + 1 # RuntimeWarning: overflow encountered in scalar add

Numpy scalars behave like plain Python numbers in arithmetic, comparison and formatting. Use `int()` or `float()` where a built-in type is required.

It carries no transport or device logic. See [`harp-device`](../harp-device) for the device layer.
It carries no transport or device logic. See [`harp-device`](https://github.com/harp-tech/python/tree/main/src/packages/harp-device) for the device layer.
23 changes: 23 additions & 0 deletions src/packages/harp-protocol/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,35 @@ description = "Library with the base types for Harp protocol usage."
authors = [{ name = "harp-tech", email = "contact@harp-tech.org" }]
license = "MIT"
keywords = ['python', 'harp']
license-files = ["LICENSE"]
readme = 'README.md'
requires-python = ">=3.11"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: System :: Hardware :: Hardware Drivers",
]
dependencies = [
"numpy>=1.24",
"typing-extensions>=4.14",
]

[project.urls]
Homepage = "https://harp-tech.org/"
Repository = "https://github.com/harp-tech/python/"
Documentation = "https://harp-tech.org/python/"
"Bug Tracker" = "https://github.com/harp-tech/python/issues"
Changelog = "https://github.com/harp-tech/python/releases"

[build-system]
requires = ["setuptools>=77", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"
Expand Down
23 changes: 23 additions & 0 deletions src/packages/harp-serial/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
MIT License

Copyright (c) 2020 OEPS & Filipe Carvalho
Copyright (c) 2025 Hardware and Software Platform, Champalimaud Foundation
Copyright (c) harp-tech and Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion src/packages/harp-serial/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# harp-serial

Serial transport for [`harp-device`](../harp-device). Provides `SerialTransport` and the `open_device` factory, which pairs a device module or a `Device` class with a serial port. This is the package that pulls in `pyserial`.
Serial transport for [`harp-device`](https://github.com/harp-tech/python/tree/main/src/packages/harp-device). Provides `SerialTransport` and the `open_device` factory, which pairs a device module or a `Device` class with a serial port. This is the package that pulls in `pyserial`.

## Usage

Expand Down
25 changes: 25 additions & 0 deletions src/packages/harp-serial/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,38 @@
name = "harp-serial"
dynamic = ["version"]
description = "Serial transport for Harp devices"
authors = [{ name = "harp-tech", email = "contact@harp-tech.org" }]
license = "MIT"
license-files = ["LICENSE"]
readme = 'README.md'
requires-python = ">=3.11"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: System :: Hardware :: Hardware Drivers",
]
dependencies = [
"harp-protocol",
"harp-device",
"pyserial>=3.5",
]

[project.urls]
Homepage = "https://harp-tech.org/"
Repository = "https://github.com/harp-tech/python/"
Documentation = "https://harp-tech.org/python/"
"Bug Tracker" = "https://github.com/harp-tech/python/issues"
Changelog = "https://github.com/harp-tech/python/releases"

[build-system]
requires = ["setuptools>=77", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"
Expand Down
2 changes: 1 addition & 1 deletion tests/data/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def test_schema_without_whoami_skips_check(dataset, device_yml):


def test_unmodellable_schema_skips_check(dataset, device_yml):
# Well-formed YAML that pyharp cannot describe, such as a newer or older revision,
# Well-formed YAML that this library cannot describe, such as a newer or older revision,
# must not stop a module that works from decoding the binaries beside it.
_mod, _name, root, specs = dataset
(root / "device.yml").write_text("registers: [this is not a register map]\n")
Expand Down
Loading