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.1.7.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

grid3-0.1.7-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grid3-0.1.7.tar.gz
  • Upload date:
  • Size: 14.7 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

Hashes for grid3-0.1.7.tar.gz
Algorithm Hash digest
SHA256 4349ab2633b580c8fbf146cceb517a34b4a2fde91b6873fb33aced2b6dbf41ad
MD5 9118173a9f84f87cb3ab156046c9a41f
BLAKE2b-256 6332e9e765c2369e13d7bfe00fd72917781bc2ca580cadbedc6bc694b7c89206

See more details on using hashes here.

File details

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

File metadata

  • Download URL: grid3-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 16.2 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

Hashes for grid3-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d29168ddc4a3bab97c225379185e54d14849a308554370f7ac10604911cb8fde
MD5 b9f334a93b3f4fb4f6a6b05b3a9a12ab
BLAKE2b-256 5f491be867ba63bb5ca926c8e5e308d09e8aa9c13fc8c2e16a695fbbd6dadb01

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