{"id":25323958,"url":"https://github.com/opshin/pyaiken","last_synced_at":"2025-08-01T20:33:58.706Z","repository":{"id":65220793,"uuid":"588224427","full_name":"OpShin/pyaiken","owner":"OpShin","description":"Python bindings for aiken","archived":false,"fork":false,"pushed_at":"2024-01-01T22:45:48.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T13:15:21.598Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpShin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-01-12T16:11:21.000Z","updated_at":"2023-04-26T06:22:16.000Z","dependencies_parsed_at":"2023-12-08T21:25:09.712Z","dependency_job_id":"f75f9124-f768-4c63-9ec8-a3f0034f9c37","html_url":"https://github.com/OpShin/pyaiken","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpShin%2Fpyaiken","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpShin%2Fpyaiken/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpShin%2Fpyaiken/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpShin%2Fpyaiken/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpShin","download_url":"https://codeload.github.com/OpShin/pyaiken/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238759663,"owners_count":19525873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-14T00:55:11.507Z","updated_at":"2025-02-14T00:55:12.370Z","avatar_url":"https://github.com/OpShin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"pyaiken\n=======\n[![CI](https://github.com/OpShin/pyaiken/actions/workflows/CI.yml/badge.svg)](https://github.com/OpShin/pyaiken/actions/workflows/CI.yml)\n[![Build Status](https://app.travis-ci.com/OpShin/pyaiken.svg?branch=master)](https://app.travis-ci.com/OpShin/pyaiken)\n[![PyPI version](https://badge.fury.io/py/pyaiken.svg)](https://pypi.org/project/pyaiken/)\n[![PyPI - Status](https://img.shields.io/pypi/status/pyaiken.svg)](https://pypi.org/project/pyaiken/)\n\nThis package supplies python bindings for the package [aiken](https://github.com/aiken-lang/aiken).\nThe bindings are added on a per-need basis, currently only serving the development of [opshin](https://github.com/opshin)\n\n\n### Installation\n\nInstall python3. Then run the following command.\n\n```bash\npython3 -m pip install pyaiken\n```\n\n### Usage\n\n\n```python\n\nfrom pyaiken import uplc\n\n# Tools for handling UPLC\n\n### uplc.flat\n# Print the hex of the CBOR encoded flat-encoding of the program in UPLC textual notation\ncode = uplc.flat(\"(program 1.0.0 (con data #01))\")\n\nprint(code)\n# prints \"490100004c0101010001\"\n\n### uplc.unflat\n# Print the UPLC in textual notation from the hex of the CBOR encoded flat-encoding\ncode = uplc.unflat(\"490100004c0101010001\")\n\nprint(code)\n# prints \"(program 1.0.0 (con data #01))\"\n\n### uplc.eval\n# Evaluate a UPLC program with the given arguments (all in textual representation) and cpu and memory budget (optional, in this order)\n# Returns either computed UPLC value on success or thrown error on failure,\n# logs generated through trace\n# and the consumed cpu and memory steps\n((suc, err), logs, (cpu, mem)) = uplc.eval(\"(program 1.0.0 (lam x x))\", [\"(con data #01)\"], 1000000, None)\n\nprint((suc, err), logs, (cpu, mem))\n# prints \"('(con data #01)', None), [], (92100, 500)\"\n\n```\n\n### Building\n\nIn case you need to build this package from source, install Python3 and Rust and proceed as follows.\n\n```bash\ngit clone https://github.com/OpShin/pyaiken\ncd pyaiken\npython3 -m venv .env\nsource .env/bin/activate  # or in whichever environment you want to have it installed\npip install maturin\nmaturin build\n```\n\nThe package will be installed in the active python environment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopshin%2Fpyaiken","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopshin%2Fpyaiken","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopshin%2Fpyaiken/lists"}