Skip to main content

GPIO_Calculator

Simple GPIO calculator for libgpiod based on its chardev using the formula chardev = (alphabet_index - 1) * 32 + pin which is also used on sysfs.

Installation

pip install git+https://github.com/yeyeto2788/GPIO_Calculator

Usage

from gpio_calculator import Calculator

calculator = Calculator()

# Get chardev based on pin letter and pin number.
# Return should be 242
calculator.get_chardev("H", 18)

# Get chardev from list.
# Returns a list of converted items [242, 243, 244].
calculator.get_chardevs(["H18", "H19", "H20"])

# Get pin from chardev.
# Returns the pin number H18.
calculator.get_pin(242)

# Get all pins from chardevs.
# Returns all pins found H18, H19, H20.
calculator.get_pins([242, 243, 244])

Contributing

All contributions, pull requests and comments are welcome!

When contributing it is important to test the module in order to make sure everything is working as expected. For that install dependencies to run the tests.

pip install pytest pytest-cov mock pylint

Running tests and see coverage.

py.test --cov -v --cov-config=.coveragerc --cov-report=html

This will generate a report with the coverage which is at 98% now, let’s try to keep it at the same percentage.

Metadata

Release files for GPIO-Calculator 1.0.2

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

Source distribution (sdist)

Source distribution for GPIO-Calculator 1.0.2
File Size Uploaded Provenance Actions
GPIO-Calculator-1.0.2.tar.gz 10.0 kB Without provenance Details for GPIO-Calculator-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for GPIO-Calculator 1.0.2
File Interpreter ABI Platform Actions
GPIO_Calculator-1.0.2-py3-none-any.whl Python 3 none any Details for GPIO_Calculator-1.0.2-py3-none-any.whl

Total release size: 14.4 kB

Release files / GPIO-Calculator-1.0.2.tar.gz

Download URL GPIO-Calculator-1.0.2.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
560f86e3f316970fc2f1c2392310b1116af1d9c2b510214eba70a778d336ad1a
BLAKE2b-256 checksum
How to use checksums
1f942cbd06a3f3f90c1b22b07312115479071bfdcb5eb12d6ac579c4434c152f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

Release files / GPIO_Calculator-1.0.2-py3-none-any.whl

Download URL GPIO_Calculator-1.0.2-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
856e0ffdb656826e2e2dbdc24ebec0d64f1ee48dff382f1c2cb33afae1cc3b58
BLAKE2b-256 checksum
How to use checksums
35305d3bc118131a7d09adbae3e874a3b57ccb8ba6c1586f5ff966f9141b0acc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

Security for GPIO-Calculator 1.0.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.2 This release

2 release files No 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