# NeurionPy
NeurionPy is the official Python SDK for interacting with the **Neurion** blockchain, a Cosmos SDK-based network designed for **privacy-preserving AI, federated learning, and decentralized automation**. NeurionPy provides developers with all the necessary tools to create wallets, sign transactions, and interact with various modules on the blockchain.
## Features
- **Wallet Management**: Generate wallets from private keys, mnemonics, or existing addresses.
- **Transaction Signing**: Sign and broadcast transactions securely.
- **Querying the Blockchain**: Retrieve blockchain state, account balances, and contract data.
- **Module Interactions**: Full support for all Neurion modules:
- **Sanctum**: Privacy-preserving dataset sharing and usage requests.
- **Crucible**: Federated learning, model training, and validation.
- **Fusion**: AI model aggregation and dispute resolution.
- **Ganglion**: AI agent and workflow automation.
- **GRPC & REST Support**: Seamlessly interact with the Neurion blockchain via GRPC and REST APIs.
## Installation
Install NeurionPy using pip:
```sh
pip install neurionpy
```
Package available on PyPI: [NeurionPy](https://pypi.org/project/neurionpy/)
## Getting Started
### Importing NeurionPy
```python
import grpc
from neurionpy.synapse.client import NeurionClient, NetworkConfig
from neurionpy.synapse.wallet import LocalWallet
```
### Creating a Wallet
```python
wallet = LocalWallet.from_mnemonic(
"your mnemonic here",
"neurion"
)
print("Address:", wallet.address)
```
### Connecting to Neurion
```python
client = NeurionClient(NetworkConfig.neurion_localnet(), wallet)
```
## Module Interactions
Below are **examples** of interactions with the different Neurion modules. More operations are supported; refer to the API documentation for the full list.
### Sanctum (Privacy-Preserving Dataset Management)
#### Example: Submitting a Dataset Application
```python
tx = client.sanctum.tx.SubmitDatasetApplication(
message=MsgSubmitDatasetApplication(
creator=str(wallet.address()),
encrypted_data_link="https://encrypted_data_link",
explanation_link="https://explanation_link",
contact="contact",
stake=100000000,
proof_of_authenticity="proof_of_authenticity",
dataset_usage_fee=100000000
)
)
print(f"TX {tx.tx_hash} submitted.")
```
Other available Sanctum operations:
- Approve dataset applications
- Request to use datasets
- Manage dataset processing
### Crucible (Federated Learning & Model Validation)
#### Example: Registering as a Model Trainer
```python
tx = client.crucible.tx.RegisterTrainer(
message=MsgRegisterTrainer(
creator=str(wallet.address()),
task_id=1
)
)
print(f"Trainer Registration TX: {tx.tx_hash}")
```
Other available Crucible operations:
- Submit training results
- Stake tokens to tasks
- Report model plagiarism
### Fusion (AI Model Aggregation & Dispute Resolution)
#### Example: Proposing a Model for a Task
```python
tx = client.fusion.tx.ProposeModel(
message=MsgProposeModel(
creator=str(wallet.address()),
task_id=1,
model_link="https://model_link",
metadata_link="https://metadata_link"
)
)
print(f"Model Proposal TX: {tx.tx_hash}")
```
Other available Fusion operations:
- Register as a proposer or validator
- Dispute model scores
- Claim rewards from tasks
### Ganglion (AI Agent & Workflow Automation)
#### Example: Registering an AI Agent (Ion)
```python
tx = client.ganglion.tx.RegisterIon(
message=MsgRegisterIon(
capacities=["SCRAPER", "EXTRACTOR"],
stake=10000000,
endpoints=["http://localhost", "http://66.63.66.66"],
description="A scraper and extractor",
input_schema='{"name":"string","flag":"boolean"}',
output_schema='{"another_flag":"boolean","fullname":"string"}',
fee_per_thousand_calls=18,
)
)
print(f"Ion Registration TX: {tx.tx_hash}")
```
Other available Ganglion operations:
- Report and validate Ions
- Register and update pathways
- Stake and claim rewards from Ganglion
## License
This project is licensed under the **MIT License**.
## Disclaimer
Use NeurionPy at your own risk. Ensure you store private keys securely and follow best security practices when interacting with blockchain assets.
Raw data
{
"_id": null,
"home_page": "https://github.com/neurion-xyz/neurionpy",
"name": "neurionpy",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "CosmPy, Cosmos-SDK",
"author": "Neurion.xyz Limited",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/ac/14/306b31c1ee683f796a56f0872afda3b8ff8bca6d5aecd631633b9e31dd77/neurionpy-0.18.0.tar.gz",
"platform": null,
"description": "# NeurionPy\n\nNeurionPy is the official Python SDK for interacting with the **Neurion** blockchain, a Cosmos SDK-based network designed for **privacy-preserving AI, federated learning, and decentralized automation**. NeurionPy provides developers with all the necessary tools to create wallets, sign transactions, and interact with various modules on the blockchain.\n\n## Features\n- **Wallet Management**: Generate wallets from private keys, mnemonics, or existing addresses.\n- **Transaction Signing**: Sign and broadcast transactions securely.\n- **Querying the Blockchain**: Retrieve blockchain state, account balances, and contract data.\n- **Module Interactions**: Full support for all Neurion modules:\n - **Sanctum**: Privacy-preserving dataset sharing and usage requests.\n - **Crucible**: Federated learning, model training, and validation.\n - **Fusion**: AI model aggregation and dispute resolution.\n - **Ganglion**: AI agent and workflow automation.\n- **GRPC & REST Support**: Seamlessly interact with the Neurion blockchain via GRPC and REST APIs.\n\n## Installation\nInstall NeurionPy using pip:\n```sh\npip install neurionpy\n```\n\nPackage available on PyPI: [NeurionPy](https://pypi.org/project/neurionpy/)\n\n## Getting Started\n### Importing NeurionPy\n```python\nimport grpc\nfrom neurionpy.synapse.client import NeurionClient, NetworkConfig\nfrom neurionpy.synapse.wallet import LocalWallet\n```\n\n### Creating a Wallet\n```python\nwallet = LocalWallet.from_mnemonic(\n \"your mnemonic here\",\n \"neurion\"\n)\nprint(\"Address:\", wallet.address)\n```\n\n### Connecting to Neurion\n```python\nclient = NeurionClient(NetworkConfig.neurion_localnet(), wallet)\n```\n\n## Module Interactions\n\nBelow are **examples** of interactions with the different Neurion modules. More operations are supported; refer to the API documentation for the full list.\n\n### Sanctum (Privacy-Preserving Dataset Management)\n#### Example: Submitting a Dataset Application\n```python\ntx = client.sanctum.tx.SubmitDatasetApplication(\n message=MsgSubmitDatasetApplication(\n creator=str(wallet.address()),\n encrypted_data_link=\"https://encrypted_data_link\",\n explanation_link=\"https://explanation_link\",\n contact=\"contact\",\n stake=100000000,\n proof_of_authenticity=\"proof_of_authenticity\",\n dataset_usage_fee=100000000\n )\n)\nprint(f\"TX {tx.tx_hash} submitted.\")\n```\nOther available Sanctum operations:\n- Approve dataset applications\n- Request to use datasets\n- Manage dataset processing\n\n### Crucible (Federated Learning & Model Validation)\n#### Example: Registering as a Model Trainer\n```python\ntx = client.crucible.tx.RegisterTrainer(\n message=MsgRegisterTrainer(\n creator=str(wallet.address()),\n task_id=1\n )\n)\nprint(f\"Trainer Registration TX: {tx.tx_hash}\")\n```\nOther available Crucible operations:\n- Submit training results\n- Stake tokens to tasks\n- Report model plagiarism\n\n### Fusion (AI Model Aggregation & Dispute Resolution)\n#### Example: Proposing a Model for a Task\n```python\ntx = client.fusion.tx.ProposeModel(\n message=MsgProposeModel(\n creator=str(wallet.address()),\n task_id=1,\n model_link=\"https://model_link\",\n metadata_link=\"https://metadata_link\"\n )\n)\nprint(f\"Model Proposal TX: {tx.tx_hash}\")\n```\nOther available Fusion operations:\n- Register as a proposer or validator\n- Dispute model scores\n- Claim rewards from tasks\n\n### Ganglion (AI Agent & Workflow Automation)\n#### Example: Registering an AI Agent (Ion)\n```python\ntx = client.ganglion.tx.RegisterIon(\n message=MsgRegisterIon(\n capacities=[\"SCRAPER\", \"EXTRACTOR\"],\n stake=10000000,\n endpoints=[\"http://localhost\", \"http://66.63.66.66\"],\n description=\"A scraper and extractor\",\n input_schema='{\"name\":\"string\",\"flag\":\"boolean\"}',\n output_schema='{\"another_flag\":\"boolean\",\"fullname\":\"string\"}',\n fee_per_thousand_calls=18,\n )\n)\nprint(f\"Ion Registration TX: {tx.tx_hash}\")\n```\nOther available Ganglion operations:\n- Report and validate Ions\n- Register and update pathways\n- Stake and claim rewards from Ganglion\n\n## License\nThis project is licensed under the **MIT License**.\n\n## Disclaimer\nUse NeurionPy at your own risk. Ensure you store private keys securely and follow best security practices when interacting with blockchain assets.\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Python library with the neurion networks",
"version": "0.18.0",
"project_urls": {
"Documentation": "https://github.com/neurion-xyz/neurionpy",
"Homepage": "https://github.com/neurion-xyz/neurionpy",
"Repository": "https://github.com/neurion-xyz/neurionpy"
},
"split_keywords": [
"cosmpy",
" cosmos-sdk"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7e310586671931905d10eb81abd1f5722eef1c9ec34c2680d9c751533d49ef81",
"md5": "da061d9499181e781bc14ce1b2a4567d",
"sha256": "76d0c9d2ff407cb619d5e64d42b5dc209b222b784ab123f0a9b6bfbb7ebac9f3"
},
"downloads": -1,
"filename": "neurionpy-0.18.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "da061d9499181e781bc14ce1b2a4567d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 1062739,
"upload_time": "2025-02-26T04:11:27",
"upload_time_iso_8601": "2025-02-26T04:11:27.570227Z",
"url": "https://files.pythonhosted.org/packages/7e/31/0586671931905d10eb81abd1f5722eef1c9ec34c2680d9c751533d49ef81/neurionpy-0.18.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ac14306b31c1ee683f796a56f0872afda3b8ff8bca6d5aecd631633b9e31dd77",
"md5": "5c2f2ff8eb67d29c239cdc6d9f04acbb",
"sha256": "90cebd8ab7f2964d838082d380302e7a55ca38198444ba88147901257c3c7893"
},
"downloads": -1,
"filename": "neurionpy-0.18.0.tar.gz",
"has_sig": false,
"md5_digest": "5c2f2ff8eb67d29c239cdc6d9f04acbb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 442341,
"upload_time": "2025-02-26T04:11:30",
"upload_time_iso_8601": "2025-02-26T04:11:30.111013Z",
"url": "https://files.pythonhosted.org/packages/ac/14/306b31c1ee683f796a56f0872afda3b8ff8bca6d5aecd631633b9e31dd77/neurionpy-0.18.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-26 04:11:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "neurion-xyz",
"github_project": "neurionpy",
"github_not_found": true,
"lcname": "neurionpy"
}