Skip to main content

Use the Uiua array programming language from Python

Project description

UiuaPy

A bridge between Uiua and NumPy - enabling you to do tacit array processing in Python.

Installation

pip install uiuapy

If building the source distribution, rather than installing a precompiled wheel, you will need to have rustup installed on your machine.

Usage

import uiua

print(uiua.compile('/+')([1, 2, 3]))
# 6.0

print(uiua.compile('⌕')('ab', 'abracabra')) 
# [1 0 0 0 0 1 0 0 0]

Flags

You can allow thread spawning either specific to a program, or specific to an invocation. Invocation flags take precedence over program flags.

import numpy as np
import uiua

xs = np.linspace(0, 1, 10_000)

print(uiua.compile('/+', allow_threads=True)(xs))
# 50000.0

print(uiua.compile('/+')(xs, allow_threads=True))
# 50000.0

NumPy integration

UiuaPy uses the NumPy C-API for taking in Python inputs and returning Python results.

Uiua supports 5 data-types for arrays/scalars:

Uiua type NumPy equivalent dtype
Num float64
Byte uint8
Complex complex128
Char Unicode (32-bit characters)
Box object

If you pass in a NumPy array that does not have one of the above dtypes, it will be automatically converted according to the table below:

NumPy dtype Converted NumPy dtype Uiua type
float32 float64 Num
uint64 float64 Num
uint32 float64 Num
uint16 float64 Num
int64 float64 Num
int32 float64 Num
int16 float64 Num
bool uint8 Byte

Interfacing overhead

Passing a numpy array to uiua requires copying its memory (using memcpy/ std::ptr::copy_nonoverlapping in Rust). The same is true for the values returned from the Uiua computation.

If using anything other than float64, uint8, complex128 or unicode data - there are also type conversion costs to take into account.

Development

Dependencies

# Format code
uv run ruff format
cargo fmt

# Fix/report lints
uv run ruff check --fix
cargo clippy

# Run tests
uv run pytest

