Skip to main content

Peth

Peth is an all-in-one Ethereum SDK and command-line tool, written in Python. It is designed for developers, smart contract auditors, web3 security researchers, and anyone interested in interacting with EVM-compatible chains with ease.

➜ peth


     ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄         ▄ 
    ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌       ▐░▌
    ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀  ▀▀▀▀█░█▀▀▀▀ ▐░▌       ▐░▌
    ▐░▌       ▐░▌▐░▌               ▐░▌     ▐░▌       ▐░▌
    ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄      ▐░▌     ▐░█▄▄▄▄▄▄▄█░▌
    ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌     ▐░▌     ▐░░░░░░░░░░░▌
    ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀      ▐░▌     ▐░█▀▀▀▀▀▀▀█░▌
    ▐░▌          ▐░▌               ▐░▌     ▐░▌       ▐░▌
    ▐░▌          ▐░█▄▄▄▄▄▄▄▄▄      ▐░▌     ▐░▌       ▐░▌
    ▐░▌          ▐░░░░░░░░░░░▌     ▐░▌     ▐░▌       ▐░▌
     ▀            ▀▀▀▀▀▀▀▀▀▀▀       ▀       ▀         ▀ 
                                                        

                           -- https://github.com/lmy375

Welcome to the peth shell. Type `help` to list commands.

peth > 

Features include:

  • An Etherscan-compatible blockchain explorer interface
  • ABI encoding/decoding capabilities
  • An EVM Bytecode disassembler
  • Common DApp contract tools
  • And more...

Documentation

English

中文

Deepwiki

Installation

From pypi

➜ pip install peth
➜ peth

From github

➜ pip install git+https://github.com/lmy375/peth
➜ peth

From source

➜ git clone https://github.com/lmy375/peth
➜ cd peth
➜ uv sync
➜ uv run python main.py

Quick Usage

Command-line mode:

➜ peth -h

Console mode:

➜ peth
Welcome to the peth shell. Type `help` to list commands.

peth > help

Documented commands (type help <topic>):
========================================
4byte             contract         estimate_gas  name       safe      tx_replay
abi4byte          debank           eth_call      open       send_tx   txs      
abi_decode        debug            exit          oracle     sender    url      
abi_encode        decompile        factory       owner      sh        verify   
address           deth             graph         pair       signer    view     
aes               diff             help          price      status  
aml               diffasm          idm           proxy      storage 
call              disasm           int           proxy_all  time    
chain             download_json    ipython       py         timelock
common_addresses  download_source  keccak256     rpc_call   tx      
config            erc20            log           run        tx_raw  

peth >

SDK mode:

➜ ipython
Python 3.10.0 (default, Oct 29 2021, 11:06:42) [Clang 13.0.0 (clang-1300.0.29.3)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.28.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from peth import Peth

In [2]: p = Peth.get_or_create('eth')

In [3]: p.call_contract('0xdAC17F958D2ee523a2206206994597C13D831ec7', 'name')
Out[3]: 'Tether USD'

In [4]: p.call_contract('0xdAC17F958D2ee523a2206206994597C13D831ec7', 'name()->(string)')
Out[4]: 'Tether USD'

Contributing

Help is always appreciated! Feel free to open an issue if you find a problem, or a pull request if you've solved an issue.

Please check out the Contribution Guide prior to opening a pull request.

Buy me a coffee

Send any tokens to 0x2aa75a41805E47eCd94fbBaD84eeF6d1BF21a019

License

This project is licensed under the AGPL v3 license.

Release files for peth 1.0.11

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

Source distribution (sdist)

Source distribution for peth 1.0.11
File Size Uploaded
peth-1.0.11.tar.gz 486.6 kB Details

Built distribution (wheel)

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

Total release size: 655.6 kB

Release files / peth-1.0.11.tar.gz

Download URL peth-1.0.11.tar.gz
Size 486.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8b65c8d66ac032a07b0c8ae6c574063f01cc1404b920df5ae2097dd0831da9c4
BLAKE2b-256 checksum
How to use checksums
c03454d9e5acaf272c13f48860fad9ee0ec87139983d631855021272322dd19e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / peth-1.0.11-py3-none-any.whl

Download URL peth-1.0.11-py3-none-any.whl
Size 169.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
162129d2a9f1125e1fd5f8050b5dd1c2e87d90cec926dc2c909ee01c8d02dc3b
BLAKE2b-256 checksum
How to use checksums
2c48e14f4a861cf360373ea5ed3ac69e5c55b8a456a6b1b30d87e969d1a975ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

1.0.11 This release

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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