Modules for interacting with ThreeFold Grid v3.
Project description
Grid3.py
This is a collection of Python modules for working with ThreeFold Grid v3. It's designed foremostly for interactive use on the REPL and joyful scripting. We value conciseness and trying to do what you meant even at the expense of a few extra CPU cycles.
If you're looking for a Grid v3 SDK for writing efficient and maintainable code bases, check out Go or Rust. For code that must execute in the user's browser, see Typescript.
Installation
Get yourself a virtual environment (or live dangerously and shoot for system-wide, up to you) and then install the library using pip
:
python -m venv venv
pip install ...
Quick tour
With grid3.py, you can easily answer questions like, how many nodes are currently in the standby state that were online in the last 36 hours?
import time, grid3.util
mainnet = grid3.util.GridNetwork()
sleepers = mainnet.graphql.nodes(['nodeID'], power={'state': 'Down'}, updatedAt_gt=int(time.time()) - 24 * 60 * 60)
len(sleepers)
We just executed a query against the mainnet GraphQL endpoint nodes
without even sweating a line break. Pretty cool!
Then we can query a wallet balance on TF Chain:
Send an RMB message and receive a reply:
And create deployments (coming soon).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file grid3-0.1.0.tar.gz
.
File metadata
- Download URL: grid3-0.1.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/6.5.5-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f67a12196e38dfe03c88a22b9d648bfbfb14bad11c4aca679134b24e85327a4 |
|
MD5 | 04a7b626cc5bcfb17d098eb326a74776 |
|
BLAKE2b-256 | 37008e0478d4b92f6bb3fe093aca70587aa103be1698f9a81af9f78f39d779c1 |
File details
Details for the file grid3-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: grid3-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/6.5.5-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | faac5205de05ba9dcc07c6a61ced54055f5c3b612f1b93578d84e0ea5b8b7560 |
|
MD5 | dfeda07261d352b80219672ec1eb2c67 |
|
BLAKE2b-256 | c77e18c22b1a8536e2287e6f965c33820543671d9c2c9cdb7623b51cad2f2acb |