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 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


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

Uploaded Source

Built Distribution

grid3-0.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grid3-0.1.1.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

Hashes for grid3-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1b0e8c023acd513e6eec5970398acc412d54141245c4a7b58f0747245b63db4a
MD5 341c862262fa43711e283f013c5a0900
BLAKE2b-256 41d823c5434df389d8d1ef1fd5424e25829faed02c3163c5bb9440cc0214eed8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: grid3-0.1.1-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

Hashes for grid3-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dcda97be7eb20ea779a3f8fb2b9f848d4cfff1540f3bb85dff54b2ece933da7c
MD5 33a91f32ec3846522e495b5d2e349ca6
BLAKE2b-256 70e75c28286217aca988d1c037d69a8e206b60e6897407516c45922079d03b47

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