Skip to main content

No project description provided

Project description

GeckoTerminal Py

GeckoTerminal Py is a Python client for the GeckoTerminal API. It provides a user-friendly way to fetch network and pool data asynchronously or synchronously.

Installation

To install GeckoTerminal Py, use pip:

pip install geckoterminal-py

Usage

You can fetch data about networks using GeckoTerminal Py in two ways:

Asynchronous usage

from geckoterminal_py.client import GeckoTerminalClient
import asyncio


async def main():
    client = GeckoTerminalClient()
    networks_df = await client.get_networks()
    print(networks_df)

# In an asyncio environment, you'd use:
asyncio.run(main())

Synchronous usage

from geckoterminal_py.client import GeckoTerminalClient

def main():
    client = GeckoTerminalClient()
    networks_df = client.get_networks_sync()
    print(networks_df)

main()

Methods Available

Here is a brief description of the methods available in the GeckoTerminalClient:

Async methods:

  • get_networks(): Fetches network data in an asynchronous way.
  • get_dexes_by_network(network_id: str): Asynchronously fetches decentralized exchange (dex) data by network ID.
  • get_top_pools_by_network(network_id: str): Asynchronously fetches top pool data by network ID.
  • get_top_pools_by_network_dex(network_id: str, dex_id: str): Asynchronously fetches top pool data by network and dex IDs.
  • get_top_pools_by_network_token(network_id: str, token_id: str): Asynchronously fetches top pool data by network and token IDs.
  • get_new_pools_by_network(network_id: str): Asynchronously fetches data of new pools by network ID.
  • get_new_pools_all_networks(): Asynchronously fetches data of new pools across all networks.
  • get_ohlcv(network_id: str, pool_address: str, timeframe: str, before_timestamp: int = None, currency: str = "usd", token: str = "base", limit: int = 1000): Asynchronously fetches OHLCV data for a pool.

Sync methods:

  • get_networks_sync(): Fetches network data in a synchronous way.
  • get_dexes_by_network_sync(network_id: str): Synchronously fetches dex data by network ID.
  • get_top_pools_by_network_sync(network_id: str): Synchronously fetches top pool data by network ID.
  • get_top_pools_by_network_dex_sync(network_id: str, dex_id: str): Synchronously fetches top pool data by network and dex IDs.
  • get_top_pools_by_network_token_sync(network_id: str, token_id: str): Synchronously fetches top pool data by network and token IDs.
  • get_new_pools_by_network_sync(network_id: str): Synchronously fetches data of new pools by network ID.
  • get_new_pools_all_networks_sync(): Synchronously fetches data of new pools across all networks.
  • get_ohlcv_sync(network_id: str, pool_address: str, timeframe: str, before_timestamp: int = None, currency: str = "usd", token: str = "base", limit: int = 1000): Synchronously fetches OHLCV data for a pool.

Project details


Download files

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

Source Distribution

geckoterminal_py-0.1.1.tar.gz (16.1 kB view hashes)

Uploaded Source

Built Distribution

geckoterminal_py-0.1.1-py3-none-any.whl (16.8 kB view hashes)

Uploaded Python 3

Supported by

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