Metadata-Version: 2.4
Name: Mock.GPIO
Version: 0.2.0
Summary: Mock Library for RPi.GPIO
Home-page: https://github.com/codenio/
Author: Aananth K
Author-email: Aananth K <aananthraj1995@gmail.com>
License-Expression: GPL-3.0-only
Project-URL: Homepage, https://github.com/codenio/Mock.GPIO
Project-URL: Repository, https://github.com/codenio/Mock.GPIO
Project-URL: Issues, https://github.com/codenio/Mock.GPIO/issues
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: backports.tarfile==1.2.0
Requires-Dist: certifi==2024.8.30
Requires-Dist: charset-normalizer==3.4.0
Requires-Dist: docutils==0.21.2
Requires-Dist: idna==3.10
Requires-Dist: importlib_metadata==8.5.0
Requires-Dist: jaraco.classes==3.4.0
Requires-Dist: jaraco.context==6.0.1
Requires-Dist: jaraco.functools==4.1.0
Requires-Dist: keyring==25.5.0
Requires-Dist: markdown-it-py==3.0.0
Requires-Dist: mdurl==0.1.2
Requires-Dist: more-itertools==10.5.0
Requires-Dist: nh3==0.2.18
Requires-Dist: pkginfo==1.10.0
Requires-Dist: Pygments==2.18.0
Requires-Dist: readme_renderer==44.0
Requires-Dist: requests==2.32.4
Requires-Dist: requests-toolbelt==1.0.0
Requires-Dist: rfc3986==2.0.0
Requires-Dist: rich==13.9.4
Requires-Dist: twine>=6.0.1
Requires-Dist: typing_extensions==4.12.2
Requires-Dist: urllib3==2.5.0
Requires-Dist: zipp==3.21.0
Dynamic: author
Dynamic: home-page
Dynamic: license-file

# Mock.GPIO

Mock Library for RPi.GPIO.

Mock.GPIO helps you develop and debug GPIO-dependent code outside a Raspberry Pi (e.g. on macOS/Linux) while keeping the same API as `RPi.GPIO`. It prints intended actions when running off-device and works as a drop-in replacement on-device without code changes.

### Installation

```bash
pip3 install Mock.GPIO
```

### Quick start

```python
try:
    import RPi.GPIO as GPIO
except Exception:
    import Mock.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(15, GPIO.OUT)
GPIO.output(15, GPIO.HIGH)
```

### Supported API surface

- GPIO.setmode(), GPIO.getmode(), GPIO.setwarnings(), GPIO.setup(), GPIO.output(), GPIO.input()
- GPIO.wait_for_edge(), GPIO.add_event_detect(), GPIO.event_detected(), GPIO.add_event_callback(), GPIO.remove_event_detect()
- GPIO.gpio_function(), GPIO.start(), GPIO.ChangeFrequency(), GPIO.ChangeDutyCycle(), GPIO.stop(), GPIO.cleanup()

### Supported versions

- Python: 3.8–3.12

## Documentation

- [Library Overview](https://htmlpreview.github.io/?https://github.com/codenio/Mock.GPIO/blob/master/docs/Mock.GPIO.html)
- [Examples](examples)

## Development

This repo includes a standard `Makefile`.

```bash
# one-time setup
make requirements

# run tests
make test

# install locally (editable)
make dev-install

# build & publish
make build
make publish-test
make publish
```

Alternatively, you can use the scripts under `scripts/` directly.

## Contributing

Contributions are welcome! Please open an issue or submit a PR.

## License

Licensed under GPL-3.0. See `LICENSE`.
