Skip to main content

Python Library for VIZ

Tests Status Documentation Status

Usage examples

Award someone

from viz import Client

node = "wss://node.viz.cx/ws"
viz = Client(node=node, keys=["5...your_private_regular_key..."])

initiator = "your_account"
receiver = "id"
percent = 10.5 # 10.5%
viz.award(receiver, percent, "with love", None, initiator)

Award someone with fixed reward

from viz import Client

node = "wss://node.viz.cx/ws"
viz = Client(node=node, keys=["5...your_private_regular_key..."])

initiator = "your_account"
receiver = "id"
reward_amount = 3.5 # "3.50 VIZ"
max_energy = 30 # 30%
viz.fixed_award(receiver, reward_amount, max_energy, "with fixed reward", None, initiator)

Send a custom operation

from viz import Client

node = "wss://node.viz.cx/ws"
viz = Client(node=node, keys=["5...your_private_regular_key..."])

account = "your_account"
required_regular_auths = [account]
protocol = "color.place"
custom_json = {"x": 35, "y": 70, "color": "#e50000"}
viz.custom(protocol, custom_json, None, required_regular_auths)

Get data from custom protocol

from viz import Client
from viz.account import Account
from viz.block import Block
from viz.instance import set_shared_blockchain_instance
import json

viz = Client("wss://node.viz.cx/ws")
set_shared_blockchain_instance(viz)

account_name = "id"
protocol = "V"
account = Account(account_name, protocol=protocol)

counter_inside_protocol = account["custom_sequence"]
last_used_in_block = account["custom_sequence_block_num"]

block = Block(last_used_in_block)

for tx in block["transactions"]:
    for op_type, op_data in tx["operations"]:
        if op_type != "custom":
            continue
        if op_data.get("id") != protocol:
            continue
        if account_name not in op_data.get("required_regular_auths", []):
            continue

        raw_json = op_data.get("json")
        try:
            json_from_protocol = json.loads(raw_json) if raw_json else None
        except json.JSONDecodeError:
            json_from_protocol = None

        print(json_from_protocol)

Any direct RPC call

from viz import Client

viz = Client("wss://node.viz.cx/ws")
viz.rpc.get_dynamic_global_properties()

Installation

Current published version could be installed via

pip install viz-python-lib

Manual installation:

Install poetry

cd viz-python-lib/
poetry install

Development

Dependencies

Linux dependencies

sudo apt-get install libffi-dev libssl-dev python3-dev

Windows dependencies

Install regular version of OpenSSL (not Light) suitable for your core processor.

MacOS dependencies

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries. This means that you will need to install and export some OpenSSL settings yourself, before you can install viz-python-lib:

brew install openssl

and then use the following commands:

export CFLAGS="-I$(brew --prefix openssl)/include"
export LDFLAGS="-L$(brew --prefix openssl)/lib"

Release files for viz-python-lib 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for viz-python-lib 1.3.0
File Size Uploaded
viz_python_lib-1.3.0.tar.gz 33.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for viz-python-lib 1.3.0
File Interpreter ABI Platform
viz_python_lib-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 74.6 kB

Release files / viz_python_lib-1.3.0.tar.gz

Download URL viz_python_lib-1.3.0.tar.gz
Size 33.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b6549e1ce1f411a6eba3e53041c90e7800ded5e29fd4cf3099483c909363f906
BLAKE2b-256 checksum
How to use checksums
e0b3326d61fa7034967e983993cf118f0e59649c9fd9106af9f704d290b247fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 16, 2026.

Transparency log

Release files / viz_python_lib-1.3.0-py3-none-any.whl

Download URL viz_python_lib-1.3.0-py3-none-any.whl
Size 41.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c02c34ba4055ab6bf6c3e309914627f4bc3925acd7aa2923dd6984b3e28b553
BLAKE2b-256 checksum
How to use checksums
56409357250542b89d3208d2b13ab513acac42300e5396da435bbfc4eacaad36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page