I/O Communication Library
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ahio-1.0.35.tar.gz.
File metadata
- Download URL: ahio-1.0.35.tar.gz
- Upload date:
- Size: 48.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7141fcf0fdae7694253ea72cf49db27bc9352a822a3be563f99b33d530bc1972
|
|
| MD5 |
e5ef578cdea7117a23fe4d0dccd0ca84
|
|
| BLAKE2b-256 |
9d4e77650524c5cf5ff1a37ab7768c3e6b71e03be9336a5aec0b338e9ab77b6e
|
Provenance
The following attestation bundles were made for ahio-1.0.35.tar.gz:
Publisher:
wheels.yml on acristoffers/ahio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ahio-1.0.35.tar.gz -
Subject digest:
7141fcf0fdae7694253ea72cf49db27bc9352a822a3be563f99b33d530bc1972 - Sigstore transparency entry: 203128297
- Sigstore integration time:
-
Permalink:
acristoffers/ahio@b503a0c114fbef26392840fd62b3b59b25229b39 -
Branch / Tag:
refs/tags/v1.0.35 - Owner: https://github.com/acristoffers
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@b503a0c114fbef26392840fd62b3b59b25229b39 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ahio-1.0.35-py3-none-any.whl.
File metadata
- Download URL: ahio-1.0.35-py3-none-any.whl
- Upload date:
- Size: 26.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0703c88857a6b8a8b924d96df9653a289f9f09af77efd2fa943820d0059d0cff
|
|
| MD5 |
a44dae35337b2bb829d92d2ce65e0e4f
|
|
| BLAKE2b-256 |
e87259c30af3e0415b0cc7f93403b50f9fffa5a33edebc455d11e0e4c2273d41
|
Provenance
The following attestation bundles were made for ahio-1.0.35-py3-none-any.whl:
Publisher:
wheels.yml on acristoffers/ahio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ahio-1.0.35-py3-none-any.whl -
Subject digest:
0703c88857a6b8a8b924d96df9653a289f9f09af77efd2fa943820d0059d0cff - Sigstore transparency entry: 203128299
- Sigstore integration time:
-
Permalink:
acristoffers/ahio@b503a0c114fbef26392840fd62b3b59b25229b39 -
Branch / Tag:
refs/tags/v1.0.35 - Owner: https://github.com/acristoffers
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@b503a0c114fbef26392840fd62b3b59b25229b39 -
Trigger Event:
push
-
Statement type: