Metadata-Version: 2.1
Name: nyx-client
Version: 0.1.2
Summary: Nyx Client SDK provides a powerful toolkit for building generative AI applications using data brokered on the Nyx platform.
Home-page: https://www.get-nyx.io
Keywords: client,data,sdk,ai,exchange,nyx,rag,gen-ai,iotics
Author: Iotics
Author-email: info@iotics.com
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: langchain-cohere
Provides-Extra: langchain-openai
Requires-Dist: click (>=8.1.7,<9.0.0)
Requires-Dist: iotics-grpc-client (>=7.1.0,<8.0.0)
Requires-Dist: iotics-identity (>=2.0.0,<3.0.0)
Requires-Dist: langchain (>=0.2.15,<0.3.0) ; extra == "langchain-openai" or extra == "langchain-cohere"
Requires-Dist: langchain-cohere (>=0.2.3,<0.3.0) ; extra == "langchain-cohere"
Requires-Dist: langchain-community (>=0.2.15,<0.3.0) ; extra == "langchain-openai" or extra == "langchain-cohere"
Requires-Dist: langchain-openai (>=0.1.22,<0.2.0) ; extra == "langchain-openai"
Requires-Dist: langgraph (>=0.2.16,<0.3.0) ; extra == "langchain-openai" or extra == "langchain-cohere"
Requires-Dist: names-generator (>=0.2.0,<0.3.0)
Requires-Dist: numpy (>=1.26.4,<2.0.0)
Requires-Dist: pandas (>=2.2.2,<3.0.0)
Requires-Dist: protobuf (==5.27.3)
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
Requires-Dist: requests-toolbelt (>=1.0.0,<2.0.0)
Requires-Dist: scikit-learn (>=1.5.1,<2.0.0)
Requires-Dist: scipy (>=1.14.0,<2.0.0)
Requires-Dist: sqlalchemy (>=2.0.32,<3.0.0)
Project-URL: Chat, https://discord.gg/zS8pVHjqSf
Project-URL: Changes, https://github.com/Iotic-Labs/nyx-sdk/blob/main/CHANGELOG.md
Project-URL: Documentation, https://nyx-sdk.readthedocs.io/en/stable
Project-URL: Issue tracker, https://github.com/Iotic-Labs/nyx-sdk/issues
Project-URL: Repository, https://github.com/Iotic-Labs/nyx-sdk
Description-Content-Type: text/markdown

<div align="center">

# Nyx Client SDK

