Code Monkey home page Code Monkey logo

adafruit_circuitpython_gc_iot_core's Introduction

Introduction

Documentation Status

Discord

Build Status

Code Style: Black

Google Cloud IoT Core Client for CircuitPython

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.

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 adafruit-circuitpython-gc-iot-core

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

sudo pip3 install adafruit-circuitpython-gc-iot-core

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-gc-iot-core

Usage Example

Usage example within examples/ folder.

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.

License

This library was written by Google for MicroPython. We've converted it to work with CircuitPython and made changes so it works with boards supported by CircuitPython and the CircuitPython API.

We've added examples for using this library to transmit board telemetry data along with sensor data to Google's Cloud Platform.

This open source code is licensed under the Apache license (see LICENSE) for details.

adafruit_circuitpython_gc_iot_core's People

Contributors

2bndy5 avatar brentru avatar dhalbert avatar evaherrada avatar foamyguy avatar geudrik avatar julianorteil avatar justmobilize avatar kattni avatar ladyada avatar neradoc avatar ntoll avatar siddacious avatar sommersoft avatar tannewt avatar tekktrik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_circuitpython_gc_iot_core's Issues

Import depth is too deep - max recursion stack traces being thrown on import

FeatherS2 running 7.0.0, using the 7.0.0 libraries

>>> from adafruit_gc_iot_core import MQTT_API, Cloud_Core
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_gc_iot_core.py", line 32, in <module>
  File "adafruit_jwt.py", line 32, in <module>
  File "adafruit_rsa/__init__.py", line 16, in <module>
  File "adafruit_rsa/key.py", line 27, in <module>
  File "adafruit_rsa/prime.py", line 13, in <module>
  File "adafruit_rsa/randnum.py", line 12, in <module>
  File "adafruit_rsa/transform.py", line 14, in <module>
  File "adafruit_binascii.py", line 57, in <module>
RuntimeError: maximum recursion depth exceeded
>>> 

Missing Type Annotations

There are missing type annotations for some functions in this library.

The typing module does not exist on CircuitPython devices so the import needs to be wrapped in try/except to catch the error for missing import. There is an example of how that is done here:

try:
    from typing import List, Tuple
except ImportError:
    pass

Once imported the typing annotations for the argument type(s), and return type(s) can be added to the function signature. Here is an example of a function that has had this done already:

def wrap_text_to_pixels(
    string: str, max_width: int, font=None, indent0: str = "", indent1: str = ""
) -> List[str]:

If you are new to Git or Github we have a guide about contributing to our projects here: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github

There is also a guide that covers our CI utilities and how to run them locally to ensure they will pass in Github Actions here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code In particular the pages: Sharing docs on ReadTheDocs and Check your code with pre-commit contain the tools to install and commands to run locally to run the checks.

If you are attempting to resolve this issue and need help, you can post a comment on this issue and tag both @FoamyGuy and @kattni or reach out to us on Discord: https://adafru.it/discord in the #circuitpython-dev channel.

The following locations are reported by mypy to be missing type annotations:

  • adafruit_gc_iot_core.py:53
  • adafruit_gc_iot_core.py:103
  • adafruit_gc_iot_core.py:140
  • adafruit_gc_iot_core.py:153
  • adafruit_gc_iot_core.py:163
  • adafruit_gc_iot_core.py:171
  • adafruit_gc_iot_core.py:179
  • adafruit_gc_iot_core.py:200
  • adafruit_gc_iot_core.py:219
  • adafruit_gc_iot_core.py:232
  • adafruit_gc_iot_core.py:241
  • adafruit_gc_iot_core.py:249
  • adafruit_gc_iot_core.py:256
  • adafruit_gc_iot_core.py:279
  • adafruit_gc_iot_core.py:299
  • adafruit_gc_iot_core.py:332

May need update due to `adafruit_logging` 4.0.0

This library likely needs updates due to the adafruit_logging library upgrade. New use should be CPython compatible, and it may be worth allowing the CPython logging module to be imported if available.

Some common issues that are now present across libraries:

  • Locations of classes have changed, and some may have been removed.
  • PrintLogger no longer exists; instead, instance a Logger and add a StreamHandler instance with default arguments as the handler.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.