nyx_client.data
Module that manages individual Nyx Data.
Classes
Data
|
Represents the data in the Nyx system. |
Module Contents
-
class nyx_client.data.Data(name, title, description, org, url, content_type, creator, categories, genre, size=0, custom_metadata=(), connection_id=None)
Represents the data in the Nyx system.
This class encapsulates the information and functionality related to the data
in the Nyx system, including its metadata and content retrieval.
- Parameters:
-
-
name: str
Unique name of data.
-
title: str
Human readable title of data.
-
description: str
Short description of data.
-
org: str
Your organization name.
-
url: str
The access URL of the data.
-
content_type: str
Content type of the data, can be in format application/json, or URI.
-
creator: str
Org name that created the data.
-
categories: list[str]
The categories of the data.
-
genre: str
The genre of the data.
-
size: int
Size in bytes of the data.
-
custom_metadata: list[nyx_client.property.Property]
Additional metadata properties to decorate the data with. Note that nyx-internal properties are not allowed.
-
connection_id: str | None
class`.Connection`)
- Type:
The ID of the connection (id from
-
__str__()
Return a string representation of the Data instance.
-
as_string()
Download the content of the data as a string.
This method attempts to download the content from the data’s URL.
- Returns:
The downloaded content as decoded text or None, if the download fails.
- Return type:
str | None
-
as_bytes()
Download the content of the data as bytes.
This method attempts to download the content from the data’s URL.
- Returns:
The downloaded content as bytes or None, if the download fails.
- Return type:
bytes | None