Skip to main content

Introduction

Documentation Status Discord Build Status CodeCov Metrics Code Style: Ruff License: MIT License: PSF-2.0 Maintained: Yes

Supercharge your CircuitPython classes similar to CPython dataclasses

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install circuitpython-nitroclass

To install system-wide (this may be required in some cases):

sudo pip3 install circuitpython-nitroclass

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install circuitpython-nitroclass

Installing to a Connected CircuitPython Device with Circup

Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:

pip3 install circup

With circup installed and your CircuitPython device connected use the following command to install:

circup install circuitpython_nitroclass

Or the following command to update an existing version:

circup update

Usage Example

from circuitpython_nitroclass import field, nitroclass

@nitroclass
class DataPacket:
    req = field(type=int)
    dyn = field(default_factory=list)
    cls_var = "a"


# NOTE: Due to CircuitPython implementation details, fields must be provided by keyword ONLY!

x = DataPacket(req=1)
y = DataPacket(req=2)

assert x != y

x.req = 2

assert x == y

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Metadata

Release files for circuitpython-nitroclass 1.0.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 circuitpython-nitroclass 1.0.0
File Size Uploaded
circuitpython_nitroclass-1.0.0.tar.gz 30.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for circuitpython-nitroclass 1.0.0
File Interpreter ABI Platform
circuitpython_nitroclass-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.0 kB

Release files / circuitpython_nitroclass-1.0.0.tar.gz

Download URL circuitpython_nitroclass-1.0.0.tar.gz
Size 30.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9b4625d13ba327fc5b28e27499cf8ac5ff6d890c475bde19ea0c205fe070e316
BLAKE2b-256 checksum
How to use checksums
d4e840f60155e18e0ce0cb3f06872e552d5881679a815d2a86607e6271081d24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / circuitpython_nitroclass-1.0.0-py3-none-any.whl

Download URL circuitpython_nitroclass-1.0.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34ad7c6f50f1017141f995f2cf0ce4022117f7eea72d4d6412fd8f637edfbf13
BLAKE2b-256 checksum
How to use checksums
ba30f0382e9c72ac653482f598d78c58796e7d9b3a00aa4790f3e4c63ea12a18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

1.0.0 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