A Python API module designed to run queries on Nectar
Project description
PYTHON NECTAR MODULE
This is a Python API module designed to run queries on Nectar, add bucket information, and set policies.
Install
pip3 install nectarpy
Python Example
from nectarpy import Nectar
API_SECRET = "<api-secret>"
nectar = Nectar(API_SECRET)
policy_id = nectar.add_policy(
allowed_categories=["*"],
allowed_addresses=[],
allowed_columns=["*"],
valid_days=1000,
usd_price=0.0123,
)
TEE_DATA_URL = "https://<ip-address>:5229/"
bucket_id = nectar.add_bucket(
policy_ids=[policy_id],
data_format="std1",
node_address=TEE_DATA_URL,
)
result = nectar.train_model(
type="linear-regression",
parameters='{"xcols":["heart_rate","age"],"ycol":"height"}',
filters='[{"column":"smoking","filter":"=","value":false}]',
use_allowlists=[False],
access_indexes=[0],
bucket_ids=[bucket_id],
policy_indexes=[0],
)
print(result)
Integration Tests
1: Create a .env file
API_SECRET=0x123...
NETWORK_MODE=<localhost | moonbase | moonbeam>
TEE_DATA_URL=https://<ip-address>:5229/
2: Run
python3 tests.py
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
dev_nectarpy-0.0.1.tar.gz
(30.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dev_nectarpy-0.0.1.tar.gz.
File metadata
- Download URL: dev_nectarpy-0.0.1.tar.gz
- Upload date:
- Size: 30.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6437205d2f17906fa52368bc70dab4c1b7e94df52be55ee543d60e9b1e47fbd
|
|
| MD5 |
35a88f3c164d2915845334a876c5e6c9
|
|
| BLAKE2b-256 |
a9657e1d4358ec268d2f097b1e9173c2e7fabcc779ebccaf0881455021ec2e68
|
File details
Details for the file dev_nectarpy-0.0.1-py3-none-any.whl.
File metadata
- Download URL: dev_nectarpy-0.0.1-py3-none-any.whl
- Upload date:
- Size: 32.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
869652bd0353fd76c200a7ef83d45e9341f241c1dd656f1bae7987f4ffe2ba6c
|
|
| MD5 |
4b3042b07780ef0bfd05f4eb8cdc584a
|
|
| BLAKE2b-256 |
8792784401e86fdbdb81a6ce155dad44ecc3de67413f29345f36afe39993d8b9
|