Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

subgrounds

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

subgrounds

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

  • 1.9.1
  • PyPI
  • Socket score

Maintainers
2

Subgrounds

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.

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[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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc