web3-data-center


Nameweb3-data-center JSON
Version 0.6.9 PyPI version JSON
download
home_pagehttps://github.com/gmatrixuniverse/web3_data_center
SummaryWeb3 data center integrating multiple APIs for blockchain data analysis
upload_time2024-12-09 07:25:32
maintainerNone
docs_urlNone
authorGmatrixuniverse
requires_python>=3.7
licenseNone
keywords web3 blockchain data analysis
VCS
bugtrack_url
requirements pytest pytest-asyncio black isort flake8 mypy asyncpg beautifulsoup4 lxml pytesseract opensearch-py pymongo aiofiles diskcache
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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:


```bash
pip install data_center
```



## Quick Start

Here's a simple example of how to use Web3 Data Center:
```python
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:

```python
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:
```python
data_center.get_root_funder.cache_clear()
```

To get the cache directory:
```python
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](./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](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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/gmatrixuniverse/web3_data_center",
    "name": "web3-data-center",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "web3 blockchain data analysis",
    "author": "Gmatrixuniverse",
    "author_email": "gmatrixuniverse@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/12/15/c479edfe56635217ef73b7555dd2c69599f310e9a235327e32185d41725b/web3_data_center-0.6.9.tar.gz",
    "platform": null,
    "description": "# Web3 Data Center\n\nWeb3 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.\n\n## Features\n\n- Integration with multiple blockchain data providers (GeckoTerminal, GMGN, Birdeye, Solscan, GoPlus, DexScreener)\n- Asynchronous API calls for improved performance\n- Persistent file-based caching system for optimized data retrieval\n- Caching mechanism to reduce API calls and improve response times\n- Support for multiple blockchains (Ethereum, Solana, and more)\n- Token information retrieval (price, market cap, holders, etc.)\n- Transaction analysis\n- Token security checks\n\n## Installation\n\nYou can install Web3 Data Center using pip:\n\n\n```bash\npip install data_center\n```\n\n\n\n## Quick Start\n\nHere's a simple example of how to use Web3 Data Center:\n```python\nimport asyncio\nfrom web3_data_center import DataCenter\nasync def main():\ndata_center = DataCenter()\n# Get token info\ntoken_address = \"CzLSujWBLFsSjncfkh59rUFqvafWcY5tzedWJSuypump\" # Wrapped SOL\ntoken_info = await data_center.get_token_info(token_address)\nprint(f\"Token Info: {token_info}\")\n# Get top holders\ntop_holders = await data_center.get_top_holders(token_address, limit=10)\nprint(f\"Top 10 Holders: {top_holders}\")\nasyncio.run(main())\n```\n\n\n## Caching System\n\nWeb3 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.\n\n### Cached Operations\n\nThe following operations are cached by default:\n- Root funder lookups (24-hour cache)\n- Funding path queries (24-hour cache)\n- Funding relationship checks (24-hour cache)\n\n### Using the Cache\n\nThe cache is automatically used when calling the relevant methods. You can also use the caching decorator for your own functions:\n\n```python\nfrom web3_data_center import file_cache\n\n@file_cache(namespace=\"my_cache\", ttl=3600)  # 1-hour cache\nasync def my_function():\n    # Your code here\n    pass\n```\n\n### Cache Management\n\nTo clear the cache for a specific function:\n```python\ndata_center.get_root_funder.cache_clear()\n```\n\nTo get the cache directory:\n```python\nfrom web3_data_center import get_cache_dir\ncache_dir = get_cache_dir()\n```\n\nThe cache automatically manages:\n- Entry expiration (TTL-based)\n- Size limits\n- Cleanup of old entries\n\n## Documentation\n\nFor detailed documentation, please refer to the [docs](./docs) directory.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Thanks to all the API providers that make this project possible.\n- Special thanks to the open-source community for their invaluable tools and libraries.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Web3 data center integrating multiple APIs for blockchain data analysis",
    "version": "0.6.9",
    "project_urls": {
        "Homepage": "https://github.com/gmatrixuniverse/web3_data_center"
    },
    "split_keywords": [
        "web3",
        "blockchain",
        "data",
        "analysis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c26f755551ab58624345164b4987ec8e5c1718e364f9978a353bfe41230d879",
                "md5": "650425a67cca38c4f4dd58b4652dec44",
                "sha256": "25c4fcdfeddb21d60a5b263d505b1982eab25fb24fc34d2e0833f82cc4b4c301"
            },
            "downloads": -1,
            "filename": "web3_data_center-0.6.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "650425a67cca38c4f4dd58b4652dec44",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 69693,
            "upload_time": "2024-12-09T07:25:28",
            "upload_time_iso_8601": "2024-12-09T07:25:28.705018Z",
            "url": "https://files.pythonhosted.org/packages/6c/26/f755551ab58624345164b4987ec8e5c1718e364f9978a353bfe41230d879/web3_data_center-0.6.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1215c479edfe56635217ef73b7555dd2c69599f310e9a235327e32185d41725b",
                "md5": "0343b913f92f519070d48be43a402263",
                "sha256": "1c7dd2b4edf8767ced9b7b4f2c6eb6ae08fe0993f2de7cf6cfb2fa283e0f1ed4"
            },
            "downloads": -1,
            "filename": "web3_data_center-0.6.9.tar.gz",
            "has_sig": false,
            "md5_digest": "0343b913f92f519070d48be43a402263",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 58456,
            "upload_time": "2024-12-09T07:25:32",
            "upload_time_iso_8601": "2024-12-09T07:25:32.517899Z",
            "url": "https://files.pythonhosted.org/packages/12/15/c479edfe56635217ef73b7555dd2c69599f310e9a235327e32185d41725b/web3_data_center-0.6.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-09 07:25:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gmatrixuniverse",
    "github_project": "web3_data_center",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pytest",
            "specs": []
        },
        {
            "name": "pytest-asyncio",
            "specs": []
        },
        {
            "name": "black",
            "specs": []
        },
        {
            "name": "isort",
            "specs": []
        },
        {
            "name": "flake8",
            "specs": []
        },
        {
            "name": "mypy",
            "specs": []
        },
        {
            "name": "asyncpg",
            "specs": []
        },
        {
            "name": "beautifulsoup4",
            "specs": []
        },
        {
            "name": "lxml",
            "specs": []
        },
        {
            "name": "pytesseract",
            "specs": []
        },
        {
            "name": "opensearch-py",
            "specs": []
        },
        {
            "name": "pymongo",
            "specs": []
        },
        {
            "name": "aiofiles",
            "specs": [
                [
                    ">=",
                    "23.1.0"
                ]
            ]
        },
        {
            "name": "diskcache",
            "specs": [
                [
                    ">=",
                    "5.6.1"
                ]
            ]
        }
    ],
    "lcname": "web3-data-center"
}
        
Elapsed time: 0.41734s