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
nectarpy-0.14.5.tar.gz
(31.0 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
nectarpy-0.14.5-py3-none-any.whl
(31.8 kB
view details)
File details
Details for the file nectarpy-0.14.5.tar.gz.
File metadata
- Download URL: nectarpy-0.14.5.tar.gz
- Upload date:
- Size: 31.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47dd3e18aa987684b5a05d062c2738957cb8902f149a238af6cc184ae1c5a5dd
|
|
| MD5 |
ede8f833fa861b03a65545aae8ae9a6e
|
|
| BLAKE2b-256 |
b3605b16b851009ff69abbc654aba035fa9c5d0d91a89e9f61d9c17b87493e3f
|
File details
Details for the file nectarpy-0.14.5-py3-none-any.whl.
File metadata
- Download URL: nectarpy-0.14.5-py3-none-any.whl
- Upload date:
- Size: 31.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7908af433706f91aa2e70b3a840d60813c624f22ffcdeb4058998f68b49fa257
|
|
| MD5 |
daef8b266936ae96c8040382b4639ff4
|
|
| BLAKE2b-256 |
a0a3b61d54c7f63a8f1b1fa6a6d47fd898ceada3250ca48e589e3284fa640b59
|