Skip to main content

No project description provided

Project description

Puan PV SDK Python

An SDK for connecting to a Puan PV backend.

Example

from puan_pv_sdk_python import PropKey, And, Or, Variable, evaluation_composer

evaluate = evaluation_composer("http://localhost:8080")

keys = evaluate(
    propositions=[
        And(
            variables=[
                Or(
                    variables=[
                        Variable(id='a'),
                        Variable(id='b')
                    ]
                ),
                Variable(id='c')
            ]
        ),
        And(
            variables=[
                Variable(id='a'),
                Variable(id='b')
            ]
        ),
    ], 
    interpretations=[
        {"a": 1, "b": 1, "c": 1},
        {"a": 1, "b": 1, "c": 0},
        {"a": 1, "b": 0, "c": 1},
    ],
).data

# >>> print(keys)
# [(0, 0), (0, 2), (1, 0), (1, 1)]
# Meaning, 
#   - 1st proposition and 1st interpretation returns true,
#   - 1st proposition and 3rd interpretation returns true,
#   - ...
# and so on.

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

puan_pv_sdk_python-0.1.5.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

puan_pv_sdk_python-0.1.5-py3-none-any.whl (2.6 kB view hashes)

Uploaded Python 3

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