# Build wheels
uv build

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uiuapy-0.2.0.tar.gz (36.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

uiuapy-0.2.0-cp313-cp313-win_amd64.whl (9.5 MB view details)

Uploaded CPython 3.13Windows x86-64

uiuapy-0.2.0-cp313-cp313-manylinux_2_28_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

uiuapy-0.2.0-cp313-cp313-macosx_15_0_arm64.whl (9.1 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

uiuapy-0.2.0-cp312-cp312-win_amd64.whl (9.5 MB view details)

Uploaded CPython 3.12Windows x86-64

uiuapy-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

uiuapy-0.2.0-cp312-cp312-macosx_15_0_arm64.whl (9.1 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

uiuapy-0.2.0-cp311-cp311-win_amd64.whl (9.5 MB view details)

Uploaded CPython 3.11Windows x86-64

uiuapy-0.2.0-cp311-cp311-manylinux_2_28_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

uiuapy-0.2.0-cp311-cp311-macosx_11_0_universal2.whl (9.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ universal2 (ARM64, x86-64)

uiuapy-0.2.0-cp310-cp310-win_amd64.whl (9.5 MB view details)

Uploaded CPython 3.10Windows x86-64

uiuapy-0.2.0-cp310-cp310-manylinux_2_28_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

uiuapy-0.2.0-cp310-cp310-macosx_11_0_arm64.whl (9.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

uiuapy-0.2.0-cp39-cp39-win_amd64.whl (9.5 MB view details)

Uploaded CPython 3.9Windows x86-64

uiuapy-0.2.0-cp39-cp39-manylinux_2_28_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

uiuapy-0.2.0-cp39-cp39-macosx_11_0_universal2.whl (9.1 MB view details)

Uploaded CPython 3.9macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file uiuapy-0.2.0.tar.gz.

File metadata

  • Download URL: uiuapy-0.2.0.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for uiuapy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bc1f8b4397b00dfdca529bce4339c7e2a8bdf9bc7c7a0edd6a664b83b5de5c50
MD5 268951314d0987a7a8aadfa92ad0d017
BLAKE2b-256 e2054c522004df83b988555928d976f8945d223a39704b51f98abf4a46558562

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0.tar.gz:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: uiuapy-0.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 9.5 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for uiuapy-0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6ac840afbd8ddf45acb43c6b59d06ee4feeed1b1d1b455d1c89cae48e75cc314
MD5 10d7de24c67e3cbe1b362d7b0bdc73a3
BLAKE2b-256 7c24e9cd7e6a8a184f3af421c74b25f04b226828f48ff911f89aa873f225ef3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp313-cp313-win_amd64.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uiuapy-0.2.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8ed6f1b0af7d545e44a0c4a8edf0c945c604d55a78a5c42c421622f44a7a0716
MD5 7fccf727b63c110dcf0fca229ba8e6bd
BLAKE2b-256 2bda07e5d9cbc6b8c612f207f14c1f295387d4cddaf44abe6b56a3f5ba677163

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for uiuapy-0.2.0-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 97766f4c087a3bdad07280d7778c9604800eac9a80aaed8973ce03a09b6f0dc7
MD5 07d8dfc21984634e94c2fb19a2b79c8d
BLAKE2b-256 b3a5d6870ff431c32ebfb211165d1f6dfca918bc271785885b91452f44541ab0

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp313-cp313-macosx_15_0_arm64.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: uiuapy-0.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 9.5 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for uiuapy-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c80cdfee7736315f9f1ece23088fdec24b92520c417e98077492c22c71bf20bb
MD5 23744a6167528d6cdadd18a2933ed254
BLAKE2b-256 da3946e55e1009f83230563abacc3c3e47d2d8581378763b9ad3866b25c76291

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp312-cp312-win_amd64.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uiuapy-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 24cea6d98d1957305e815a9ddeab77e287fb4af58a8d3ca3ffe55be90495cf91
MD5 ed1e6ba8827496187193981b17bf2412
BLAKE2b-256 9e57792e22cfbc8ebae4c4fa10d3256c286ec716703f379a443f86289bd480dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for uiuapy-0.2.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8dfe8b2b54aa25924db2fea94bdb152638ad89834153b207c836f11eb8dfd317
MD5 05147844ffaddc7d4329de4ee6b0eecb
BLAKE2b-256 8f8e89d66d1fc20266281e9a8172d63a015d7fbb22088a8dd15100f8a1090a13

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp312-cp312-macosx_15_0_arm64.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: uiuapy-0.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 9.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for uiuapy-0.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f024a05ffe3621ef70a4dde887a5e5349566ffb9988ca433dcb750a2c2ed19d0
MD5 5de0f7e9267b3cea2168177b29a5030a
BLAKE2b-256 ce8ecb1f8411f5dbb479b0dbca5de4360b213f5b7a398140e73449f76591f831

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp311-cp311-win_amd64.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uiuapy-0.2.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8df8b46e3db514cec6238915f1f96761268ad83c49409482f8e768bcb59ec5f1
MD5 181826461ee2c8eef71a0207ec129ebe
BLAKE2b-256 7eecb7ddc2fedf3318f40fafce2ad99c83903b65149edf63c61e5ae9ca1ec042

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp311-cp311-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for uiuapy-0.2.0-cp311-cp311-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 3d9f8be72de33f3ec10015a75ffb87debdd1683c0cfc26b7f169a9d130110f5c
MD5 a6a62d913a56a96147b0c78bc499d335
BLAKE2b-256 d1afdbd1b0f92d2d5bd8a102e740f7f73c7787de28fe844cb51efe445f844eed

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp311-cp311-macosx_11_0_universal2.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: uiuapy-0.2.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 9.5 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for uiuapy-0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fbbe146cc8d82b2c9178691988760e5bd3a6dd85379e9c30af7a45e841f9057f
MD5 acc639fdd95951eb377f927312250f70
BLAKE2b-256 7f45fe1e54cb9ad9ecd464603edfe06b410a4c69de4336a72b8a03cd24aafac7

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp310-cp310-win_amd64.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uiuapy-0.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5cf8ff5ab42857109b297b338328254c909ace874481239c789c6a5c7e8d9f23
MD5 e6f40771089b13bd01b7cbaf2f2877c7
BLAKE2b-256 87cdbed75b3bcb930ffe1f94bc57af0c35007e8964d57abe8bf0e7b68d0a0a3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for uiuapy-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7f9915023206212b34aa02a7b0f6a04fde32dbe3b16addd4d3e5d9787b1f5e65
MD5 b67f5c6c6f94358973c529cddefdfe89
BLAKE2b-256 cad09bd9f3c4c209c5b1b7723b7bae9b05caef5fc4f9759e5613802224ddeded

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: uiuapy-0.2.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 9.5 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for uiuapy-0.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e58b149660c639fb4a2e38ae9d16458f56e9a69a02cbe03480abc4cf7c278c24
MD5 3f086eb8547c1b6a6d0385cfccae678d
BLAKE2b-256 8f81832dc8bf66818c0e5df9347558e6cd5875b02876cafedb7ab8a54adf3437

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp39-cp39-win_amd64.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uiuapy-0.2.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 08059b56bd87a833ed8a233ea82dd3df62baadc21c79730e09912190eb4fc4e3
MD5 31f07709d33cc394fd30535ccd73ec12
BLAKE2b-256 69a903e6812e50a9513a55db59d536e87ad84f477df7a92a36798169dd511d62

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp39-cp39-manylinux_2_28_x86_64.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uiuapy-0.2.0-cp39-cp39-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for uiuapy-0.2.0-cp39-cp39-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 cf1578d95a5c87b672b3913438658ef88d229decd9cfee4c14cc598c4c96e997
MD5 f1bbbae22b8e1106e2853d70f5489e43
BLAKE2b-256 f7b01ff0db56b03bd504a5c4870629144170b07196650c1e50cdabf6c63fda32

See more details on using hashes here.

Provenance

The following attestation bundles were made for uiuapy-0.2.0-cp39-cp39-macosx_11_0_universal2.whl:

Publisher: build-and-publish.yml on bergkvist/uiuapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page