Ape Ethereum Framework
Project description
Ape Framework
Ape is a framework for Web3 Python applications and smart contracts, with advanced functionality for testing, deployment, and on-chain interactions.
See website and documentation.
Dependencies
- python3 version 3.7 or greater, python3-dev
Installation
via pip
You can install the latest release via pip
:
pip install eth-ape
via setuptools
You can clone the repository and use setuptools
for the most up-to-date version:
git clone https://github.com/ApeWorX/ape.git
cd ape
python3 setup.py install
via docker
Please visit our Dockerhub for more details on using Ape with Docker.
example commands:
compiling:
docker run \
--volume $HOME/.ape:/root/.ape \
--volume $HOME/.vvm:/root/.vvm \
--volume $HOME/.solcx:/root/.solcx \
--volume $PWD:/root/project \
--workdir /root/project \
apeworx/ape compile
running the ape console:
docker run -it \
--volume $HOME/.ape:/root/.ape \
--volume $HOME/.vvm:/root/.vvm \
--volume $HOME/.solcx:/root/.solcx \
--volume $PWD:/root/project \
--workdir /root/project \
apeworx/ape console
Quick Usage
Ape is primarily meant to be used as a command line tool. Here are some things you can use ape to do:
# Work with your accounts
$ ape accounts list
# Compile your project's smart contracts
$ ape compile --size
# Run your tests with pytest
$ ape test -k test_only_one_thing --coverage --gas
# Connect an IPython session through your favorite provider
$ ape console --network ethereum:mainnet:infura
# Add new plugins to ape
$ ape plugins add plugin-name
Ape also works as a package. You can use the same networks, accounts, and projects from the ape package as you can in the cli:
# Work with registered networks, providers, and blockchain ecosystems (like Ethereum)
from ape import networks
with networks.ethereum.mainnet.use_provider("infura"):
... # Work with the infura provider here
# Work with test accounts, local accounts, and (WIP) popular hardware wallets
from ape import accounts
a = accounts[0] # Load by index
a = accounts["example.eth"] # or load by ENS/address
a = accounts.load("alias") # or load by alias
# Work with contract types
from ape import project
c = a.deploy(project.MyContract, ...)
c.viewThis() # Make Web3 calls
c.doThat(sender=a) # Make Web3 transactions
assert c.MyEvent[-1].caller == a # Search through Web3 events
Development
This project is in early development and should be considered an alpha. Things might not work, breaking changes are likely. Comments, questions, criticisms and pull requests are welcomed.
Documentation
To build docs:
python build_docs.py # build docs in docs/_build
python build_docs.py --rsync=/tmp/ape # for serving up docs in development
License
This project is licensed under the Apache 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file eth-ape-0.1.0a27.tar.gz
.
File metadata
- Download URL: eth-ape-0.1.0a27.tar.gz
- Upload date:
- Size: 100.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5e4311ba6ae25330ab523b24143db487029f00406a8af8eaeb102f6b295389e |
|
MD5 | e4e5bba2f100c7af64621985f564c290 |
|
BLAKE2b-256 | ce31bab611e29896f530dde4cf19e88016fc3f0b7d0ca27b6f0d3452f73aa048 |
File details
Details for the file eth_ape-0.1.0a27-py3-none-any.whl
.
File metadata
- Download URL: eth_ape-0.1.0a27-py3-none-any.whl
- Upload date:
- Size: 81.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6f46e0f88e97da47c67f66e51c1427dfb7ba15edb9023d659667a84d97a2b95 |
|
MD5 | 7add1cc3cb074744a997e266b26354e6 |
|
BLAKE2b-256 | f4604c1099bc7a95df81aa3e4f3f150893688b53233c5e91835c6b10bcf3bb1d |