Skip to main content

Minimalist python library to interact with antelope blockchain networks

Test PyPI - Python Version version GitHub repo size GitHub last commit

What is it?

pyntelope is a python library to interact with Antelope blockchains.
Its main focus are server side applications.
This library is heavily influenced by µEOSIO. Many thanks to them for the astonishing job!

Main features

  • Send transactions Its main usage today is to send transactions to the blockchain
  • Statically typed This library enforces and verifies types and values.
  • Serialization pyntelope serializes the transaction before sending to the blockchain.
  • Paralellization Although python has the GIL we try to make as easier as possible to paralellize the jobs.
    All data is as immutable and all functions are as pure as we can make them.

Stability

This work is in alpha version. That means that we make constant breaking changes to its api.
Also there are known (and, of course unknown) bugs and various limitations.
Given that, we at FACINGS have been using this library in production for over an year now.
However we'd advise for you to fix its version when deploying to prod.

Using

Just pip install pyntelope and play around.
(we don't support, and have no plans to support conda)
Rather then starting with long docs, just a simple example:

Use Send Message action

import pyntelope


print("Create Transaction")
data=[
    pyntelope.Data(
        name="from",
        value=pyntelope.types.Name("me.wam"), 
    ),
    pyntelope.Data(
        name="message",
         value=pyntelope.types.String("hello from pyntelope"),
    ),
]

auth = pyntelope.Authorization(actor="me.wam", permission="active")

action = pyntelope.Action(
    account="me.wam", # this is the contract account
    name="sendmsg", # this is the action name
    data=data,
    authorization=[auth],
)

raw_transaction = pyntelope.Transaction(actions=[action])

print("Link transaction to the network")
net = pyntelope.WaxTestnet()  # this is an alias for a testnet node
# notice that pyntelope returns a new object instead of change in place
linked_transaction = raw_transaction.link(net=net)


print("Sign transaction")
key = "a_very_secret_key"
signed_transaction = linked_transaction.sign(key=key)


print("Send")
resp = signed_transaction.send()

print("Printing the response")
resp_fmt = json.dumps(resp, indent=4)
print(f"Response:\n{resp_fmt}")

There are some other examples here

Known bugs

multi-byte utf-8 characters can not be serialized

  • Serialization of multi-byte utf-8 characters is somewhat unpredictable in the current implementation, therfore any String input containing multi-utf8 byte characters will be blocked for the time being.

Contributing

All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.
If you find a bug, just open a issue with a tag "BUG".
If you want to request a new feature, open an issue with a tag "ENH" (for enhancement).
If you feel like that our docs could be better, please open one with a tag "DOC".
Although we have the next few steps already planned, we are happy to receive the community feedback to see where to go from there.

Development

If you want to develop for pyntelope, here are some tips for a local development environment. We'll be more then happy to receive PRs from the community. Also we're going full Black and enforcing pydocstyle and isort (with the limitations described in the .flake8 file)

Setup

Create a virtual env Ensure the dependencies are met:

pip install poetry
poetry install

Run tests

The tests are run against a local network.
Before running the tests you'll need to docker-compose up to create the local network, users and contracts used in the tests.
When ready, just:

pytest

Some tests are marked as "slow".
You can skip them and run the test suite faster with:

pytest -m "not slow"

Metadata

Release files for pyntelope 0.8.6

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

Source distribution (sdist)

Source distribution for pyntelope 0.8.6
File Size Uploaded
pyntelope-0.8.6.tar.gz 21.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyntelope 0.8.6
File Interpreter ABI Platform
pyntelope-0.8.6-py3-none-any.whl Python 3 none any Details

Total release size: 42.6 kB

Release files / pyntelope-0.8.6.tar.gz

Download URL pyntelope-0.8.6.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7a33265b933291fefef661b9ebc820ba979762d6d2fe5865caf33f6de2ea0df9
BLAKE2b-256 checksum
How to use checksums
1c7a5cd3560b94e49a93b035d6b35c7d0815ad128c16566636648ef4195b5342
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.10 Linux/6.1.0-9-amd64

Release files / pyntelope-0.8.6-py3-none-any.whl

Download URL pyntelope-0.8.6-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b105fcef92a1be81bd94ff3154b7b181e3eb0f4b9d7b317e7c9d075ab237f1de
BLAKE2b-256 checksum
How to use checksums
f75bbdc0971e72ae3fa609467bbea044d8d281a41ae68f2c44ce72f13d403e4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.10 Linux/6.1.0-9-amd64

Release history Release notifications | RSS feed

This release

0.8.6 This release

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.4

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