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. For code that must execute in the user's browser, see Typescript.
Installation
Tldr: pip install grid3
Requirements
Most of the functionality just requires python3.8
or newer.
The Reliable Message Bus functionality is Linux only and also depends on:
Detailed install
Assuming that python
is python3
and pip
is pip3
, install the latest release from PyPI into a venv using pip
:
python -m venv venv
source venv/bin/activate
pip install grid3
Quick tour
With the graphql
module, 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.network
mainnet = grid3.network.GridNetwork()
sleepers = mainnet.graphql.nodes(['nodeID'], power={'state_eq': 'Down'}, updatedAt_gt=int(time.time()) - 24 * 60 * 60)
print(len(sleepers))
We just executed a query against the mainnet GraphQL endpoint nodes
without even sweating a line break. Pretty cool!
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.9.tar.gz
.
File metadata
- Download URL: grid3-0.1.9.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.8.7-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 743ac6c528ff6a2b1f03f0b2dcb4f4b26a427bc61b9d0f65abaa30a84aa2ea84 |
|
MD5 | 9daa0518bda9464907a1a98a2ab4da86 |
|
BLAKE2b-256 | 301874a3a768d9870594ba71554e1a66c07f9addc49ae92b0909b2648ebd1078 |
File details
Details for the file grid3-0.1.9-py3-none-any.whl
.
File metadata
- Download URL: grid3-0.1.9-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.8.7-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d589ce5106862ebca4bcc3573d367b717b4a537c8e36ab7a58a9581b1881658 |
|
MD5 | 39450dc3d7cb2a2ad9f8453d0ac94479 |
|
BLAKE2b-256 | 30339f50a506674acbd3c6badf40e2cac882014c4a82e69730d9e7d3ac821952 |