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.8.tar.gz
.
File metadata
- Download URL: grid3-0.1.8.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.8.1-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ff1672f5390c2d22c703a49c223242bfd586243195e1a117efcd0a8b9e5ea0e |
|
MD5 | 6b008c39bee837c8c7719fa120e8325a |
|
BLAKE2b-256 | d496ab46a15a85aee024f64342ec20a2043068eb944332ad0ac8348081cb968a |
File details
Details for the file grid3-0.1.8-py3-none-any.whl
.
File metadata
- Download URL: grid3-0.1.8-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.8.1-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d44792b1438b74758c0b91089e42217ec326b1636e6eff1a16ba47913096059d |
|
MD5 | 5d8528f9f1b1d18b594073ddbc9d0c08 |
|
BLAKE2b-256 | 94118bd2eb88d874b7edecdb0e1bd4ab95a9401c429cfa419bc7072aa29c7261 |