[![Version](https://img.shields.io/pypi/v/nyx-client)](https://pypi.org/project/nyx-client)
[![License](https://img.shields.io/badge/License-Apache%202.0-yellow.svg)](https://github.com/Iotic-Labs/nyx-sdk/blob/main/LICENSE)
[![Build](https://github.com/Iotic-Labs/nyx-sdk/actions/workflows/build.yaml/badge.svg?branch=main)](https://github.com/Iotic-Labs/nyx-sdk/actions/workflows/build.yaml)
[![GitHub Repo stars](https://img.shields.io/github/stars/Iotic-Labs/nyx-sdk)](https://github.com/Iotic-Labs/nyx-sdk)
[![Discord](https://img.shields.io/discord/1285252646554304555)](https://discord.gg/zS8pVHjqSf)


🌟 **Nyx Client SDK** provides a powerful toolkit for building generative AI applications using data brokered on the Nyx platform.

It enables decentralized data transfer, offering additional context (via a RAG setup) to language models within the trusted IOTICS network.

[![https://iotics.com](https://img.shields.io/badge/Powered%20by-Iotics-blue)](https://iotics.com)
</div>

## 🚧 Status

The Nyx ecosystem is at an early stage of its development, please give us feedback through the [Github issues](https://github.com/Iotic-Labs/nyx-sdk/issues).

## What is the Nyx Client SDK

The Nyx Client SDK is a Python library that provides an API for easy interaction with the Nyx Platform. It enables end users to seamlessly connect their data to the Nyx ecosystem, search for data, subscribe to it, and consume it. With this SDK, users can ultimately build powerful AI applications.

Several examples of SDK usage in an AI context are available:

- [RAG demo examples](https://github.com/Iotic-Labs/nyx-sdk/tree/main/examples)
- `https://[nyx_host]/try-me-now`

See also [What is Nyx](https://github.com/Iotic-Labs/nyx-sdk?tab=readme-ov-file#-what-is-nyx)

# 🔥 Quick Start

## Installation

The Nyx Client SDK is available on [PyPI](https://pypi.org/project/nyx-client/) and can be installed via `pip` running the following command.

`pip install nyx-client`

## First time set up

Once the library is installed you can run `nyx-client init` to generate the .env file. You'll be asked to provide your Nyx username, password and Nyx endpoint.

<details>
<summary>Example output</summary>

```shell
#### Autogenerated by nyx_client - do not edit manually
DID_USER_DID=did:iotics:iotDJ1ftN8LM6WUKZp1Zo8Ha1dkm8yyQvFAx
DID_AGENT_DID=did:iotics:iotZ7kSUpmAcAjdVzKKF4JUmC42tBPG7JRoQ
DID_AGENT_KEY_NAME="#agent-competent_hello"
DID_AGENT_NAME="#agent-competent_hello"
DID_AGENT_SECRET=54d133....ebdc9d
HOST_VERIFY_SSL=true # Set to false for development
####

NYX_URL=<ENTER URL>
NYX_USERNAME=<ENTER USERNAME>
NYX_EMAIL=<ENTER EMAIL>
NYX_PASSWORD=<ENTER PASSWORD>
```
</details>


## As a data producer

### I want to connect my Data

```python
from nyx_client import NyxClient

client = NyxClient()
client.create_data(
    name="MyData1",
    title="My Data #1",
    description="The description of the data #1",
    size=1080,
    genre="ai",
    categories=["cat1", "cat2", "cat3"],
    download_url="http://storage/dataset1.csv",
    content_type="text/csv",
    lang="fr",
    preview="col1, col2, col3\naaa, bbb, ccc",
    license_url="https://opensource.org/licenses/MIT",
)
```

### I want to delete/disconnect my Data

```python
from nyx_client import NyxClient

client = NyxClient()
client.delete_data_by_name(name="MyData1")
```

## As an application builder

### I want to subscribe to some data

Coming soon 👷🚧

### I want to consume the data

```python
from nyx_client import NyxClient

client = NyxClient()
subscribed_data = client.get_subscribed_data()
for data in subscribed_data:
  print(f"Downloading data {data.name}")
  content = data.download()
```

## 👉 Gotchas

- If the Data has been deleted/disconnected from Nyx, the SDK will no longer be able to access it. Ensure that the data is still available.

The Nyx ecosystem is at an early stage of its development, please give us feedback through [Github issues](https://github.com/Iotic-Labs/nyx-sdk/issues).

## 🐞 Troubleshooting

If you encounter any issues, ensure that:

- Your virtual environment is activated.
- All required dependencies are installed.
- Environment variables are set correctly.
- If an issue persists, check the Issues section on github

For further assistance:
- Refer to the [project documentation](https://nyx-sdk.readthedocs.io/en/stable)
  - 💡 If you have cloned the Git repo, you can run `make docs` and then view `docs/index.html`.
- [Raise an issue](https://github.com/Iotic-Labs/nyx-sdk/issues) on GitHub
- [Chat with us](https://discord.gg/zS8pVHjqSf) on Discord [![Discord](https://img.shields.io/discord/1285252646554304555)](https://discord.gg/zS8pVHjqSf)

## 🤝 Contributing

We welcome contributions! Please see our [CONTRIBUTING.md](https://github.com/Iotic-Labs/nyx-sdk/blob/main/CONTRIBUTING.md) for guidelines.

## ⚖️ Terms and conditions

[https://www.get-nyx.io/terms](https://www.get-nyx.io/terms)

