Skip to main content

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 install 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.test_accounts[0] # Load test account 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

Please see the contributing guide to learn more how to contribute to this project. Comments, questions, criticisms and pull requests are welcomed.

Documentation

To build docs:

python build_docs.py

License

This project is licensed under the Apache 2.0.

Project details


Release history Release notifications | RSS feed

This version

0.1.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eth-ape-0.1.4.tar.gz (189.9 kB view details)

Uploaded Source

Built Distribution

eth_ape-0.1.4-py3-none-any.whl (135.7 kB view details)

Uploaded Python 3

File details

Details for the file eth-ape-0.1.4.tar.gz.

File metadata

  • Download URL: eth-ape-0.1.4.tar.gz
  • Upload date:
  • Size: 189.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for eth-ape-0.1.4.tar.gz
Algorithm Hash digest
SHA256 06dde141586ed6197cbac706b78715ee71f4489b82838e2e1cadff0b6a1c7c8a
MD5 8d843ba98e28480237bc046d6e014b00
BLAKE2b-256 c7ea28d68e405b32b43e5b94cdea275233c4a69de2c319b44e811635110db1ee

See more details on using hashes here.

File details

Details for the file eth_ape-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: eth_ape-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 135.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for eth_ape-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1b3b639e0b83fcce8d12621393e7aecd2f6b2d020c2fbdbb70fe63f06df45b6f
MD5 ed16098b644da308c50308126042238b
BLAKE2b-256 85b9446466d53eff6ffa1108f9100a0092100c9bb555c228649279c5d2744a0e

See more details on using hashes here.

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