# Subgrounds
<!-- [![GitHub Actions](https://github.com/0xPlaygrounds/subgrounds/workflows/CI/badge.svg)](https://github.com/0xPlaygrounds/subgrounds/actions) -->
[![PyPI](https://img.shields.io/pypi/v/subgrounds.svg)](https://pypi.org/project/subgrounds/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/subgrounds.svg)](https://pypi.org/project/subgrounds/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![CI](https://github.com/0xPlaygrounds/subgrounds/actions/workflows/main.yml/badge.svg)](https://github.com/0xPlaygrounds/subgrounds/actions/workflows/main.yml)
<br>
[![Discord](https://img.shields.io/discord/896944341598208070?color=7289DA&label=discord&logo=discord&logoColor=fff)](https://discord.gg/gMSSh5bjvk)
[![Twitter Follow](https://img.shields.io/badge/Playgrounds-Analytics-31fa1f2Playgrounds0x?color=%231fa1f2&logo=Twitter&logoColor=1fa1f2&style=flat)](https://twitter.com/Playgrounds0x)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/0xPlaygrounds/subgrounds/blob/main/examples/notebook.ipynb)
[![Github Codepsaces](https://img.shields.io/badge/Github-Codespaces-24292f.svg?logo=Github)](https://codespaces.new/0xPlaygrounds/subgrounds-template?quickstart=1)
<!-- start elevator-pitch -->
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.
<!-- end elevator-pitch -->
## Resources
- [**Docs**](http://docs.playgrounds.network/): User guide and API documentation
- [**Snippets**](https://github.com/0xPlaygrounds/subgrounds/tree/main/examples): A list of examples showcasing Subgrounds integration with Dash and Plotly
- [**Examples**](http://docs.playgrounds.network/subgrounds/examples/): An ever growing list of projects created by our community members and team
- [**Videos**](https://docs.playgrounds.network/subgrounds/videos/): Video workshops on Subgrounds
## Installation
> Subgrounds **requires** atleast Python 3.10+
Subgrounds is available on PyPi. To install it, run the following:<br>
`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:<br>
`pip install subgrounds[all]`.
## Simple example
<!-- start simple-example -->
```python
>>> 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
```
<!-- end simple-example -->
## About Us
Playgrounds Analytics is a data solutions company providing data infrastructures and services for data teams, analysts, and engineers. Check us out [here](https://playgrounds.network/) 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](https://thegraph.com/).
Raw data
{
"_id": null,
"home_page": "https://github.com/0xPlaygrounds/subgrounds",
"name": "subgrounds",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "graph, subgrounds, graphql, subgraph",
"author": "cvauclair",
"author_email": "cvauclair@playgrounds.network",
"download_url": "https://files.pythonhosted.org/packages/a3/c1/c9a1871be8b965a3f4320cdcd6f2d383eff4107657d97cc626cfddc3f8f1/subgrounds-1.9.1.tar.gz",
"platform": null,
"description": "# Subgrounds\n<!-- [![GitHub Actions](https://github.com/0xPlaygrounds/subgrounds/workflows/CI/badge.svg)](https://github.com/0xPlaygrounds/subgrounds/actions) -->\n[![PyPI](https://img.shields.io/pypi/v/subgrounds.svg)](https://pypi.org/project/subgrounds/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/subgrounds.svg)](https://pypi.org/project/subgrounds/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n[![CI](https://github.com/0xPlaygrounds/subgrounds/actions/workflows/main.yml/badge.svg)](https://github.com/0xPlaygrounds/subgrounds/actions/workflows/main.yml)\n<br>\n\n[![Discord](https://img.shields.io/discord/896944341598208070?color=7289DA&label=discord&logo=discord&logoColor=fff)](https://discord.gg/gMSSh5bjvk)\n[![Twitter Follow](https://img.shields.io/badge/Playgrounds-Analytics-31fa1f2Playgrounds0x?color=%231fa1f2&logo=Twitter&logoColor=1fa1f2&style=flat)](https://twitter.com/Playgrounds0x)\n\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/0xPlaygrounds/subgrounds/blob/main/examples/notebook.ipynb)\n[![Github Codepsaces](https://img.shields.io/badge/Github-Codespaces-24292f.svg?logo=Github)](https://codespaces.new/0xPlaygrounds/subgrounds-template?quickstart=1)\n\n<!-- start elevator-pitch -->\nAn intuitive Python library for interfacing with subgraphs and GraphQL.\n\n## Features\n- **Simple**: Leverage a Pythonic API to easily build queries and transformations without the need for raw GraphQL manipulation.\n- **Automated**: Automatically handle pagination and schema introspection for effortless data retrieval.\n- **Powerful**: Create sophisticated queries using the `SyntheticFields` transformation system.\n<!-- end elevator-pitch -->\n\n## Resources\n- [**Docs**](http://docs.playgrounds.network/): User guide and API documentation\n- [**Snippets**](https://github.com/0xPlaygrounds/subgrounds/tree/main/examples): A list of examples showcasing Subgrounds integration with Dash and Plotly\n- [**Examples**](http://docs.playgrounds.network/subgrounds/examples/): An ever growing list of projects created by our community members and team\n- [**Videos**](https://docs.playgrounds.network/subgrounds/videos/): Video workshops on Subgrounds\n\n## Installation\n> Subgrounds **requires** atleast Python 3.10+\n\nSubgrounds is available on PyPi. To install it, run the following:<br>\n`pip install subgrounds`.\n\nSubgrounds also comes bundled with extra modules that may require extra libraries. You can get all functionality of `subgrounds` via the following:<br>\n`pip install subgrounds[all]`.\n\n## Simple example\n<!-- start simple-example -->\n```python\n>>> from subgrounds import Subgrounds\n\n>>> sg = Subgrounds()\n\n>>> # Load\n>>> aave_v3 = sg.load_subgraph(\"https://api.thegraph.com/subgraphs/name/messari/aave-v3-ethereum\")\n\n>>> # Construct the query\n>>> largest_markets = aave_v3.Query.markets(\n... orderBy=aave_v3.Market.totalValueLockedUSD,\n... orderDirection='desc',\n... first=5,\n... )\n\n>>> # Return query to a dataframe\n>>> sg.query_df([\n... largest_markets.name,\n... largest_markets.totalValueLockedUSD,\n... ])\n markets_name markets_totalValueLockedUSD\n0 Aave Ethereum wstETH 1.915090e+09\n1 Aave Ethereum WETH 1.047417e+09\n2 Aave Ethereum WBTC 6.049655e+08\n3 Aave Ethereum USDC 4.482461e+08\n4 Aave Ethereum USDT 4.280103e+08\n```\n<!-- end simple-example -->\n\n\n## About Us\nPlaygrounds Analytics is a data solutions company providing data infrastructures and services for data teams, analysts, and engineers. Check us out [here](https://playgrounds.network/) to learn more!\n\n\n## Acknowledgments\nThis software project would not be possible without the support of The Graph Foundation. You can learn more about The Graph and its mission [here](https://thegraph.com/).\n\n",
"bugtrack_url": null,
"license": null,
"summary": "A Pythonic data access layer for applications querying data from The Graph Network.",
"version": "1.9.1",
"project_urls": {
"Homepage": "https://github.com/0xPlaygrounds/subgrounds",
"Repository": "https://github.com/0xPlaygrounds/subgrounds"
},
"split_keywords": [
"graph",
" subgrounds",
" graphql",
" subgraph"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "00ea7567844b2b8af389c82443c3ce69177a83ff98f3392d43b062e3192b8b43",
"md5": "c8201f2da90a018f7be849bf296d7ebd",
"sha256": "3195d2d6a1ffb18ac6d0e0d7e5996170ee0987457edae2412fe55249e711b8c6"
},
"downloads": -1,
"filename": "subgrounds-1.9.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c8201f2da90a018f7be849bf296d7ebd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 73692,
"upload_time": "2024-06-20T14:28:15",
"upload_time_iso_8601": "2024-06-20T14:28:15.686229Z",
"url": "https://files.pythonhosted.org/packages/00/ea/7567844b2b8af389c82443c3ce69177a83ff98f3392d43b062e3192b8b43/subgrounds-1.9.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a3c1c9a1871be8b965a3f4320cdcd6f2d383eff4107657d97cc626cfddc3f8f1",
"md5": "f5b4ae582213290c0c94698880904dfa",
"sha256": "17cba3192a98cd9deaac5ac4f5d935e614d03b69a663d7b225125011119ad69c"
},
"downloads": -1,
"filename": "subgrounds-1.9.1.tar.gz",
"has_sig": false,
"md5_digest": "f5b4ae582213290c0c94698880904dfa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 60566,
"upload_time": "2024-06-20T14:28:17",
"upload_time_iso_8601": "2024-06-20T14:28:17.960052Z",
"url": "https://files.pythonhosted.org/packages/a3/c1/c9a1871be8b965a3f4320cdcd6f2d383eff4107657d97cc626cfddc3f8f1/subgrounds-1.9.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-20 14:28:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "0xPlaygrounds",
"github_project": "subgrounds",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "subgrounds"
}