Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grid3-0.2.0.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

grid3-0.2.0-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file grid3-0.2.0.tar.gz.

File metadata

  • Download URL: grid3-0.2.0.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Linux/6.6.49-1-lts

File hashes

Hashes for grid3-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b7c6027247a85475de707df4369a1920220eeff9bc7e068defdb420ca523db9a
MD5 ea4f78448c3e0627311dc491c7764fe2
BLAKE2b-256 b0f92030fd0d7fe20ff36f8d6fdae014ca5ccaa23de23631bce3d27f4ff179ca

See more details on using hashes here.

File details

Details for the file grid3-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: grid3-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 26.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Linux/6.6.49-1-lts

File hashes

Hashes for grid3-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64eae4669bd4aecceebb31b73f7d7538e7e9e33ef865ea42ad6a77bf6e221b43
MD5 c5c23a9188184f1849d284189fc0cc9a
BLAKE2b-256 8bb5a5cc49e32815185cf34118f3be7951d62d3238da2df8b6003f8107fa3dc3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page