No project description provided
Project description
hypersync-client-python
Python package for Envio's HyperSync client written in Rust
Example usage
import hypersync
import asyncio
async def main():
# Create hypersync client using the mainnet hypersync endpoint
client = hypersync.hypersync_client(
"https://eth.hypersync.xyz",
)
height = await client.get_height()
print("Height:", height)
# The address we want to get all ERC20 transfers and transactions for
addr = "1e037f97d730Cc881e77F01E409D828b0bb14de0"
# The query to run
query = {
# start from block 0 and go to the end of the chain (we don't specify a toBlock).
"from_block": 0,
# The logs we want. We will also automatically get transactions and blocks relating to these logs (the query implicitly joins them)
"logs": [
{
"topics": [
# We want ERC20 transfers
["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"],
[],
# We want the transfers that go to this address.
# appending zeroes because topic is 32 bytes but address is 20 bytes
["0x000000000000000000000000" + addr],
],
},
{
"topics": [
# We want ERC20 transfers
["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"],
# We want the transfers that go to this address.
# appending zeroes because topic is 32 bytes but address is 20 bytes
["0x000000000000000000000000" + addr],
[],
],
},
],
"transactions": [
# We want all the transactions that come from this address
{"from": ["0x" + addr]},
# We want all the transactions that went to this address
{"to": ["0x" + addr]},
],
# Select the fields we are interested in
"field_selection": {
"block": ["number", "timestamp", "hash"],
"log": [
"block_number",
"log_index",
"transaction_index",
"data",
"address",
"topic0",
"topic1",
"topic2",
"topic3",
],
"transaction": [
"block_number",
"transaction_index",
"hash",
"from",
"to",
"value",
"input",
],
},
}
print(query)
# run the query once
# res = await client.send_req(query)
# print(res)
# Create a parquet folder by running this query and writing the contents to disk
await client.create_parquet_folder(query, "data")
print("finished writing parquet folder")
asyncio.run(main())
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
hypersync-0.0.2.tar.gz
(31.8 kB
view hashes)
Built Distributions
Close
Hashes for hypersync-0.0.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cd56529f2fe5fe2e02de6e01faa1bc925d8e879739687e7516bd9afe4a36c6c |
|
MD5 | 6e0fe0a27aaf7b08b93da7e3f4fc849f |
|
BLAKE2b-256 | 676f055efd81f7394aba71c335c93f32b63db1dffe7300968235fdb64cb31a3e |
Close
Hashes for hypersync-0.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00ce86595a6c2fd34221f9b058e8ecedbf50bfbb50182066f36e84d3848d8363 |
|
MD5 | a0cd9257e074d23f149ecf4b69d81da0 |
|
BLAKE2b-256 | 7640578510ead8d0ea38ae596a680282fbf7377b2285260959c131f2d97688ce |
Close
Hashes for hypersync-0.0.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8470e53bc9b9a86cb48326e890038742ac752401103e72290bdb36ce131eca15 |
|
MD5 | 7c4aa1443d121675a51233c89096e4e8 |
|
BLAKE2b-256 | ebe09b2ece921938f9712ea882df40273afb2a48c2498275574f7bb2138eb51b |
Close
Hashes for hypersync-0.0.2-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a23cacc2ac41cbc7e47d5308b3a3a4590fcc1d80e6f3da2b977c95bcb043aaf7 |
|
MD5 | f317acba66a75fa86ac9a28da3aa0d74 |
|
BLAKE2b-256 | b5acbef1d91e82dec4317d821498f1c513e9997393b4d16e52b4953b377b0d08 |
Close
Hashes for hypersync-0.0.2-cp312-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0653032e8f904fab802417c54cd81360b9140c0e3aee88d5df4198cd3495ed7a |
|
MD5 | 53862bda3ae78607af90cc5f6a3d6b72 |
|
BLAKE2b-256 | 61f70a0e36a1f9311276b40200638313a40ceed8dc2596d07be42e6c8d3761a0 |
Close
Hashes for hypersync-0.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e212c80ce82ed16f7584c90f7c123ed1af70fd8a7b95605d0a8f444e77560ef |
|
MD5 | 4a3a6cb6b39ac2acdc7cb92434a0eb8c |
|
BLAKE2b-256 | 68f8923fd482a73cd637db66f0182b45bc49fb49740b16e75f8116136a9bace0 |
Close
Hashes for hypersync-0.0.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92d478ad1781761ba5f95a2e18a633652a7c9c1a39010ff430b87cde622d9174 |
|
MD5 | bd80765e4b73da3622ca6ba3c6f68783 |
|
BLAKE2b-256 | da6b4cfe8e24ccfe85f21726cc9cfcda06d0bf77a8b472369cbbfb4c92fc75c7 |
Close
Hashes for hypersync-0.0.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd8f832a54b40c997ccbdcefaf90111190b7244ac951118ea1c920e34d9e869e |
|
MD5 | 3e5cbcffbd4343f394af1cc19e3230a2 |
|
BLAKE2b-256 | 561a2d327f5c60c28d9cb31eaae8310e6d220d25aa6f6ff42ef4f397d4514cbb |
Close
Hashes for hypersync-0.0.2-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b91c939fa4954dc1af87b21c16126f259007d07092e62901cd1d5e20541480d |
|
MD5 | 7990b227f2cd1be289804fb6253acc79 |
|
BLAKE2b-256 | 7ffe6878edec39d1df37c105d56f215bb9e07cefb0034ce2619940d9aa4baf23 |
Close
Hashes for hypersync-0.0.2-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c3e3a8adcc508a1b7ce1f9ac17be0ebca6a7862fe64f5571a68b419711ecaf9 |
|
MD5 | e7f8f929621a9bf11b71e92a4cef3fd4 |
|
BLAKE2b-256 | 472308e19c2b18bbcc72f3df97039068b5ae90d6b6a6d293e0c2b47796ab43bc |
Close
Hashes for hypersync-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e9f9dc0b1409b7939a211436227bef219fba030c0d3e3f87a7ef1971459bf9e |
|
MD5 | bd8deedc027d127dae73e67a21592a45 |
|
BLAKE2b-256 | 3b8a92f91f86eb1b1f869b9ac6020f37b8586bf45035a45a0d21d50ed02a86c1 |
Close
Hashes for hypersync-0.0.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7175ac8b60fa6b864aec84d230d519a764d2e1e736f7e8f5fe0ce6624ef4d27f |
|
MD5 | 42d7c655b59491dee47411722da2a36f |
|
BLAKE2b-256 | cf53ab2cd74fffaf7698c195d9f70097d0cb663afa987e4f371c9f2a2bcc361c |
Close
Hashes for hypersync-0.0.2-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea4908d30b05da6609c45cd00ea43a06e2b3f3131ed3b0b1039e5fd82b3df121 |
|
MD5 | 2bd1ff57c3bedade5b2631a5b06e3f91 |
|
BLAKE2b-256 | becf6170fb59f0f017a26124c2bf8322bf0ddef8fceadbf5a053b2ab3fcc4a22 |
Close
Hashes for hypersync-0.0.2-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5196479957d05c8a33f0539d6368fc6a3e07cb30af9c8831dfeccc7fa5903753 |
|
MD5 | 59f93252a84146d1602556bbc970b8f2 |
|
BLAKE2b-256 | 0e69ceac3bc174f71042a8e2cce3fc302e45fd6202a0b2ed62025a528cb3ce1d |
Close
Hashes for hypersync-0.0.2-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad31107e4a80a279c3beec5d05dc32897f0efa8b1801a315cf13240d611c6f42 |
|
MD5 | b478c309e2ccf218a05bfe6c60c0dac3 |
|
BLAKE2b-256 | f961d2565afce77e83ff2e9555cda64806993d765cbb3c89993fd908f52c2ab6 |
Close
Hashes for hypersync-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddcb5f609187ab9f83375b2fe8b4e6f696feb18009a73abee2ec296c5c75705c |
|
MD5 | 36664c420f15f0ea1d240fc513d57c66 |
|
BLAKE2b-256 | 4d13121e6870024fa35267db3678045d5634cc995ee677f55f5287185fc41fc6 |
Close
Hashes for hypersync-0.0.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36e4dbdf6cedd488e9156b9ac678c6b71182dce1911f76a39d68b6c52ca8c9c7 |
|
MD5 | 3098acb60a422033d777762970862e72 |
|
BLAKE2b-256 | 55eba218ff763d011525f9aebbd28030712e8be04b3df4846e766e51651efd35 |
Close
Hashes for hypersync-0.0.2-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9eb10737e4a5f7167f6afe33b40f8620208cfd2b1d10268fe4d1fb8bb5d0c68d |
|
MD5 | c527ba16c7b8a28c7f4de2d45b8d1f38 |
|
BLAKE2b-256 | 878b9a906d57825e0b52a59780f65a8f997f6ee84023c7ab59b85bc7ab07ae00 |
Close
Hashes for hypersync-0.0.2-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e05d865684324d23552ba4cb01a13e99488c65791222532bc61771e30d182236 |
|
MD5 | 1ddb496caaecb522f08f7c53e2e21665 |
|
BLAKE2b-256 | 338c6996ca2135ee872830a3e5b727d8fd5bfd3c6f63a54890c3f5455ef7ed6b |
Close
Hashes for hypersync-0.0.2-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 908c060b09c2798f615f8229eab3659377e90498107ce97bd5279532e17d2089 |
|
MD5 | 69c061c810f21e3f12548b33452f825d |
|
BLAKE2b-256 | 82ef6e4c4bf9910dcd7de1f68017088db69f2de10a51ce1dc55ca1f78ea40eb7 |
Close
Hashes for hypersync-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9ace17317e7460883de1615bddf3f2b69b46d6378127481d6d103be82d515a7 |
|
MD5 | b05cd3f6ad96c2e9ed72c213d9ae905f |
|
BLAKE2b-256 | 753d421078c095acc8b595f0cc62a1a8d5d7d3291a475e46e12d3d6e85261a84 |
Close
Hashes for hypersync-0.0.2-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8afd44b04533c81430d4f5d9a576aa478ca28c9c1f8ff4876184f93eefe44da |
|
MD5 | 0dfa981e2b4a2dfb67a6de10bc3cefdd |
|
BLAKE2b-256 | 60ca175f2cf482376ac782542d7dba142b0e5064d9c64918c76e0dbb9cdc6c8a |
Close
Hashes for hypersync-0.0.2-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f27fd0aafa6993bc53ad24251c7a3b64810701acde3d8353d69a433d7224674 |
|
MD5 | e30d5ec63018399db6a23cf391147d30 |
|
BLAKE2b-256 | ee073784367e8ec132602027ef657509dfbad506793b7ca63166954533bd31d1 |
Close
Hashes for hypersync-0.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee6f2011fef6947abe3449c2bc9e1356a6a6561a90bf7acd5937d7d575b43caa |
|
MD5 | f10cbfbbc786e771bc0e55d8f4cf23d9 |
|
BLAKE2b-256 | 360b066b91cf89dd27503827538474c4b42f04af661bc4190e5ce7c2c0e6638c |