Package: pyntelope
Minimalist python library to interact with antelope blockchain networksWhat is it?pyntelopeis 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 featuresSend transactions
Its main usage today is to send transactions to the blockchainStatically typed
This library enforces and verifies types and values.Serializationpyntelopeserializes the transaction before sending to the blockchain.Paralellization
Although python has theGILwe 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.StabilityThis 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 atFACINGShave 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.UsingJustpip install pyntelopeand play around.(we don't support, and have no plans to supportconda)Rather then starting with long docs, just a simple example:Use Send Message actionimportpyntelopeprint("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 accountname="sendmsg",# this is the action namedata=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 placelinked_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 exampleshereKnown bugsmulti-byte utf-8 characters can not be serializedSerialization 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.ContributingAll 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.DevelopmentIf you want to develop forpyntelope, 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 fullBlackand enforcingpydocstyleandisort(with the limitations described in the .flake8 file)SetupCreate a virtual env
Ensure the dependencies are met:pip install poetry
poetry installRun testsThe tests are run against a local network.Before running the tests you'll need todocker-compose upto create the local network, users and contracts used in the tests.When ready, just:pytestSome tests are marked as "slow".You can skip them and run the test suite faster with:pytest -m "not slow"