Skip to main content

Python bindings for the Uiua programming language.

Project description

PyUiua

A Python binding for Uiua, allowing interaction between Uiua and Python.

Requirements

  • Python 3.10 or higher

Installation

pip install pyuiua

or see dev setup below for building from source

Example Usage

Basic Usage

import pyuiua

# Create a Uiua instance
uiua = pyuiua.Uiua()

# Basic evaluation - run code and pop result
uiua.run("/×⇡₁10") # Calculate 10 factorial
print(uiua.pop())  # 3628800

# Push Python values onto the stack
uiua.push(10)
uiua.push(20)
uiua.run("+") # Then run a Uiua operation
print(uiua.pop())  # 30

# Work with arrays
uiua.push([1, 2, 3, 4, 5])
uiua.run("/+")  # Sum the array
print(uiua.pop())  # 15

# Inspect the stack without modifying it
uiua.push(1)
uiua.push(2)
uiua.push(3)
print(uiua.stack())  # [3, 2, 1]
print(len(uiua))     # 3

# Clear the stack
uiua.clear()

API Reference

Uiua() - Create a Uiua instance

  • uiua.push(value) - Push a Python value onto the stack
  • uiua.pop() - Pop a value from the stack and return it as a python object
  • uiua.run(code) - Execute Uiua code on the current stack
  • uiua.stack() - Inspect the stack without modifying it
  • uiua.clear() - Remove all values from the stack
  • len(uiua) - Get the number of values on the stack

Type Conversions

The conversion of types is currently lossy. Both arrays and boxes convert to lists in Python, and Python lists convert to an array if they're homogeneous with a well-defined shape, otherwise a box. As a result, a box in Uiua of homogeneous values will become an array when converted to python and back.

  • Currently supports: most scalars, multidimensional arrays, and boxed arrays
  • Does not yet support: complex numbers, maps, functions, or user-defined types

Uiua → Python

Uiua Type Python Type
Scalar number int or float
Scalar char str
Scalar byte int
1D Array list
Multi-dimensional Array Nested list
Box Array (heterogeneous) list

Python → Uiua

Python Type Uiua Type
int Scalar number
float Scalar number
str Character array/string
list (homogeneous) Array
list (heterogeneous) Box Array

Development

Requirements

  • rustup (Rust installer)
  • uv (Python package manager)

Set-up

# Clone
git clone https://github.com/KatieLG/python-uiua.git
cd python-uiua

# Install dependencies
uv sync

# Build and install
uv run maturin develop

Dev Commands

Command Purpose
make dev Rebuild after making changes to Rust code
make test Run unit tests
make lint Run linters and type checkers
make format Auto-format code
make check Format, lint, and test
make build Build wheel for distribution
make test-release Publish to TestPyPI
make release Publish to PyPI

Links

Project details


Download files

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

Source Distribution

pyuiua-0.0.3.tar.gz (49.4 kB view details)

Uploaded Source

Built Distributions

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

pyuiua-0.0.3-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.0 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

pyuiua-0.0.3-cp314-cp314-win_amd64.whl (10.0 MB view details)

Uploaded CPython 3.14Windows x86-64

pyuiua-0.0.3-cp314-cp314-win32.whl (8.8 MB view details)

Uploaded CPython 3.14Windows x86

pyuiua-0.0.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

pyuiua-0.0.3-cp314-cp314-macosx_11_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

pyuiua-0.0.3-cp313-cp313-win_amd64.whl (10.0 MB view details)

Uploaded CPython 3.13Windows x86-64

pyuiua-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

