Skip to main content

Python package to access Universa API from python.

Project description

Universa

Build status PyPI Downloads Latest PyPI version License

This is an under-construction official Python package from Universa to facilitate access to the Java library using Universa's UMI protocol.

Installation

Installation

pip install universa

Usage

Prerequisites

You need to have UMI installed somewhere on your system. To run, UMI requires JVM v1.8.* (or newer) to be installed, too.

UMI can be used in one of three modes:

  • pipe – the UMI instance is dynamically executed in a subprocess, and a pipe is used for communication.
  • tcp – connect to an already running UMI instance via TCP socket.
  • unix – connect to an already running UMI instance via Unix socket.

By default it expects an umi binary to be installed an reachable via the shell $PATH, and will invoke it automatically in pipe mode. Use universa.transport.setupUMI method if you need to switch the connection method to some other.

Example

#!/usr/bin/env python3
from universa.transport import transport
from universa.types import PrivateKey, Contract, RevokePermission

if __name__ == '__main__':
    # The next line is not necessary if umi is reachable via the $PATH
    # transport.setupUMI('pipe', '/usr/local/bin/umi')

    # To connect to an already running UMI instance you may use one of this modes:
    # transport.setupUMI('tcp', host='127.0.0.1', port=12345)  # IPv6 is also ok
    # transport.setupUMI('unix', path='/path-to-the-socket')

    print(transport.version)

    private_key = PrivateKey(size=2048)
    contract = Contract()
    short_address = private_key.public_key.short_address
    owner_role = contract.set_owner_addresses(short_address)
    revoke_permission = RevokePermission(owner_role)
    contract.add_permission(revoke_permission)

Docs and resources

For more information see:

License

This package is available as open source under the terms of the MIT License.

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

universa-0.2.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

universa-0.2.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

universa-0.2.0-py2-none-any.whl (21.8 kB view details)

Uploaded Python 2

File details

Details for the file universa-0.2.0.tar.gz.

File metadata

  • Download URL: universa-0.2.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.5.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0+

File hashes

Hashes for universa-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6aa7aab9c537631c3967b6b00576453392ea3a3e2032bdaef1650894bec408ab
MD5 023eb833b4f315e44c5a3646d4dce918
BLAKE2b-256 f499ecb00feb8bcfbab3cc1b7104e4dd7b120807d340785209e0818f6d694bfa

See more details on using hashes here.

File details

Details for the file universa-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: universa-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.5.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0+

File hashes

Hashes for universa-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18c1ee69ab9708b85e5a9e33e570e4834a4231ddceb03acc34b18e5b729ec5bc
MD5 2fae5e863436a16fa654dec64bc02ba0
BLAKE2b-256 18d3f67e26185e9791d86f64c4a183875a2ce33d6c09cb551cf9d14bd4c6beb2

See more details on using hashes here.

File details

Details for the file universa-0.2.0-py2-none-any.whl.

File metadata

  • Download URL: universa-0.2.0-py2-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.5.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.15

File hashes

Hashes for universa-0.2.0-py2-none-any.whl
Algorithm Hash digest
SHA256 fbbf62cdd25a6ac9afa64a7e8bf32c10f05e1d7afcf0f93ef396ff1087acd43c
MD5 9a321b3a7fc7821af34d6a51673d9a00
BLAKE2b-256 d33524fd43d5eeb5982ba8d2a387cdd3452f46145cdb82daf83ff75bb04a4839

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