Skip to main content

PCF8574 simulation

This is a Python library you can use when working with the pcf8574 library. It works exactly the same as the original library, but is intended for testing purposes when the I²C-Bus hardware is not connected.

Installation

pip install pcf8574_simulation

Usage

You have different options to use this as an alternative to the original library.

For example, you can import the correct library depending on which is installed on your system:

try:
    from pcf8574 import PCF8574, IOPort
except ImportError:
    print("No I2C bus package found. Starting simulation")
    from pcf8574_simulation import PCF8574, IOPort

Then you can use the PCF8574 class as usual:

pcf = PCF8574(1, 0x20)
print(pcf.port)  # [True, True, True, True, True, True, True, True]
pcf.port[0] = False
print(pcf.port[0])  # False

Release files for pcf8574-simulation 0.0.1

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

Source distribution (sdist)

Source distribution for pcf8574-simulation 0.0.1
File Size Uploaded
pcf8574_simulation-0.0.1.tar.gz 2.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pcf8574-simulation 0.0.1
File Interpreter ABI Platform
pcf8574_simulation-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.9 kB

Release files / pcf8574_simulation-0.0.1.tar.gz

Download URL pcf8574_simulation-0.0.1.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4fb8884fab6ab85a579b0f1be83b44670a6b9fe0ea6c7fe760f22f2201de25d5
BLAKE2b-256 checksum
How to use checksums
fb4685584767ab3c5fbb9ceadf89bb03ec172add63044ec8e45fa85e6c8ada0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / pcf8574_simulation-0.0.1-py3-none-any.whl

Download URL pcf8574_simulation-0.0.1-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3403bfd11462f110bd225515eb045743e9cdd792d8ebc3ba2153968e5fd4d480
BLAKE2b-256 checksum
How to use checksums
0664f1478fbb925fad8b63d3a53799d814f4dc53d48a21db016cf54b792171f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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