pyuiua-0.0.3-cp313-cp313-macosx_11_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyuiua-0.0.3-cp313-cp313-macosx_10_12_x86_64.whl (10.3 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

pyuiua-0.0.3-cp312-cp312-win_amd64.whl (10.0 MB view details)

Uploaded CPython 3.12Windows x86-64

pyuiua-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pyuiua-0.0.3-cp312-cp312-macosx_11_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyuiua-0.0.3-cp312-cp312-macosx_10_12_x86_64.whl (10.3 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

pyuiua-0.0.3-cp311-cp311-win_amd64.whl (10.0 MB view details)

Uploaded CPython 3.11Windows x86-64

pyuiua-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pyuiua-0.0.3-cp311-cp311-macosx_11_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyuiua-0.0.3-cp311-cp311-macosx_10_12_x86_64.whl (10.3 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

pyuiua-0.0.3-cp310-cp310-win_amd64.whl (10.0 MB view details)

Uploaded CPython 3.10Windows x86-64

pyuiua-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file pyuiua-0.0.3.tar.gz.

File metadata

  • Download URL: pyuiua-0.0.3.tar.gz
  • Upload date:
  • Size: 49.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for pyuiua-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7cc28e6cebb0378bfda7eb4d3fe663bdfe71d443a2a8e77d18d2f3213ca1b511
MD5 b3b0899d91e41872cde18c792104fe6d
BLAKE2b-256 08250361a864b66051bf9dc64778736f8f165cdea7e7d48d5544e0d25a013428

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyuiua-0.0.3-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 782bb32833e7a2764c70311043baa7ca34a1bea6128115ce73ac611e82e0cf7f
MD5 86061d6f321ad0aedc7e3d41a066bef2
BLAKE2b-256 19a86e2c19108df342b0d76c764a943a66919ad7ad432525e43c217876da3b89

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pyuiua-0.0.3-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for pyuiua-0.0.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 1c27f5758984c947f179e71f35b01b1877d6e18bc27e1d129f3914a95dc7f341
MD5 6584d58f98ca0e0daa6885aa0e9a5e06
BLAKE2b-256 e3e0a65ce257b6469b9e29d8a65049c81ac32df9e027a025c6238322d215ab72

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp314-cp314-win32.whl.

File metadata

  • Download URL: pyuiua-0.0.3-cp314-cp314-win32.whl
  • Upload date:
  • Size: 8.8 MB
  • Tags: CPython 3.14, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for pyuiua-0.0.3-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 37c85e37ec8f2941ef3454445c7b0c3c9a7abb0755a5f6716616bbff2fa27307
MD5 4811449c99d7250287ea2ef4550c6121
BLAKE2b-256 45bcbaf18c1343aaf6b13d2c216ca57f54f38a6f90ac7c9791a51b47c41495df

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyuiua-0.0.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 139e5763e57d160ba829c7f80bb48a6e0ef9ba3debfd95c7ce7d24fb76f96dae
MD5 2d9c343be1919b15cb861c05a3c5f7df
BLAKE2b-256 47f494c2002bf922e06d70f0f3fee02c076375b9813d875042b8435e214f531b

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyuiua-0.0.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ab00d743668702774baacf594bb21a865396cbe6690a51fe174f41e15b228f69
MD5 c0f33ce88cb8e5f9cab4c3ad3dd2b1fa
BLAKE2b-256 efba9a69f1d79808f946587e82e1b82bc610f422cb32da172963346b72eb1408

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pyuiua-0.0.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for pyuiua-0.0.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 096de14ece518a849c3cda976a8cd2304b106ae2e7750c119a45a9484879d627
MD5 259f74625e4dede617d324db4055700a
BLAKE2b-256 2496819a99d3bf7f945579a7d65e576ba839ede577464ebf076a2ae648184946

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyuiua-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d6715a3055aed70c890053d67c2ae62814922f6b5d106f42815a8a911d750349
MD5 78c2c74be14dce4bb70aa6f787a39e66
BLAKE2b-256 4ffc2307f6c73ac4b38c61e80e579ba069dc28180419fe62c9e12a75ffa26fb7

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyuiua-0.0.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c1d27a68194a3ca3a662245b46476d927693bb1d91906035ed55a6683cc523e5
MD5 ec57f9cd2807b866f13c57ff01fdf5cc
BLAKE2b-256 7d8bdad9736f1119d5911c54aaa7ebd45346f4e63a7803cc868867525200b4be

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyuiua-0.0.3-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b295191cd3662ff0d67a0df399dd908a21d431a765c34542c4d499aa94db1598
MD5 4298dc7fb617a2357abe9e8623006174
BLAKE2b-256 2368970e87ee4f714e729deb48f4fcb3365e05f2b0f11660563fb7cd7dd53cb2

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyuiua-0.0.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for pyuiua-0.0.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f707f3d10a8f83849fb0e51360cb3ea2f44c153578707fad8133317eac306547
MD5 3642dd9c568e2f8b4b885dc632140417
BLAKE2b-256 35bf09dbab9cda8667b320356d46ea7af65a2ca804d9cef3a6a88ada664ef82c

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyuiua-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bdb68b774b5466b11d387b359c5cc3f41fb1902cb9b07744299f1b132c762d2b
MD5 69a4ef6ecafce1052238d84c5fc0914d
BLAKE2b-256 4cbce3efca5eb0268325ff1b40d252c5a99bdf8a03c6b1df1b4bdb40a5257411

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyuiua-0.0.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 89510f0e551d064f03dc89d3b2b426053dacf6a0afd596697293c347e53b5a5d
MD5 6bbcab78fe7a67df0511ea0c44dd26a4
BLAKE2b-256 28ee7e72335adaf25cc89e025809f8a46f5191296a01d15ff0dad99c91ee143a

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyuiua-0.0.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d22441a52210d697f80c7ff30a9c37c69937614155fe6b8c55aea8d52ed88299
MD5 976cf070654fc14189460c54b286a14a
BLAKE2b-256 e02f10216e4ccc1ba82232a564f30a7712e60163f2ddfc84fea80b50365405f9

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyuiua-0.0.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for pyuiua-0.0.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1be2bbc9da304dc4028b603270a8d8810721d8378569e27526fe5c0384c96d0e
MD5 e637fb557ccbad28c8887681b36986d2
BLAKE2b-256 ddc6b21f970ed5951c346eda2b42066d3d03db827a3f066df22d75f239d2da3a

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyuiua-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5af8009b5be7dba945c854d51c31c39108b4bf0cec5a90a6e7f2cb283a07a16a
MD5 07d149e79c7450510fdc98c21e2d4bea
BLAKE2b-256 1b58a6ae7e3687d26188f7b6c518022a0ffa40d3e139834188c24ff9004c6b7d

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyuiua-0.0.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d69ec98bf7a558b36458d3bc1170803137ffb14774f7490d92e076262a4de1b5
MD5 da3608cf873b33d5bde7631c5c76a274
BLAKE2b-256 43bb29781ba1cc6e9c4a149e07df7deb3f7c11489da3812c2edc49a033515e7e

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyuiua-0.0.3-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 798bd25b4112360d5607aff00f2c2e7a9981d92249d305ac141d46001dd6dc38
MD5 c15689cef12bffb44d2094ee8195a415
BLAKE2b-256 19af0b2ced7de3afc010e29c711872ad0d485da1b3151558819dab737caed1db

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyuiua-0.0.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for pyuiua-0.0.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8cd7d03d21d8b725c31d77fb8ff6803b7dc941e21898a22a8ced339746173f3a
MD5 2f0ff38e6f410b1b66837c42e0abead2
BLAKE2b-256 28fdb1702d3c49029344bdb08de593f7c3c81946d8e2ca2dbb902d42df961952

See more details on using hashes here.

File details

Details for the file pyuiua-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyuiua-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1b7f39e5684762a10ae1f03a1d42363ef7cf20800586361ee55815d11dbcf2aa
MD5 e1a360e2fa1cc7ffbd8469a25858873e
BLAKE2b-256 5a3f0a27cfb58299beaa9b42fddacf669c119bae94b0888a9b3c42b0c5d969e7

See more details on using hashes here.

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