Skip to main content

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.

Metadata

Release files for universa 0.2.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 universa 0.2.0
File Size Uploaded Provenance Actions
universa-0.2.0.tar.gz 16.0 kB Without provenance Details for universa-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for universa 0.2.0
File Interpreter ABI Platform Actions
universa-0.2.0-py3-none-any.whl Python 3 none any Details for universa-0.2.0-py3-none-any.whl
universa-0.2.0-py2-none-any.whl Python 2 none any Details for universa-0.2.0-py2-none-any.whl

Total release size: 59.7 kB

Release files / universa-0.2.0.tar.gz

Download URL universa-0.2.0.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6aa7aab9c537631c3967b6b00576453392ea3a3e2032bdaef1650894bec408ab
BLAKE2b-256 checksum
How to use checksums
f499ecb00feb8bcfbab3cc1b7104e4dd7b120807d340785209e0818f6d694bfa
Upload date
Uploaded using Trusted Publishing?
What is 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+

Release files / universa-0.2.0-py3-none-any.whl

Download URL universa-0.2.0-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18c1ee69ab9708b85e5a9e33e570e4834a4231ddceb03acc34b18e5b729ec5bc
BLAKE2b-256 checksum
How to use checksums
18d3f67e26185e9791d86f64c4a183875a2ce33d6c09cb551cf9d14bd4c6beb2
Upload date
Uploaded using Trusted Publishing?
What is 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+

Release files / universa-0.2.0-py2-none-any.whl

Download URL universa-0.2.0-py2-none-any.whl
Size 21.8 kB
Tags Python 2
SHA-256 checksum
How to use checksums
fbbf62cdd25a6ac9afa64a7e8bf32c10f05e1d7afcf0f93ef396ff1087acd43c
BLAKE2b-256 checksum
How to use checksums
d33524fd43d5eeb5982ba8d2a387cdd3452f46145cdb82daf83ff75bb04a4839
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for universa 0.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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