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.2.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.2-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.2-cp314-cp314-win_amd64.whl (10.1 MB view details)

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14Windows x86

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

Uploaded CPython 3.14macOS 11.0+ ARM64

pyuiua-0.0.2-cp313-cp313-win_amd64.whl (10.1 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

pyuiua-0.0.2-cp312-cp312-win_amd64.whl (10.1 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

pyuiua-0.0.2-cp311-cp311-win_amd64.whl (10.1 MB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.12+ x86-64

pyuiua-0.0.2-cp310-cp310-win_amd64.whl (10.1 MB view details)

Uploaded CPython 3.10Windows x86-64

pyuiua-0.0.2-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.2.tar.gz.

File metadata

  • Download URL: pyuiua-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 34ae39bc442c56a5706c5be4e3bb6699ee98dc4727e47f3c3aa5aaeacd53bd8d
MD5 4f9ddad2cdb2c459abc2ef8b8381dd55
BLAKE2b-256 ae9ecfeb750cbc08a128aac51979673115e2f382ebb323fe9423a9168f29dafe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.2-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d4760e787f65bf075ea7a1dce90f490340a6f7f9080bae55407c07ceea6bf01b
MD5 8db4d477349fd21fb38bed565ba1eee4
BLAKE2b-256 0e472ea4b829f544c1751853015dd512933f526147400c16a108593a66b1247f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyuiua-0.0.2-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 10.1 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.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 8f1326aa2f635ce9b48fc28de7b6ca22b40c7d5fc2d25891865500f80d2ec9cf
MD5 fb20e2fe7cfa51a3a8cf145ffc6289cc
BLAKE2b-256 b87bdea1fe94cf545424c0139172a9802ea906abc6d59f3490e209d8a6f10775

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyuiua-0.0.2-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.2-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 484e04e3d520f63be46f18ec79e1dcee68d422f1b9fd4a287ec62e8f392c928f
MD5 45b7e9a55fba1138bd8bbcfabb379ad2
BLAKE2b-256 3b03dfc7c4acaf5c2b4e00efca1af5f3d6193b32083b7a827732d70efd27c2d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 29ea050b71db00999c179321cacf62b2a68b4385eb84b7eec5c64d46c0255330
MD5 52e4727d7d6f8f4cc4032cd3c7df6fac
BLAKE2b-256 42618028c42b8c17085932af0a0b342de02815d5c5dce5b16fd701b381e10871

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9354bb7dc1be5386efbdab33beb487ceb64c4f6348b55bbc53a0a06afb46002a
MD5 3f8cc570aea869f6677f7b3a39ffc3e3
BLAKE2b-256 c6504d0ad0bb00ecf5f4a762a1f9b2ea4ea61e842071f578213c81ee7b38084f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyuiua-0.0.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 10.1 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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2cd88907a8204846f76bf834ee938f31c7b1666b5a93050e51c89407b6387608
MD5 1d52aec493db1e6d2027cba90cfd4fdd
BLAKE2b-256 6e572579c385a9b5f6e51b4a5fa00844faff60cc7c5e90b327f400d0ab91d45d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 35575e51018e1246e5ea007b1771b069227c99c4daf8b765de60bd5a8544b050
MD5 5afa475e813087343ea61ba3535ea9c8
BLAKE2b-256 dd675bb49ad529d723bd69f8a01326361779387915f5e88b5c342484bc616af0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f8772b29ef071835df439c2e3efce94c91307649da72311c5a569fd0f1d6a4f3
MD5 858fb871554e0ce01fc85656a3377098
BLAKE2b-256 c68d80b5c47ebc927eccbf45e83727d1469f3fe1073e30d5187d060eaeea06e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.2-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 12a982d7248229ffba9b5c2e8e923aa3becd6aab6ee5c552d7dde2c46eebd66d
MD5 7a545f1eed8bc171725549766f2d756e
BLAKE2b-256 538d3cf2770c28b08cf56a1ccb9aae6d0a9e26dbd26002490736a5293ca78954

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyuiua-0.0.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 10.1 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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d1f30dbbb471576136fe891d1257cc8f7b9177c3120ca4a4b1ff7aa2c1d623c1
MD5 6ec9b76ccf371600b79b07d6b4fe4e58
BLAKE2b-256 913f77b1e86fd318657cce5018c16f4b47c5522a55352a0eae989631ab7eca36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0c305c3a9f093e818fbbd49bf241576452c1aa89db50d330edb9d22a6425bd95
MD5 9dc1f9faaab6531ce0cf33d37bd63e78
BLAKE2b-256 e5db59e1961991a429c0269b94bb4b942b265d7a229ee3b207757de4fb3e9266

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 910766359f215d8f23c2e15a88d42f836e09127bff34e40498a961930638a32a
MD5 1c488837233cec8669ea1ddef8764664
BLAKE2b-256 c24ab6a5da0c10b0bcfad388e1a48461da339935c8f97ad01fed71a8d4348ed6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f692225fa19a4884f892cab5875ed56854b8dea81a9a6a10140f335cbd78fb7a
MD5 241b292ed9d63f3360dd82fea29c1c93
BLAKE2b-256 8ef68dfbd6320a07812075c308a8d98b74000bf840e551afdfd8019df197ca2d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyuiua-0.0.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 10.1 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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4031fffe20c7465bb52ddc4f25dd28882bcad157485d508ff835934d56edfb20
MD5 dd23812bde62925126820db2dcde9042
BLAKE2b-256 095743bcf719e49d8c65dabfbd747c797f8b6d1c8d8b11f6feebb10823732808

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dd20008be4fd9eeb932e54aeb9bae31f1ecf69c6bffa6c4fc3f0eb3c0a3933be
MD5 54a15dc6a0a1f897493b0904c4084e46
BLAKE2b-256 0d771b67d379c09d58c0aaf60ba14a195fdca628d41b5598333c5911c9316c38

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34df690e30d9f726bddf6c8ccacdb2d0b482ddb044531228294664f719cdd06e
MD5 da55bd7d3e2e1390d86910f4efdff61c
BLAKE2b-256 6f003f5391e8f11ca3052a6002e1fe1b635f3f3f23af1a736bcd3ea4569cc4f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.2-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 91bbdd2e8858419b7787f172916fd520877438f8db560a92c0b05b231a518bbe
MD5 2fad36e55d64b4e7fb311e52a598f4ab
BLAKE2b-256 528a6d5673fec131ea4b41cc4ae434b6a2f141a709c6f3369f9e48c8cce0745c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyuiua-0.0.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 10.1 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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 22faded1ec1ad8fac7682d1c4bbe04497c505452c172ad094a42ba0b9f1375f3
MD5 40439e020cc99408be940c284119244a
BLAKE2b-256 a489b0214d793f432131f21bfc08aca1a0409560a8f3de4d6e51b7d22064affe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyuiua-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fb139b2518d831f690202b8e9e0b2d0a4a69b320b75da51d96f0b5df181ec220
MD5 645f725c55285fbdf635832201ede1ac
BLAKE2b-256 e92f8ea6cf1bda6c973b9caa090c3603adbb745fc9a099433608b510466ec99e

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