Skip to main content

IoT Practical Kit

A small Python package that prints the source code for common Raspberry Pi IoT practicals. It does not execute the displayed programs.

Install for local development

python -m pip install -e .

After publication on PyPI, install with:

python -m pip install iot-practical-kit

Quick start

from iot_practical_kit import p1

p1()  # Prints the complete P1 LED blinking source code only

Available functions

All code comes from the IoT Practical Exam Cheat Sheet.

Function Practical Programs
p1() P1 — LED patterns 6
p6() P6 — 16x2 LCD 6
p7() P7 — RFID RC522 5
p8() P8 — Fingerprint 7
p9() P9 — Pi Camera 7
p10() P10 — Touch + Ultrasonic 6
p11() P11 — Fingerprint + LCD 4
p12() P12 — Smart door lock 4
p14() P14 — Flask app.py 4
p14_html() P14 — templates/index.html (program n pairs with p14(n)) 4
list_practicals() Print the numbered index with a short note for every program
get_code("p1") Return source as a string instead of printing

Run list_practicals() to see every program with a one-line description.

Every practical function (and get_code) takes two optional arguments:

p1()                 # all 5 programs of P1 (BCM numbering)
p1(3)                # only program 3 (running LED)
p10(2)               # only Part C (ultrasonic)
p10(board=True)      # GPIO.BOARD version (physical pin numbers)
get_code("p6", 3)    # scrolling-text program, returned as a string

Output format

Printed code contains no comments at all. When a practical prints several programs together, they are separated by blank lines; use p1(3) to print just one program.

Important notes

  • Calling p1() prints source code; it does not execute the GPIO program.
  • Raspberry Pi-specific code requires compatible Raspberry Pi hardware, libraries, and OS to run.
  • Pin assignments follow BCM numbering by default. Pass board=True for the physical-pin (GPIO.BOARD) version. P7, P8 and P9 are identical in both modes.
  • Check your class handout and wiring before using any snippet. These examples are study templates and may need adjustment for your sensor model, library version, and OS.
  • For HC-SR04 ultrasonic sensors, the ECHO signal is commonly 5V. Raspberry Pi GPIO is 3.3V tolerant: use a suitable voltage divider or level shifter.
  • For fingerprint examples, update the serial port and ensure the sensor is enrolled and connected correctly.
  • The P14 web monitor has two source files: call p14() for app.py and p14_html() for templates/index.html.

Repository structure

iot-practical-kit/
├── pyproject.toml
├── README.md
└── src/
    └── iot_practical_kit/
        ├── __init__.py
        └── practicals.py

License

MIT

Metadata

Release files for iot-practical-kit 0.2.0

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

Source distribution (sdist)

Source distribution for iot-practical-kit 0.2.0
File Size Uploaded Provenance Actions
iot_practical_kit-0.2.0.tar.gz 13.9 kB Without provenance Details for iot_practical_kit-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for iot-practical-kit 0.2.0
File Interpreter ABI Platform Actions
iot_practical_kit-0.2.0-py3-none-any.whl Python 3 none any Details for iot_practical_kit-0.2.0-py3-none-any.whl

Total release size: 26.8 kB

Release files / iot_practical_kit-0.2.0.tar.gz

Download URL iot_practical_kit-0.2.0.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1f0844220961ace84b2c0c1013fb24a62196a9d70453997a9d26493c33e9758e
BLAKE2b-256 checksum
How to use checksums
f48459af886b2133659e81d9170807a649fa10ed196a342edb2230b6da2afd31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Release files / iot_practical_kit-0.2.0-py3-none-any.whl

Download URL iot_practical_kit-0.2.0-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3e64ca015c80cbc13315a047c6df4c054fc98624f5dc4bb496cc2d3d2352227
BLAKE2b-256 checksum
How to use checksums
7836ecec741cac4aa3bb99dae25b119bb0f652540bc968efda3cb688576a566d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Security for iot-practical-kit 0.2.0

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

0.2.0 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