Metadata-Version: 2.1
Name: eospyo
Version: 0.5.6
Summary: Interact with EOSIO blockchain networks
Home-page: https://github.com/FACINGS/eospyo
Author: Edson
Author-email: eospyo@facings.io
Requires-Python: >=3.8,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: httpx (>=0.22.0,<0.23.0)
Requires-Dist: pydantic (>=1.9.0,<2.0.0)
Requires-Dist: ueosio (>=0.2.6,<0.3.0)
Description-Content-Type: text/markdown

Minimalist python library to interact with eosio blockchain networks


# What is it?
**eospyo** is a python library to interact with EOSIO blockchains.  
Its main focus are server side applications.  
This library is heavily influenced (and still uses some pieces of code from) by [µEOSIO](https://github.com/EOSArgentina/ueosio). 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  
**eospyo** serializes the transaction before sending to the blockchain.  
However it doesn't serialize the data field.  
- Paralellization  
Although python has the [GIL](https://realpython.com/python-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](https://facings.io/) have been using this library in production for some few months now.  
However we'd advise for you to fix its version when deploying to prod.  


# Using
Just `pip install eospyo` and play around.  
(we don't support, and have no plans to support [conda](https://docs.conda.io/en/latest/))  
Rather then starting with long docs, just a simple example:  

### Use AtomicAssets transfer action
```
import json

import eospyo

print("Create Transaction")
data = {
    "from": "facings",
    "to": "youraccount",
    "asset_ids": [123],
    "memo": "FACINGS to the moon",
}

auth = eospyo.Authorization(
    actor="facings",
    permission="active",
)

action = eospyo.Action(
    account="atomicassets",  # this is the contract account
    name="transfer",  # this is the action name
    data=data,
    authorization=[auth],
)

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


print("Link transaction to the network")
net = eospyo.WaxTestnet()  # this is an alias for a testnet node
# notice that eospyo 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](./examples)


# Known bugs
### Keys not working
- Some keys are reported to not work. However this error was not replicated and the cause remains unknown. If you can share a key pair that is not working it would be very helpful.


# 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 **eospyo**, 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](https://black.readthedocs.io/en/stable/) and enforcing [pydocstyle](http://www.pydocstyle.org/en/stable/) and [isort](https://pypi.org/project/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
```




