Subgrounds
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
SyntheticFieldstransformation 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.
Metadata
Release files for subgrounds 1.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| subgrounds-1.9.1.tar.gz | 60.6 kB | Without provenance | Details for subgrounds-1.9.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| subgrounds-1.9.1-py3-none-any.whl | Python 3 | none | any | Details for subgrounds-1.9.1-py3-none-any.whl |
Total release size: 134.3 kB
Release files / subgrounds-1.9.1.tar.gz
| Download URL | subgrounds-1.9.1.tar.gz |
|---|---|
| Size | 60.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17cba3192a98cd9deaac5ac4f5d935e614d03b69a663d7b225125011119ad69c
|
|
BLAKE2b-256 checksum How to use checksums |
a3c1c9a1871be8b965a3f4320cdcd6f2d383eff4107657d97cc626cfddc3f8f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.11.1 readme-renderer/43.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.2.2 tqdm/4.66.4 importlib-metadata/7.1.0 keyring/25.2.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.14
|
Release files / subgrounds-1.9.1-py3-none-any.whl
| Download URL | subgrounds-1.9.1-py3-none-any.whl |
|---|---|
| Size | 73.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3195d2d6a1ffb18ac6d0e0d7e5996170ee0987457edae2412fe55249e711b8c6
|
|
BLAKE2b-256 checksum How to use checksums |
00ea7567844b2b8af389c82443c3ce69177a83ff98f3392d43b062e3192b8b43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.11.1 readme-renderer/43.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.2.2 tqdm/4.66.4 importlib-metadata/7.1.0 keyring/25.2.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.14
|
Security for subgrounds 1.9.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.