nyx-client


Namenyx-client JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://www.get-nyx.io
SummaryNyx Client SDK provides a powerful toolkit for building generative AI applications using data brokered on the Nyx platform.
upload_time2024-09-27 09:34:12
maintainerNone
docs_urlNone
authorIotics
requires_python<4.0,>=3.10
licenseNone
keywords client data sdk ai exchange nyx rag gen-ai iotics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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)
[![Read The Docs](https://readthedocs.org/projects/nyx-sdk/badge/?version=stable)](https://nyx-sdk.readthedocs.io/en/stable)
[![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.as_string() # Note if binary file use as_bytes to get content as bytes
```

## 👉 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).

- If you get the SSL error 
`httpcore.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate`

then it may be that you need to set some environment variables like this before running your script:
```shell
CERT_PATH=$(python -m certifi)
export SSL_CERT_FILE=${CERT_PATH}
export REQUESTS_CA_BUNDLE=${CERT_PATH}
```

## 🐞 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)


            

Raw data

            {
    "_id": null,
    "home_page": "https://www.get-nyx.io",
    "name": "nyx-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "client, data, sdk, ai, exchange, nyx, rag, gen-ai, iotics",
    "author": "Iotics",
    "author_email": "info@iotics.com",
    "download_url": "https://files.pythonhosted.org/packages/a7/66/10b99502a136b904fef983c596434f2f17f40f42c925bcd61027e729ab16/nyx_client-0.1.3.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n# Nyx Client SDK\n\n[![Version](https://img.shields.io/pypi/v/nyx-client)](https://pypi.org/project/nyx-client)\n[![License](https://img.shields.io/badge/License-Apache%202.0-yellow.svg)](https://github.com/Iotic-Labs/nyx-sdk/blob/main/LICENSE)\n[![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)\n[![Read The Docs](https://readthedocs.org/projects/nyx-sdk/badge/?version=stable)](https://nyx-sdk.readthedocs.io/en/stable)\n[![GitHub Repo stars](https://img.shields.io/github/stars/Iotic-Labs/nyx-sdk)](https://github.com/Iotic-Labs/nyx-sdk)\n[![Discord](https://img.shields.io/discord/1285252646554304555)](https://discord.gg/zS8pVHjqSf)\n\n\n\ud83c\udf1f **Nyx Client SDK** provides a powerful toolkit for building generative AI applications using data brokered on the Nyx platform.\n\nIt enables decentralized data transfer, offering additional context (via a RAG setup) to language models within the trusted IOTICS network.\n\n[![https://iotics.com](https://img.shields.io/badge/Powered%20by-Iotics-blue)](https://iotics.com)\n</div>\n\n## \ud83d\udea7 Status\n\nThe 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).\n\n## What is the Nyx Client SDK\n\nThe 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.\n\nSeveral examples of SDK usage in an AI context are available:\n\n- [RAG demo examples](https://github.com/Iotic-Labs/nyx-sdk/tree/main/examples)\n- `https://[nyx_host]/try-me-now`\n\nSee also [What is Nyx](https://github.com/Iotic-Labs/nyx-sdk?tab=readme-ov-file#-what-is-nyx)\n\n# \ud83d\udd25 Quick Start\n\n## Installation\n\nThe Nyx Client SDK is available on [PyPI](https://pypi.org/project/nyx-client/) and can be installed via `pip` running the following command.\n\n`pip install nyx-client`\n\n## First time set up\n\nOnce 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.\n\n<details>\n<summary>Example output</summary>\n\n```shell\n#### Autogenerated by nyx_client - do not edit manually\nDID_USER_DID=did:iotics:iotDJ1ftN8LM6WUKZp1Zo8Ha1dkm8yyQvFAx\nDID_AGENT_DID=did:iotics:iotZ7kSUpmAcAjdVzKKF4JUmC42tBPG7JRoQ\nDID_AGENT_KEY_NAME=\"#agent-competent_hello\"\nDID_AGENT_NAME=\"#agent-competent_hello\"\nDID_AGENT_SECRET=54d133....ebdc9d\nHOST_VERIFY_SSL=true # Set to false for development\n####\n\nNYX_URL=<ENTER URL>\nNYX_USERNAME=<ENTER USERNAME>\nNYX_EMAIL=<ENTER EMAIL>\nNYX_PASSWORD=<ENTER PASSWORD>\n```\n</details>\n\n\n## As a data producer\n\n### I want to connect my Data\n\n```python\nfrom nyx_client import NyxClient\n\nclient = NyxClient()\nclient.create_data(\n    name=\"MyData1\",\n    title=\"My Data #1\",\n    description=\"The description of the data #1\",\n    size=1080,\n    genre=\"ai\",\n    categories=[\"cat1\", \"cat2\", \"cat3\"],\n    download_url=\"http://storage/dataset1.csv\",\n    content_type=\"text/csv\",\n    lang=\"fr\",\n    preview=\"col1, col2, col3\\naaa, bbb, ccc\",\n    license_url=\"https://opensource.org/licenses/MIT\",\n)\n```\n\n### I want to delete/disconnect my Data\n\n```python\nfrom nyx_client import NyxClient\n\nclient = NyxClient()\nclient.delete_data_by_name(name=\"MyData1\")\n```\n\n## As an application builder\n\n### I want to subscribe to some data\n\nComing soon \ud83d\udc77\ud83d\udea7\n\n### I want to consume the data\n\n```python\nfrom nyx_client import NyxClient\n\nclient = NyxClient()\nsubscribed_data = client.get_subscribed_data()\nfor data in subscribed_data:\n  print(f\"Downloading data {data.name}\")\n  content = data.as_string() # Note if binary file use as_bytes to get content as bytes\n```\n\n## \ud83d\udc49 Gotchas\n\n- 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.\n\nThe 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).\n\n- If you get the SSL error \n`httpcore.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate`\n\nthen it may be that you need to set some environment variables like this before running your script:\n```shell\nCERT_PATH=$(python -m certifi)\nexport SSL_CERT_FILE=${CERT_PATH}\nexport REQUESTS_CA_BUNDLE=${CERT_PATH}\n```\n\n## \ud83d\udc1e Troubleshooting\n\nIf you encounter any issues, ensure that:\n\n- Your virtual environment is activated.\n- All required dependencies are installed.\n- Environment variables are set correctly.\n- If an issue persists, check the Issues section on github\n\nFor further assistance:\n- Refer to the [project documentation](https://nyx-sdk.readthedocs.io/en/stable)\n  - \ud83d\udca1 If you have cloned the Git repo, you can run `make docs` and then view `docs/index.html`.\n- [Raise an issue](https://github.com/Iotic-Labs/nyx-sdk/issues) on GitHub\n- [Chat with us](https://discord.gg/zS8pVHjqSf) on Discord [![Discord](https://img.shields.io/discord/1285252646554304555)](https://discord.gg/zS8pVHjqSf)\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions! Please see our [CONTRIBUTING.md](https://github.com/Iotic-Labs/nyx-sdk/blob/main/CONTRIBUTING.md) for guidelines.\n\n## \u2696\ufe0f Terms and conditions\n\n[https://www.get-nyx.io/terms](https://www.get-nyx.io/terms)\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Nyx Client SDK provides a powerful toolkit for building generative AI applications using data brokered on the Nyx platform.",
    "version": "0.1.3",
    "project_urls": {
        "Changes": "https://github.com/Iotic-Labs/nyx-sdk/blob/main/CHANGELOG.md",
        "Chat": "https://discord.gg/zS8pVHjqSf",
        "Documentation": "https://nyx-sdk.readthedocs.io/en/stable",
        "Homepage": "https://www.get-nyx.io",
        "Issue tracker": "https://github.com/Iotic-Labs/nyx-sdk/issues",
        "Repository": "https://github.com/Iotic-Labs/nyx-sdk"
    },
    "split_keywords": [
        "client",
        " data",
        " sdk",
        " ai",
        " exchange",
        " nyx",
        " rag",
        " gen-ai",
        " iotics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5180d09748e1d221d00c87aefbdf0025848a6249dc78390230c572f37b5b9f34",
                "md5": "c278a249fd4c5d5c7931acc03245e4e3",
                "sha256": "a0a50c8eb961c807124d3e38a0d75852792bb89d9395e4749256c1512fc44109"
            },
            "downloads": -1,
            "filename": "nyx_client-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c278a249fd4c5d5c7931acc03245e4e3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 34763,
            "upload_time": "2024-09-27T09:34:10",
            "upload_time_iso_8601": "2024-09-27T09:34:10.257601Z",
            "url": "https://files.pythonhosted.org/packages/51/80/d09748e1d221d00c87aefbdf0025848a6249dc78390230c572f37b5b9f34/nyx_client-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a76610b99502a136b904fef983c596434f2f17f40f42c925bcd61027e729ab16",
                "md5": "131f6db202386ebfd0489a96d40fb8d3",
                "sha256": "989201a4158fe19ec1a2f614e2569e1dac5e18b18df2e0fe076ef54648d70bb9"
            },
            "downloads": -1,
            "filename": "nyx_client-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "131f6db202386ebfd0489a96d40fb8d3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 28907,
            "upload_time": "2024-09-27T09:34:12",
            "upload_time_iso_8601": "2024-09-27T09:34:12.729356Z",
            "url": "https://files.pythonhosted.org/packages/a7/66/10b99502a136b904fef983c596434f2f17f40f42c925bcd61027e729ab16/nyx_client-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-27 09:34:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Iotic-Labs",
    "github_project": "nyx-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nyx-client"
}
        
Elapsed time: 0.38991s