Skip to main content

ahio

ahio is a communication library whose goal is to abstract the interfacing with various I/O hardwares, so that changing hardware becomes possible with minimum code modification. It's desired that an application that already works with an I/O hardware will only need pin remapping and possibly initial setup change to work with another hardware, not entire code rewrite.

It works with drivers, which are installed in the ahio.drivers package. Every driver must implement the API described in the ahio.abstract_driver package. If you plan to use this library or develop a driver, read the documentation there.

Installation

Simplest way is to use pip: pip3 install ahio Alternatively you can checkout this repository and run python3 setup.py install

Basic usage

# Import the package:
import ahio

# You can see what drivers are available in this platform by calling
print(ahio.list_available_drivers())

# Instantiate the desired driver
with ahio.new_driver('Arduino') as arduino:
  # The driver can have a driver-specific setup function. Call it as/if needed.
  arduino.setup('/dev/tty.usbmodem1421')

  # Map the pins. From now on, when you use 1 in the API, it will have effects
  # on pin D3 in the Arduino. If you change hardware in the future, just change
  # the mapping.
  arduino.map_pin(1, arduino.Pins.D3)
  arduino.map_pin(2, arduino.Pins.D13)
  arduino.map_pin(3, arduino.Pins.A1)

  # Change a pin direction (Input or Output)
  arduino.set_pin_direction([1, 2], ahio.Direction.Output)
  arduino.set_pin_direction(3, ahio.Direction.Input)

  # Set the output of a pin
  arduino.write([1, 2], ahio.LogicValue.High)
  arduino.write(1, 0.4, pwm=True)

  # Read the input of a pin
  print(arduino.read(3))

Documentation

Documentation is hosted at GitHub

Metadata

Release files for ahio 1.0.35

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ahio 1.0.35
File Size Uploaded Provenance Actions
ahio-1.0.35.tar.gz 48.7 kB With provenance Details for ahio-1.0.35.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ahio 1.0.35
File Interpreter ABI Platform Actions
ahio-1.0.35-py3-none-any.whl Python 3 none any Details for ahio-1.0.35-py3-none-any.whl

Total release size: 75.6 kB

Release files / ahio-1.0.35.tar.gz

Download URL ahio-1.0.35.tar.gz
Size 48.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7141fcf0fdae7694253ea72cf49db27bc9352a822a3be563f99b33d530bc1972
BLAKE2b-256 checksum
How to use checksums
9d4e77650524c5cf5ff1a37ab7768c3e6b71e03be9336a5aec0b338e9ab77b6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 26, 2025.

Transparency log

Release files / ahio-1.0.35-py3-none-any.whl

Download URL ahio-1.0.35-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0703c88857a6b8a8b924d96df9653a289f9f09af77efd2fa943820d0059d0cff
BLAKE2b-256 checksum
How to use checksums
e87259c30af3e0415b0cc7f93403b50f9fffa5a33edebc455d11e0e4c2273d41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 26, 2025.

Transparency log

Security for ahio 1.0.35

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ahio-1.0.35.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 26, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.35 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page