Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file modified data/all_packages.db
Binary file not shown.
21 changes: 21 additions & 0 deletions data/stub-packages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
{
"$schema": "https://raw.githubusercontent.com/Josverl/micropython-stubber/main/data/schema/packages-v1.0.0.json",
"packages": [
[
"micropython-mimxrt-mimxrt1010_evk-stubs",
"1.26.1",
"mimxrt",
"MIMXRT1010_EVK",
""
],
[
"micropython-mimxrt-seeed_arch_mix-stubs",
"1.26.1",
"mimxrt",
"SEEED_ARCH_MIX",
""
],
[
"micropython-mimxrt-stubs",
"1.26.1",
"mimxrt",
"GENERIC",
""
],
[
"micropython-esp32-esp32_generic-stubs",
"1.26.0",
Expand Down
22 changes: 22 additions & 0 deletions publish/micropython-v1_26_1-mimxrt-mimxrt1010_evk-stubs/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2022 Jos Verlinde

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

38 changes: 38 additions & 0 deletions publish/micropython-v1_26_1-mimxrt-mimxrt1010_evk-stubs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# micropython-mimxrt-mimxrt1010_evk-stubs


This is a stub-only package for MicroPython.
It is intended to be installed in a projects virtual environment to allow static type checkers and intellisense features to be used while writing Micropython code.

The version of this package is alligned the the version of the MicroPython firmware.
- Major, Minor and Patch levels are alligned to the same version as the firmware.
- The post release level is used to publish new releases of the stubs.

For `Micropython 1.17` the stubs are published as `1.17.post1` ... `1.17.post2`
for `Micropython 1.18` the stubs are published as `1.18.post1` ... `1.18.post2`

To install the latest stubs:
`pip install -I micropython-<port>-stubs` where port is the port of the MicroPython firmware.

To install the stubs for an older version, such as MicroPython 1.17:
`pip install micropython-stm32-stubs==1.17.*` which will install the last post release of the stubs for MicroPython 1.17.


As the creation of the stubs, and merging of the different types is still going though improvements, the stub packages are marked as Beta.
To upgrade stubs to the latest stubs for a specific version use `pip install micropython-stm32-stubs==1.17.* --upgrade`

If you have suggestions or find any issues with the stubs, please report them in the [MicroPython-stubs Discussions](https://github.com/Josverl/micropython-stubs/discussions)

For an overview of Micropython Stubs please see: https://micropython-stubs.readthedocs.io/en/main/
* List of all stubs : https://micropython-stubs.readthedocs.io/en/main/firmware_grp.html



Included stubs:
* Merged stubs from `stubs/micropython-v1_26_1-mimxrt-MIMXRT1010_EVK-merged`
* Frozen stubs from `stubs/micropython-v1_26_1-frozen/mimxrt/GENERIC`
* Core stubs from `stubs/micropython-core`


origin | Family | Port | Board | Version
-------|--------|------|-------|--------
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""Allows for type checking of Micropython specific builtins by pyright and pylance.
"""

from typing import Tuple, TypeVar

Const_T = TypeVar("Const_T", int, float, str, bytes, Tuple) # constant

def const(expr: Const_T) -> Const_T:
"""
Used to declare that the expression is a constant so that the compiler can
optimise it. The use of this function should be as follows::

from micropython import const

CONST_X = const(123)
CONST_Y = const(2 * CONST_X + 1)

Constants declared this way are still accessible as global variables from
outside the module they are declared in. On the other hand, if a constant
begins with an underscore then it is hidden, it is not available as a global
variable, and does not take up any memory during execution.

This `const` function is recognised directly by the MicroPython parser and is
provided as part of the :mod:`micropython` module mainly so that scripts can be
written which run under both CPython and MicroPython, by following the above
pattern.
"""
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from _typeshed import Incomplete
from machine import Pin as Pin

bdev: Incomplete
fs: Incomplete
sdcard: Incomplete
fat: Incomplete
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
Module: '_onewire' on micropython-v1.26.1-mimxrt-MIMXRT1010_EVK
"""

# MCU: {'variant': '', 'build': '', 'arch': 'armv7emsp', 'port': 'mimxrt', 'board': 'MIMXRT1010_EVK', 'board_id': 'MIMXRT1010_EVK', 'mpy': 'v6.3', 'ver': '1.26.1', 'family': 'micropython', 'cpu': 'MIMXRT1011DAE5A', 'version': '1.26.1'}
# Stubber: v1.26.3
from __future__ import annotations
from _typeshed import Incomplete

def reset(*args, **kwargs) -> Incomplete: ...
def writebyte(*args, **kwargs) -> Incomplete: ...
def writebit(*args, **kwargs) -> Incomplete: ...
def crc8(*args, **kwargs) -> Incomplete: ...
def readbyte(*args, **kwargs) -> Incomplete: ...
def readbit(*args, **kwargs) -> Incomplete: ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
"""
Binary/ASCII conversions.

MicroPython module: https://docs.micropython.org/en/v1.26.0/library/binascii.html

CPython module: :mod:`python:binascii` https://docs.python.org/3/library/binascii.html .

This module implements conversions between binary data and various
encodings of it in ASCII form (in both directions).

---
Module: 'binascii' on micropython-v1.26.1-mimxrt-MIMXRT1010_EVK
"""

# MCU: {'variant': '', 'build': '', 'arch': 'armv7emsp', 'port': 'mimxrt', 'board': 'MIMXRT1010_EVK', 'board_id': 'MIMXRT1010_EVK', 'mpy': 'v6.3', 'ver': '1.26.1', 'family': 'micropython', 'cpu': 'MIMXRT1011DAE5A', 'version': '1.26.1'}
# Stubber: v1.26.3
from __future__ import annotations
from _typeshed import Incomplete
from typing import Any, Optional
from typing_extensions import Awaitable, TypeAlias, TypeVar

def crc32(data, value: Optional[Any] = None) -> Incomplete:
"""
Compute CRC-32, the 32-bit checksum of *data*, starting with an initial CRC
of *value*. The default initial CRC is zero. The algorithm is consistent
with the ZIP file checksum.
"""
...

def hexlify(data: bytes, sep: str | bytes = ..., /) -> bytes:
"""
Convert the bytes in the *data* object to a hexadecimal representation.
Returns a bytes object.

If the additional argument *sep* is supplied it is used as a separator
between hexadecimal values.
"""
...

def unhexlify(data: str | bytes, /) -> bytes:
"""
Convert hexadecimal data to binary representation. Returns bytes string.
(i.e. inverse of hexlify)
"""
...

def b2a_base64(data: bytes, /) -> bytes:
"""
Encode binary data in base64 format, as in `RFC 3548
<https://tools.ietf.org/html/rfc3548.html>`_. Returns the encoded data
followed by a newline character if newline is true, as a bytes object.
"""
...

def a2b_base64(data: str | bytes, /) -> bytes:
"""
Decode base64-encoded data, ignoring invalid characters in the input.
Conforms to `RFC 2045 s.6.8 <https://tools.ietf.org/html/rfc2045#section-6.8>`_.
Returns a bytes object.
"""
...
84 changes: 84 additions & 0 deletions publish/micropython-v1_26_1-mimxrt-mimxrt1010_evk-stubs/cmath.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
"""
Mathematical functions for complex numbers.

MicroPython module: https://docs.micropython.org/en/v1.26.0/library/cmath.html

CPython module: :mod:`python:cmath` https://docs.python.org/3/library/cmath.html .

The ``cmath`` module provides some basic mathematical functions for
working with complex numbers.

Availability: not available on WiPy and ESP8266. Floating point support
required for this module.

---
Module: 'cmath' on micropython-v1.26.1-mimxrt-MIMXRT1010_EVK
"""

# MCU: {'variant': '', 'build': '', 'arch': 'armv7emsp', 'port': 'mimxrt', 'board': 'MIMXRT1010_EVK', 'board_id': 'MIMXRT1010_EVK', 'mpy': 'v6.3', 'ver': '1.26.1', 'family': 'micropython', 'cpu': 'MIMXRT1011DAE5A', 'version': '1.26.1'}
# Stubber: v1.26.3
from __future__ import annotations
from _typeshed import Incomplete
from typing import SupportsComplex, SupportsFloat, SupportsIndex, Tuple
from typing_extensions import Awaitable, TypeAlias, TypeVar

_C: TypeAlias = SupportsFloat | SupportsComplex | SupportsIndex | complex

e: float = 2.7182818
"""base of the natural logarithm"""
pi: float = 3.1415928
"""the ratio of a circle's circumference to its diameter"""

def polar(z: _C, /) -> Tuple:
"""
Returns, as a tuple, the polar form of ``z``.
"""
...

def sqrt(z: _C, /) -> complex:
"""
Return the square-root of ``z``.
"""
...

def rect(r: float, phi: float, /) -> float:
"""
Returns the complex number with modulus ``r`` and phase ``phi``.
"""
...

def sin(z: _C, /) -> float:
"""
Return the sine of ``z``.
"""
...

def exp(z: _C, /) -> float:
"""
Return the exponential of ``z``.
"""
...

def cos(z: _C, /) -> float:
"""
Return the cosine of ``z``.
"""
...

def phase(z: _C, /) -> float:
"""
Returns the phase of the number ``z``, in the range (-pi, +pi].
"""
...

def log(z: _C, /) -> float:
"""
Return the natural logarithm of ``z``. The branch cut is along the negative real axis.
"""
...

def log10(z: _C, /) -> float:
"""
Return the base-10 logarithm of ``z``. The branch cut is along the negative real axis.
"""
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
"""
Deflate compression & decompression.

MicroPython module: https://docs.micropython.org/en/v1.26.0/library/deflate.html

This module allows compression and decompression of binary data with the
`DEFLATE algorithm <https://en.wikipedia.org/wiki/DEFLATE>`_
(commonly used in the zlib library and gzip archiver).

**Availability:**

* Added in MicroPython v1.21.

* Decompression: Enabled via the ``MICROPY_PY_DEFLATE`` build option, on by default
on ports with the "extra features" level or higher (which is most boards).

* Compression: Enabled via the ``MICROPY_PY_DEFLATE_COMPRESS`` build option, on
by default on ports with the "full features" level or higher (generally this means
you need to build your own firmware to enable this).

---
Module: 'deflate' on micropython-v1.26.1-mimxrt-MIMXRT1010_EVK
"""

# MCU: {'variant': '', 'build': '', 'arch': 'armv7emsp', 'port': 'mimxrt', 'board': 'MIMXRT1010_EVK', 'board_id': 'MIMXRT1010_EVK', 'mpy': 'v6.3', 'ver': '1.26.1', 'family': 'micropython', 'cpu': 'MIMXRT1011DAE5A', 'version': '1.26.1'}
# Stubber: v1.26.3
from __future__ import annotations
from typing import Final
from _typeshed import Incomplete
from typing_extensions import Awaitable, TypeAlias, TypeVar

GZIP: Final[int] = 3
"""Supported values for the *format* parameter."""
RAW: Final[int] = 1
"""Supported values for the *format* parameter."""
ZLIB: Final[int] = 2
"""Supported values for the *format* parameter."""
AUTO: Final[int] = 0
"""Supported values for the *format* parameter."""

class DeflateIO:
"""
This class can be used to wrap a *stream* which is any
:term:`stream-like <stream>` object such as a file, socket, or stream
(including :class:`io.BytesIO`). It is itself a stream and implements the
standard read/readinto/write/close methods.

The *stream* must be a blocking stream. Non-blocking streams are currently
not supported.

The *format* can be set to any of the constants defined below, and defaults
to ``AUTO`` which for decompressing will auto-detect gzip or zlib streams,
and for compressing it will generate a raw stream.

The *wbits* parameter sets the base-2 logarithm of the DEFLATE dictionary
window size. So for example, setting *wbits* to ``10`` sets the window size
to 1024 bytes. Valid values are ``5`` to ``15`` inclusive (corresponding to
window sizes of 32 to 32k bytes).

If *wbits* is set to ``0`` (the default), then for compression a window size
of 256 bytes will be used (as if *wbits* was set to 8). For decompression, it
depends on the format:

* ``RAW`` will use 256 bytes (corresponding to *wbits* set to 8).
* ``ZLIB`` (or ``AUTO`` with zlib detected) will use the value from the zlib
header.
* ``GZIP`` (or ``AUTO`` with gzip detected) will use 32 kilobytes
(corresponding to *wbits* set to 15).

See the :ref:`window size <deflate_wbits>` notes below for more information
about the window size, zlib, and gzip streams.

If *close* is set to ``True`` then the underlying stream will be closed
automatically when the :class:`deflate.DeflateIO` stream is closed. This is
useful if you want to return a :class:`deflate.DeflateIO` stream that wraps
another stream and not have the caller need to know about managing the
underlying stream.

If compression is enabled, a given :class:`deflate.DeflateIO` instance
supports both reading and writing. For example, a bidirectional stream like
a socket can be wrapped, which allows for compression/decompression in both
directions.
"""
def readinto(self, *args, **kwargs) -> Incomplete: ...
def readline(self, *args, **kwargs) -> Incomplete: ...
def write(self, *args, **kwargs) -> Incomplete: ...
def read(self, *args, **kwargs) -> Incomplete: ...
def close(self, *args, **kwargs) -> Incomplete: ...
def __init__(self, stream, format=AUTO, wbits=0, close=False, /) -> None: ...
15 changes: 15 additions & 0 deletions publish/micropython-v1_26_1-mimxrt-mimxrt1010_evk-stubs/dht.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from _typeshed import Incomplete

class DHTBase:
pin: Incomplete
buf: Incomplete
def __init__(self, pin) -> None: ...
def measure(self) -> None: ...

class DHT11(DHTBase):
def humidity(self): ...
def temperature(self): ...

class DHT22(DHTBase):
def humidity(self): ...
def temperature(self): ...
Loading