Skip to main content

NetsBlox-python

NetsBlox is a block-based programming environment which has a focus on distributed computing and internet connectivity. One of the core features of NetsBlox are remote procedure calls (RPCs), which connect to the NetsBlox server and provide access to online resources such as databases, GoogleMaps, online translation, wireless robotics, mobile phone sensors/control, and more.

NetsBlox-python is an interface for accessing all NetsBlox services from within python. You can import this package in any python program that has internet access and begin calling RPCs and sending/receiving messages!

For more information about NetsBlox and the available services, see the official NetsBlox Documentation.

Example Usage

Here's a short example to see how you can access the MaunaLoaCO2Data service from python.

import netsblox
nb = netsblox.Client() # create a client to access NetsBlox

data = nb.mauna_loa_co2_data.get_co2_trend(2000, 2010)
print(data)

Turtle IDE

NetsBlox-python, while useful on its own for accessing NetsBlox services, has a side goal of helping transition students from block-based languages like NetsBlox and Snap! into textual languages like python. Because of this, NetsBlox-python comes with a custom wrapper for the popular turtle environment, as well as an IDE for creating python projects in a way that is still structured like a NetsBlox/Snap! project in both appearnance and concurrency model (closest approximation).

These features are only activated when explicitly called, leaving the default behavior as a normal python package for accessing NetsBlox services.

To launch the IDE, you can simply run the NetsBlox-python pypi package as a module:

python -m netsblox

Installation

NetsBlox-python is available as a pip package called netsblox (keep in mind that NetsBlox-python is a python3 package, so you may need to use pip3 if your pip still points to the python2 version).

pip install netsblox

This will pull all of the core python dependencies for using NetsBlox services, but some additional setup is needed for the turtle environment and IDE to work.

Windows

No additional install dependencies

Mac

brew install python-tk

Linux

sudo apt install python3-pil python3-pil.imagetk
sudo apt install idle3

Structured Data

Due to the limited type primitives in Snap!, one NetsBlox typing convention is "structured data", which is really just a list of lists (pairs) denoting (unique string) keys and values. In the python interface, this is replaced by dict for both input and return value. The python interface will automatically convert input dict values into lists of lists, and convert lists of lists return values into dict (where appropriate).

Naming Conventions

The python names for services, functions, and input parameters are identical to those in the official NetsBlox documentation, except that they are converted into snake case to by more pythonic. Of course, any modern editor will have some form of intellisense built in, so in practice this is a non-issue.

Download files

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

Source Distribution

netsblox-0.5.2.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netsblox-0.5.2-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file netsblox-0.5.2.tar.gz.

File metadata

  • Download URL: netsblox-0.5.2.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for netsblox-0.5.2.tar.gz
Algorithm Hash digest
SHA256 3240e7b5e342e3fef003672dc5d78cc0fb3ab4f543fcef0e33fbe26e9750f85e
MD5 d60b038341721324711ffb2402d2405f
BLAKE2b-256 ea157db0c557e1f2d67202e8aa2421fce4bda1faa51cab417413be0c41d9bdc5

See more details on using hashes here.

File details

Details for the file netsblox-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: netsblox-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for netsblox-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3fbbe19a5810200f0b60df997390faf7662b597d1353c8c9a5b5b3154a238559
MD5 18b169937928bba73e6ffc3605b89a30
BLAKE2b-256 91fb09e924b162cb9c4739c5808fbf7571ccc6bcb24f04176a7325dfe75caf93

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.20

2 files

0.6.19

2 files

0.6.18

2 files

0.6.17

2 files

0.6.16

2 files

0.6.15

2 files

0.6.14

2 files

0.6.13

2 files

0.6.12

2 files

0.6.11

2 files

0.6.10

2 files

0.6.9

2 files

0.6.8

1 file

0.6.7

1 file

0.6.6

1 file

0.6.5

1 file

0.6.4

1 file

0.6.3

1 file

0.6.2

1 file

0.6.1

1 file

0.6.0

1 file

0.5.17

1 file

0.5.16

1 file

0.5.15

2 files

0.5.14

2 files

0.5.13

2 files

0.5.12

2 files

0.5.11

2 files

0.5.10

2 files

0.5.9

2 files

0.5.8

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

This release

0.5.2 This release

2 files

0.5.1

2 files

0.5.0

2 files

0.4.17

2 files

0.4.16

2 files

0.4.15

2 files

0.4.14

2 files

0.4.13

2 files

0.4.12

2 files

0.4.11

2 files

0.4.10

2 files

0.4.9

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page