Skip to main content

Python Toolkit for EOS

Project description

Python Toolkit for EOS

Latest Release

pyeoskit v1.0.7

Installation

python3 -m pip install --upgrade pip
python3 -m pip install pyeoskit

On Windows platform:

python -m pip install --upgrade pip
python -m pip install pyeoskit

Docs

Building from Source Code

Installing Prerequisites

python3 -m pip install scikit-build
python3 -m pip install cython

For Windows platform

python -m pip install scikit-build
python -m pip install cython
  1. Download and Install gcc compiler from tdm-gcc
  2. Install Go compiler from download
  3. Install cmake from download
  4. Install python3 from downloads

Press Win+R to open Run Dialog, input the following command

cmd -k /path/to/gcc/mingwvars.bat

Downloading Source Code

git clone https://www.github.com/learnforpractice/pyeoskit
cd pyeoskit
git submodule update --init --recursive

Build

./build.sh

For Windows platform In the cmd dialog, enter the following command:

python setup.py sdist bdist_wheel

Installation

./install.sh

For Windows platform

python -m pip uninstall pyeoskit -y;python -m pip install .\dist\pyeoskit-[SUFFIX].whl

Example1

import os
from pyeoskit import eosapi, wallet
#import your account private key here
wallet.import_key('mywallet', '5K463ynhZoCDDa4RDcr63cUwWLTnKqmdcoTKTHBjqoKfv4u5V7p')

eosapi.set_node('https://eos.greymass.com')
info = eosapi.get_info()
print(info)
args = {
    'from': 'test1',
    'to': 'test2',
    'quantity': '1.0000 EOS',
    'memo': 'hello,world'
}
eosapi.push_action('eosio.token', 'transfer', args, {'test1':'active'})

Async Example

import os
import asyncio
from pyeoskit import wallet
from pyeoskit.chainapi import ChainApiAsync

#import your account private key here
wallet.import_key('mywallet', '5K463ynhZoCDDa4RDcr63cUwWLTnKqmdcoTKTHBjqoKfv4u5V7p')

async def test():
    eosapi = ChainApiAsync('https://eos.greymass.com')
    info = await eosapi.get_info()
    print(info)
    args = {
        'from': 'test1',
        'to': 'test2',
        'quantity': '1.0000 EOS',
        'memo': 'hello,world'
    }
    r = await eosapi.push_action('eosio.token', 'transfer', args, {'test1':'active'})
    print(r)

asyncio.run(test())

Sign With Ledger Hardware Wallet Example

import os
from pyeoskit import eosapi
eosapi.set_node('https://eos.greymass.com')
args = {
    'from': 'test1',
    'to': 'test2',
    'quantity': '1.0000 EOS',
    'memo': 'hello,world'
}

#indexes is an array of ledger signing key indexes
eosapi.push_action('eosio.token', 'transfer', args, {'test1':'active'}, indexes=[0])

License

MIT

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

pyeoskit-1.0.7.tar.gz (484.4 kB view hashes)

Uploaded Source

Built Distributions

pyeoskit-1.0.7-cp310-cp310-win_amd64.whl (3.0 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

pyeoskit-1.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyeoskit-1.0.7-cp310-cp310-macosx_10_15_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.10 macOS 10.15+ x86-64

pyeoskit-1.0.7-cp39-cp39-win_amd64.whl (3.0 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

pyeoskit-1.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyeoskit-1.0.7-cp39-cp39-macosx_10_15_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.9 macOS 10.15+ x86-64

pyeoskit-1.0.7-cp38-cp38-win_amd64.whl (3.0 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

pyeoskit-1.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyeoskit-1.0.7-cp38-cp38-macosx_10_15_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.8 macOS 10.15+ x86-64

pyeoskit-1.0.7-cp37-cp37m-win_amd64.whl (3.0 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

pyeoskit-1.0.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

pyeoskit-1.0.7-cp37-cp37m-macosx_10_15_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.7m macOS 10.15+ 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