Metadata-Version: 2.4
Name: pyarc2
Version: 0.6.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Operating System :: Microsoft :: Windows :: Windows 8
Classifier: Operating System :: Microsoft :: Windows :: Windows 8.1
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: numpy>=1.18
License-File: LICENSE
Summary: High level Python bindings for the libarc2 library
Home-Page: http://arc-instruments.co.uk
Author: Spyros Stathopoulos <spyros@arc-instruments.co.uk>
Author-email: spyros@arc-instruments.co.uk
License: MPL-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Source Code, https://github.com/arc-instruments/pyarc2

# Python bindings for libarc2

[![](https://img.shields.io/badge/-docs-default?logo=gitbook&logoColor=white)](https://files.arc-instruments.co.uk/documents/pyarc2/0.6.0/)

## Introduction

This library presents a python interface to the low-level `libarc2` library
used to interface with ArC TWO™. Most of the user-facing facilities of
`libarc2` are present in this library. That being said, `pyarc2` itself is
still relatively low-level and a general understanding of the internals of
ArC TWO is required.

## Use

`pyarc2` maps most of the functionality of `libarc2` so the API translates
fairly transparent. Most of the interaction with ArC TWO will be through the
`Instrument` class that encapsulates the implemented functionality of
`libarc2`. The library will keep being updated as new functionality is added.
For instance to read the current between two channels you can write

```python
from pyarc2 import Instrument, find_ids

# low voltage channel (typically grounded)
LOWV = 7
# high voltage channel
HIGHV = 33
# read-out voltage
VREAD = 0.2

# Get the ID of the first available ArC TWO
arc2id = find_ids()[0]

# firmware; shipped with your board
fw = 'arc2fw.bin'

# connect to the board
arc = Instrument(arc2id, fw)

current = arc.read_one(LOWV, HIGHV, VREAD)
print('I = %g A' % current)

```

## Additional functionality

`pyarc2` can also be used to implement new plugins based on `libarc2`.  Access
to the lower level object is done via `Instrument::inner()` and
`Instrument::inner_mut()`. These plugins can fully leverage `libarc2`
functionality but require some familiarity with Rust and the `libarc2` API.

