A python client for accessing NetsBlox
Project description
NetsBlox-python
NetsBlox-python is a wrapper for accessing 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.
Installation
NetsBlox-python is available as a pip package called netsblox
, so you can install it with the following:
pip install 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.
Example Usage
Here's a short example to see how you can access the MaunaLoaCO2Data
service from python.
import netsblox
client = netsblox.Client() # create a client to access NetsBlox
co2 = client.get_service('MaunaLoaCO2Data')
data = co2.get_co2_trend(2000, 2010)
print(data)
Naming Conventions
As seen in the example above, services are referenced by name as a string.
These are identical to the service names shown in the NetsBlox services documentation.
The RPCs (functions) in each service, however, are methods on the service object.
NetsBlox uses cammelCase
names, while python uses snake_case
.
If you see a function in the NetsBlox documentation like performSomeAction
, you just need to write the equivalent snake case name perform_some_action
.
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
Hashes for netsblox-0.2.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01858358e14b8aa333148fb38efd257d6a379bb19a6eec3ef73853b0deff8a63 |
|
MD5 | 2d5a27d58e1b4f9527c1800671770ebe |
|
BLAKE2b-256 | c13cf96d3008d0af3d918aaf2dee5098e2d04987451db8dd1f3b580eb5acd75d |