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())  # [1, 2, 3]
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.4.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.4-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.4-cp314-cp314-win_amd64.whl (10.0 MB view details)

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14Windows x86

pyuiua-0.0.4-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.4-cp314-cp314-macosx_11_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

pyuiua-0.0.4-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.4-cp313-cp313-macosx_11_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

pyuiua-0.0.4-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.4-cp312-cp312-macosx_11_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

pyuiua-0.0.4-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.4-cp311-cp311-macosx_11_0_arm64.whl (9.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.12+ x86-64

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

Uploaded CPython 3.10Windows x86-64

pyuiua-0.0.4-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.4.tar.gz.

File metadata

  • Download URL: pyuiua-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 d73502f4c188c22df10e603750ae4a1ab127ca1b3d4a1d85b7eb0c80a28349e5
MD5 fae9eefc3c13a228c6785538847c02a4
BLAKE2b-256 4fbf16fc00ce74e6d6d267d589739831964b51f3cade5e7868a1eb6519d9f653

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.4-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a5b7423c08274ed437c947bf357b31916523013fb437a7b1cdb641dd3a6ceb74
MD5 89c770657e3b87b39aae131ee49257ec
BLAKE2b-256 b1f6849108347a26461ec717c72ea5fa9b11b89618c115fe2ae07317eaa641b8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyuiua-0.0.4-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.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 25e3c31bd302af454a7c98d25d219f6ab57ba5bdd00b01e1d3c26db90cb4f4f2
MD5 329d80612f92eb17a26b5a57fa85c8d9
BLAKE2b-256 4dd2db828ff4c3584f4eb6990eedbdd73f064ca6b8bd96a67b5fa48f7d2a7328

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyuiua-0.0.4-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.4-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 4489423f607f11aeb93a7fcfaabe2d1b403ef552c942360bd6369553e8882cd8
MD5 c99e07452ea6e23f361650e4c4a16d3c
BLAKE2b-256 8e439a4b0b3c71dac4bf5d2ccf1496d7b9ebacc152e046b0e322b9f69be6560d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.4-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 522ea28a544efe9ece37684fc31aba6490b0d407c7e2147a7b2d69612b31c29f
MD5 aa702073e160651574095a2e86d761be
BLAKE2b-256 f573c112934005cd8e4149d5cf1261e00829b62883453bfcb7efa8779199dbb9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.4-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 319c3fd54d916fd374feb2ac313cc631901ea551ea990d2793268534224f0a7d
MD5 172dc25cbcd40719c711b2d2af8d0595
BLAKE2b-256 5c56b1e50f413748a14901533eddaa1c3dbbc6c648873e1a2fbd7daf450345aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyuiua-0.0.4-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.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 bb40cb9b5af7df66fbae2809bceaa61a69e104a86f14e197261f4fb4bea933de
MD5 668266a5deccc3cc676a14168e598808
BLAKE2b-256 4444260ffe3a4c2d25a53698125ef38a0181ee81405a216f8d565d1bdc6fa7df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 02fe2aa9eb932185459304456a71d25671e06b6e67e96c99d931686e8b4e861f
MD5 714d2f80a7a90e70a470ee30c09532a8
BLAKE2b-256 ae26997dac92afe296c9ea764b6bf86586533bcd09cf27b49c8e2d7fdb36f7b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dfa48bcefcfdeb3c1b5f8ab44b07210d000179969c2e9a246da83f748d52b077
MD5 69afa5d662f168e38ba25b2281235550
BLAKE2b-256 26a48ba05035aa480bb8df6486466eca53b33c908f5b48e8b9c0f6858aa98f2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.4-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3fbb068034e92460992d72cd18c71e3fcdc2e4fc69e712db1b72ef84f89a3bd1
MD5 a322bd1e0619cc6110e256ceeabedafa
BLAKE2b-256 db06ec88ccc8dd845a7835272aa8685ee9e23d574b8004745913c01300269359

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyuiua-0.0.4-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.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9cbbddeddbccaf8f359c2bc650bf2b1c2a8c92e8eddb17555d63ae9f44e6374a
MD5 ea35bf97c1c137055c41592bb6c60145
BLAKE2b-256 215152a29aa2f2281a325f5443030a795970b00edd6ee3b7cffa13ef5508f3c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4d86cd01ca5833e813d5b02775285001531c0aa861eba70f3d1dd669928800c4
MD5 30344cc0bb68a953814ca4dd1d85665b
BLAKE2b-256 a24707c3484d8abc720441827316f869fc88fcf603fdd67d67a054866adf7901

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 37262a02ffce4f4eab5355df51e49c13d16bc6d59cf23138f7bffd86abe544ef
MD5 6011b6fad0871ce2d7006bbe1b28eb5d
BLAKE2b-256 b26d5517318976f09afc0da900462e6bb1c7462abc38be5e054c3ceda03c9463

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.4-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8dc9fe8ce482d3d59be0b4f6b0e7dccadf4a8865b0b8c0b0c7a7486bd35c3d91
MD5 097b505df67b38066f32fade80ebdd4e
BLAKE2b-256 fd747d8d84787f201d82307cdf8020d674639a099e57b6d23321fb26fa9144d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyuiua-0.0.4-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.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e6b148bde55f419bfc52df021127abb9f484c9c2eb4c4b85c5c77b4370f8caf3
MD5 0693968b249c02462b68daa593b14b5a
BLAKE2b-256 f198ec94e5f1a3d7f39e37c9e80503277c3790cd4066cf07c64a7f4b23032f14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 20a342736363637f2f87bac954deae0f2cc4540297e8a66e45e12ed3f2745c3f
MD5 261c414a390c281b2fa4a3cdc291500a
BLAKE2b-256 56d277de372484a9a4451d16d515d775681452670967fc8c2b5d085313c0d1e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cb71d9c582656bbf4197a727f1fda755e112c55d1306c9561e85efcc7d5fc3e5
MD5 79c3b7f8d9fe7e9e00fb37443813d7d4
BLAKE2b-256 e377116576558d0aebd6aaeccce488653ec0ca9f68a013c366129559278620be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.4-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9a5f3bd6125a947c472f950ad772a277a30969632434ef149364146a08f6a811
MD5 501623722089f0bf8df4c74ed8c44d03
BLAKE2b-256 d5c841eff6c4a7f1b514217dbe8e212cdc203ccf2b44b404df111bfa669dc62a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyuiua-0.0.4-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.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 aead5306a23ef315ec1227d3e9577bfcb9bac03ab5f758868581c94b670a2ef9
MD5 c9e455121587bbed436fe37f17bb3df2
BLAKE2b-256 01889fa9cf22a8273f99afaf409ca3fd6ea4300b80f405a714d6f71b103d60d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8e1d120b4ba3917fc7255eb40eb5c0e99b2dade9a987516e40b4a1d6055bbaef
MD5 52d6a83409fd8573ed9540561a107797
BLAKE2b-256 4527ab66544afa4d8e7bf39b71f84c581ac560e23e18c974ba89ad5a916e4947

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