Skip to main content

A Pythonic data access layer for applications querying data from The Graph Network.

Project description

Subgrounds

Fork of https://github.com/0xPlaygrounds/subgrounds with small changes due to pending PRs in the original repository.

PyPI PyPI - Python Version Code style: black CI

Discord Twitter Follow

Open In Colab Github Codepsaces

An intuitive Python library for interfacing with subgraphs and GraphQL.

Features

  • Simple: Leverage a Pythonic API to easily build queries and transformations without the need for raw GraphQL manipulation.
  • Automated: Automatically handle pagination and schema introspection for effortless data retrieval.
  • Powerful: Create sophisticated queries using the SyntheticFields transformation system.

Resources

  • Docs: User guide and API documentation
  • Snippets: A list of examples showcasing Subgrounds integration with Dash and Plotly
  • Examples: An ever growing list of projects created by our community members and team
  • Videos: Video workshops on Subgrounds

Installation

Subgrounds requires atleast Python 3.10+

Subgrounds is available on PyPi. To install it, run the following:
pip install subgrounds-gnosis.

Subgrounds also comes bundled with extra modules that may require extra libraries. You can get all functionality of subgrounds via the following:
pip install subgrounds-gnosis[all].

Simple example

>>> from subgrounds import Subgrounds

>>> sg = Subgrounds()

>>> # Load
>>> aave_v3 = sg.load_subgraph("https://api.thegraph.com/subgraphs/name/messari/aave-v3-ethereum")

>>> # Construct the query
>>> largest_markets = aave_v3.Query.markets(
...     orderBy=aave_v3.Market.totalValueLockedUSD,
...     orderDirection='desc',
...     first=5,
... )

>>> # Return query to a dataframe
>>> sg.query_df([
...     largest_markets.name,
...     largest_markets.totalValueLockedUSD,
... ])
          markets_name  markets_totalValueLockedUSD
0 Aave Ethereum wstETH                 1.915090e+09
1   Aave Ethereum WETH                 1.047417e+09
2   Aave Ethereum WBTC                 6.049655e+08
3   Aave Ethereum USDC                 4.482461e+08
4   Aave Ethereum USDT                 4.280103e+08

About Us

Playgrounds Analytics is a data solutions company providing data infrastructures and services for data teams, analysts, and engineers. Check us out here to learn more!

Acknowledgments

This software project would not be possible without the support of The Graph Foundation. You can learn more about The Graph and its mission here.

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

subgrounds_gnosis-1.9.2.tar.gz (60.8 kB view details)

Uploaded Source

Built Distribution

subgrounds_gnosis-1.9.2-py3-none-any.whl (73.8 kB view details)

Uploaded Python 3

File details

Details for the file subgrounds_gnosis-1.9.2.tar.gz.

File metadata

  • Download URL: subgrounds_gnosis-1.9.2.tar.gz
  • Upload date:
  • Size: 60.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.12.0 readme-renderer/44.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.3.0 tqdm/4.67.1 importlib-metadata/8.6.1 keyring/25.6.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.16

File hashes

Hashes for subgrounds_gnosis-1.9.2.tar.gz
Algorithm Hash digest
SHA256 7f1fddc821a108cfc0e585584b8c8ae466c1b8db0cfec7a95a0b330eede47071
MD5 135bfc71dae8574135000f51e92e1771
BLAKE2b-256 0bd865e593d2b1690001cf08ceab15677ca78a1be860f3457d5add6e09c17b70

See more details on using hashes here.

File details

Details for the file subgrounds_gnosis-1.9.2-py3-none-any.whl.

File metadata

  • Download URL: subgrounds_gnosis-1.9.2-py3-none-any.whl
  • Upload date:
  • Size: 73.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.12.0 readme-renderer/44.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.3.0 tqdm/4.67.1 importlib-metadata/8.6.1 keyring/25.6.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.16

File hashes

Hashes for subgrounds_gnosis-1.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 60644bb7f8befaca2fb145b797c8dde7cfd169c45cca670aec1a171a3b6a7368
MD5 90e33a1da9ce1d512d0a68ebb97a0419
BLAKE2b-256 5b3eb158d1b406b988323de2cac578da275399fb20a34bf11e1cedacf787e9f3

See more details on using hashes here.

Supported by

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