Install & Compatibility
Where this runs
tested against v5.2.24 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 32.0s · import 0.000s · 232MB
234MB installed
● package 234MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
get_price
✓ from ypricemagic import get_price
✗ from ypricemagic.magic import get_price
get_price is exposed at the top-level package
Price
✓ from ypricemagic import Price
✗ from ypricemagic.price import Price
Price class is also top-level
Fetch the price of WETH at block 15,000,000. Set ETH_RPC_URL environment variable to your archive node endpoint.
import os
from ypricemagic import get_price
# Requires an Ethereum archive node RPC URL
rpc_url = os.environ.get('ETH_RPC_URL', 'https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY')
# Get ETH price in USD at a specific block
price = get_price('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', block=15000000, fail_on_multiple_locators=True)
print(f'Price at block 15000000: {price}')
Upgrade
Version history
5.2.24latest on PyPI · released Jun 19, 2026
Audit
Dependencies
web3requiredCore dependency for Ethereum node interaction
dank_midsoptionalMiddleware for efficient multi-call and batch requests
eth-brownieoptionalUsed for ABI management and contract interaction