Skip to main content

Web3 data center integrating multiple APIs for blockchain data analysis

Project description

Web3 Data Center

Web3 Data Center is a Python package that integrates multiple APIs to provide comprehensive blockchain data analysis capabilities. It offers a unified interface to access data from various sources, making it easier for developers to gather and analyze blockchain-related information.

Features

  • Integration with multiple blockchain data providers (GeckoTerminal, GMGN, Birdeye, Solscan, GoPlus, DexScreener)
  • Asynchronous API calls for improved performance
  • Persistent file-based caching system for optimized data retrieval
  • Caching mechanism to reduce API calls and improve response times
  • Support for multiple blockchains (Ethereum, Solana, and more)
  • Token information retrieval (price, market cap, holders, etc.)
  • Transaction analysis
  • Token security checks

Installation

You can install Web3 Data Center using pip:

pip install data_center

Quick Start

Here's a simple example of how to use Web3 Data Center:

import asyncio
from web3_data_center import DataCenter
async def main():
data_center = DataCenter()
# Get token info
token_address = "CzLSujWBLFsSjncfkh59rUFqvafWcY5tzedWJSuypump" # Wrapped SOL
token_info = await data_center.get_token_info(token_address)
print(f"Token Info: {token_info}")
# Get top holders
top_holders = await data_center.get_top_holders(token_address, limit=10)
print(f"Top 10 Holders: {top_holders}")
asyncio.run(main())

Caching System

Web3 Data Center includes a robust file-based caching system to improve performance and reduce API calls. The cache is stored in ~/.web3_data_center/cache/ and is automatically managed.

Cached Operations

The following operations are cached by default:

  • Root funder lookups (24-hour cache)
  • Funding path queries (24-hour cache)
  • Funding relationship checks (24-hour cache)

Using the Cache

The cache is automatically used when calling the relevant methods. You can also use the caching decorator for your own functions:

from web3_data_center import file_cache

@file_cache(namespace="my_cache", ttl=3600)  # 1-hour cache
async def my_function():
    # Your code here
    pass

Cache Management

To clear the cache for a specific function:

data_center.get_root_funder.cache_clear()

To get the cache directory:

from web3_data_center import get_cache_dir
cache_dir = get_cache_dir()

The cache automatically manages:

  • Entry expiration (TTL-based)
  • Size limits
  • Cleanup of old entries

Documentation

For detailed documentation, please refer to the docs directory.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Thanks to all the API providers that make this project possible.
  • Special thanks to the open-source community for their invaluable tools and libraries.

Project details


Release history Release notifications | RSS feed

This version

0.7.8

Download files

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

Source Distribution

web3_data_center-0.7.8.tar.gz (81.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

web3_data_center-0.7.8-py3-none-any.whl (93.9 kB view details)

Uploaded Python 3

File details

Details for the file web3_data_center-0.7.8.tar.gz.

File metadata

  • Download URL: web3_data_center-0.7.8.tar.gz
  • Upload date:
  • Size: 81.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for web3_data_center-0.7.8.tar.gz
Algorithm Hash digest
SHA256 8631f9a3f6eb4a590040672e28c7412c917a560b32bcc64e1b82fc311a48c3a2
MD5 e6b7c6190df4abb17afec62c5d155d47
BLAKE2b-256 82abf05a3a8cdd8d464e1edd2c3e36694d918aa4e493fa46107bf032abeb0f7c

See more details on using hashes here.

File details

Details for the file web3_data_center-0.7.8-py3-none-any.whl.

File metadata

File hashes

Hashes for web3_data_center-0.7.8-py3-none-any.whl
Algorithm Hash digest
SHA256 28b4e83b76903dbc33c627b715063f656db72ccd8e5f52ab59f7738cc0047ae3
MD5 31dd8a9d4b572dbf7dd693ee4fa7c575
BLAKE2b-256 cadecac5586734447a51c9e324ce064e786e660ca33356c8441947c2095e42a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page