Skip to main content

marlowe-rs bindings for using cardano marlowe in python

Project description

PyPI version Downloads

MARLOWE-PY

Python bindings for Marlowe_Lang marlowe-rs.

Features

  • Deserialize contracts from: cbor-hex, dsl, json.
  • Deserialize datums & redeemers from cbor-hex,json.
  • Serialize contracts to json, dsl.
  • Serialize datums & redeemers to cbor-hex, json.
  • Unstable: View contract expected next inputs and other state info.
  • Unstable: Define contracts directly in Python.
  • Unstable: Code generator: Convert any contract to equivalent Python code

Project goals

  • Provide easy to use API's for everything marlowe-rs supports.
  • Provide easy to use way of designing Marlowe contracts in Python.

How to install

pip install marlowe

Alternatives:

How to use

See the example notebook here.

Basic contract construction:

When(
    case=[
        Deposit(
            by = Role("GUY1"),
            value = Constant(42000000), 
            of_token = ADA, 
            into_account = Role("GUY2"),
            then_continue_with = raw(Close()) # or merkleized("some hash")
        )
    ], 
    timeout = TimeConst(999999999), 
    timeout_continuation = Close()
)

Building from source

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

marlowe-0.1.5-cp311-none-win_amd64.whl (902.5 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

marlowe-0.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

marlowe-0.1.5-cp311-cp311-macosx_10_7_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.11 macOS 10.7+ x86-64

marlowe-0.1.5-cp310-none-win_amd64.whl (902.5 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

marlowe-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

marlowe-0.1.5-cp310-cp310-macosx_10_7_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

Supported by

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