Skip to main content

PyPI version Build Status

nptyping

Type hints for Numpy!

Installation

pip install nptyping

Usage

Use the nptyping type hints like the regular type hints from typing:

from nptyping import Array


def func1(arr: Array[int]):  # A numpy.ndarray that contains numbers
    ...

You can also define the shape of an array:

Array[str, 3, 2]    # 3 rows and 2 columns
Array[str, 3]       # 3 rows and an undefined number of columns
Array[str, 3, ...]  # 3 rows and an undefined number of columns
Array[str, ..., 2]  # an undefined number of rows and 2 columns

nptyping also supports instance checks:

import numpy


arr = numpy.array([[1, 2],
                   [3, 4],
                   [5, 6]])

isinstance(arr, Array[int, 3, 2])    # True
isinstance(arr, Array[str, 3, 2])    # False
isinstance(arr, Array[int, 3, ...])  # True
isinstance(arr, Array[int, 3, 6])    # False

Metadata

Release files for nptyping 0.1.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 nptyping 0.1.0
File Size Uploaded Provenance Actions
nptyping-0.1.0.tar.gz 2.1 kB Without provenance Details for nptyping-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nptyping 0.1.0
File Interpreter ABI Platform Actions
nptyping-0.1.0-py3-none-any.whl Python 3 none any Details for nptyping-0.1.0-py3-none-any.whl

Total release size: 4.5 kB

Release files / nptyping-0.1.0.tar.gz

Download URL nptyping-0.1.0.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b922d938c2c6d3e45e2d13bb2bad26ba43c0437384553d5eaa032f22d24064a9
BLAKE2b-256 checksum
How to use checksums
711e99fd126222d9981b69a8727260a21475cb83ff473d33409f282e6b48d747
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.1

Release files / nptyping-0.1.0-py3-none-any.whl

Download URL nptyping-0.1.0-py3-none-any.whl
Size 2.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
342c253beacde491cc709322634aebd355d9438675d8b31207bb9d7533b7109a
BLAKE2b-256 checksum
How to use checksums
9bc5005e477e494af52d153ba0a3ab194c50f1bff60200762634c8e25c856f24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.1

Security for nptyping 0.1.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.

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