tensorbay


Nametensorbay JSON
Version 1.24.2 PyPI version JSON
download
home_pagehttps://github.com/Graviti-AI/tensorbay-python-sdk
SummaryGraviti TensorBay Python SDK
upload_time2023-02-10 15:39:48
maintainer
docs_urlNone
authorGraviti
requires_python>=3.6
licenseMIT
keywords graviti tensorbay dataset
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TensorBay Python SDK

[![Pre-commit](https://github.com/Graviti-AI/tensorbay-python-sdk/actions/workflows/pre-commit.yaml/badge.svg)](https://github.com/Graviti-AI/tensorbay-python-sdk/actions/workflows/pre-commit.yaml)
[![Unit Test](https://github.com/Graviti-AI/tensorbay-python-sdk/actions/workflows/unit_test.yaml/badge.svg)](https://github.com/Graviti-AI/tensorbay-python-sdk/actions/workflows/unit_test.yaml)
[![Documentation Status](https://readthedocs.org/projects/tensorbay-python-sdk/badge/?version=latest)](https://tensorbay-python-sdk.graviti.com/en/latest/?badge=latest)
[![Downloads](https://pepy.tech/badge/tensorbay/month)](https://pepy.tech/project/tensorbay)
[![Coverage Status](https://coveralls.io/repos/github/Graviti-AI/tensorbay-python-sdk/badge.svg)](https://coveralls.io/github/Graviti-AI/tensorbay-python-sdk)
[![GitHub](https://img.shields.io/github/license/Graviti-AI/tensorbay-python-sdk)](https://github.com/Graviti-AI/tensorbay-python-sdk/blob/main/LICENSE)
[![Slack](https://img.shields.io/static/v1?label=slack&message=graviti&logo=slack&color=blueviolet)](https://join.slack.com/t/graviticommunity/shared_invite/zt-qivjowva-8RxtilBsHIf218sOsLTHOQ)
[![PyPI](https://img.shields.io/pypi/v/tensorbay)](https://pypi.org/project/tensorbay/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tensorbay)](https://pypi.org/project/tensorbay/)

---

**IMPORTANT**: TensorBay system underwent a huge refactoring, which broke the downward compatibility
of OpenAPI and SDK. As a result, the SDK under version v1.6.0 does not work anymore.  
**Please update tensorbay SDK to v1.6.0 or a higher version.**

---

TensorBay Python SDK is a python library to access [TensorBay](https://gas.graviti.com/tensorbay/)
and manage your datasets.  
It provides:

-   A pythonic way to access your TensorBay resources by TensorBay OpenAPI.
-   An easy-to-use CLI tool `gas` (Graviti AI service) to communicate with TensorBay.
-   A consistent dataset format to read and write your datasets.

## Installation

```console
pip3 install tensorbay
```

## Documentation

More information can be found on the [documentation site](https://tensorbay-python-sdk.graviti.com/)

## Usage

An **AccessKey** is needed to communicate with TensorBay.
Please visit [this page](https://gas.graviti.com/tensorbay/developer) to get an **AccessKey** first.

### Authorize a client object

```python
from tensorbay import GAS
gas = GAS("<YOUR_ACCESSKEY>")
```

### Create a Dataset

```python
gas.create_dataset("<DATASET_NAME>")
```

### List Dataset names

```python
dataset_names = gas.list_dataset_names()
```

### Upload images to the Dataset

```python
from tensorbay.dataset import Data, Dataset

# Organize the local dataset by the "Dataset" class before uploading.
dataset = Dataset("<DATASET_NAME>")

# TensorBay uses "segment" to separate different parts in a dataset.
segment = dataset.create_segment("<SEGMENT_NAME>")

segment.append(Data("0000001.jpg"))
segment.append(Data("0000002.jpg"))

dataset_client = gas.upload_dataset(dataset, jobs=8)

# TensorBay provides dataset version control feature, commit the uploaded data before using it.
dataset_client.commit("Initial commit")
```

### Read images from the Dataset

```python
from PIL import Image

dataset = Dataset("<DATASET_NAME>", gas)
segment = dataset[0]

for data in segment:
    with data.open() as fp:
        image = Image.open(fp)
        width, height = image.size
        image.show()
```

### Delete the Dataset

```python
gas.delete_dataset("<DATASET_NAME>")
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Graviti-AI/tensorbay-python-sdk",
    "name": "tensorbay",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "graviti,tensorbay,dataset",
    "author": "Graviti",
    "author_email": "pypi@graviti.com",
    "download_url": "https://files.pythonhosted.org/packages/65/57/1891408f546f5434efb92df4b795569a28a2f52694a10c31b1784b68a965/tensorbay-1.24.2.tar.gz",
    "platform": null,
    "description": "# TensorBay Python SDK\n\n[![Pre-commit](https://github.com/Graviti-AI/tensorbay-python-sdk/actions/workflows/pre-commit.yaml/badge.svg)](https://github.com/Graviti-AI/tensorbay-python-sdk/actions/workflows/pre-commit.yaml)\n[![Unit Test](https://github.com/Graviti-AI/tensorbay-python-sdk/actions/workflows/unit_test.yaml/badge.svg)](https://github.com/Graviti-AI/tensorbay-python-sdk/actions/workflows/unit_test.yaml)\n[![Documentation Status](https://readthedocs.org/projects/tensorbay-python-sdk/badge/?version=latest)](https://tensorbay-python-sdk.graviti.com/en/latest/?badge=latest)\n[![Downloads](https://pepy.tech/badge/tensorbay/month)](https://pepy.tech/project/tensorbay)\n[![Coverage Status](https://coveralls.io/repos/github/Graviti-AI/tensorbay-python-sdk/badge.svg)](https://coveralls.io/github/Graviti-AI/tensorbay-python-sdk)\n[![GitHub](https://img.shields.io/github/license/Graviti-AI/tensorbay-python-sdk)](https://github.com/Graviti-AI/tensorbay-python-sdk/blob/main/LICENSE)\n[![Slack](https://img.shields.io/static/v1?label=slack&message=graviti&logo=slack&color=blueviolet)](https://join.slack.com/t/graviticommunity/shared_invite/zt-qivjowva-8RxtilBsHIf218sOsLTHOQ)\n[![PyPI](https://img.shields.io/pypi/v/tensorbay)](https://pypi.org/project/tensorbay/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tensorbay)](https://pypi.org/project/tensorbay/)\n\n---\n\n**IMPORTANT**: TensorBay system underwent a huge refactoring, which broke the downward compatibility\nof OpenAPI and SDK. As a result, the SDK under version v1.6.0 does not work anymore.  \n**Please update tensorbay SDK to v1.6.0 or a higher version.**\n\n---\n\nTensorBay Python SDK is a python library to access [TensorBay](https://gas.graviti.com/tensorbay/)\nand manage your datasets.  \nIt provides:\n\n-   A pythonic way to access your TensorBay resources by TensorBay OpenAPI.\n-   An easy-to-use CLI tool `gas` (Graviti AI service) to communicate with TensorBay.\n-   A consistent dataset format to read and write your datasets.\n\n## Installation\n\n```console\npip3 install tensorbay\n```\n\n## Documentation\n\nMore information can be found on the [documentation site](https://tensorbay-python-sdk.graviti.com/)\n\n## Usage\n\nAn **AccessKey** is needed to communicate with TensorBay.\nPlease visit [this page](https://gas.graviti.com/tensorbay/developer) to get an **AccessKey** first.\n\n### Authorize a client object\n\n```python\nfrom tensorbay import GAS\ngas = GAS(\"<YOUR_ACCESSKEY>\")\n```\n\n### Create a Dataset\n\n```python\ngas.create_dataset(\"<DATASET_NAME>\")\n```\n\n### List Dataset names\n\n```python\ndataset_names = gas.list_dataset_names()\n```\n\n### Upload images to the Dataset\n\n```python\nfrom tensorbay.dataset import Data, Dataset\n\n# Organize the local dataset by the \"Dataset\" class before uploading.\ndataset = Dataset(\"<DATASET_NAME>\")\n\n# TensorBay uses \"segment\" to separate different parts in a dataset.\nsegment = dataset.create_segment(\"<SEGMENT_NAME>\")\n\nsegment.append(Data(\"0000001.jpg\"))\nsegment.append(Data(\"0000002.jpg\"))\n\ndataset_client = gas.upload_dataset(dataset, jobs=8)\n\n# TensorBay provides dataset version control feature, commit the uploaded data before using it.\ndataset_client.commit(\"Initial commit\")\n```\n\n### Read images from the Dataset\n\n```python\nfrom PIL import Image\n\ndataset = Dataset(\"<DATASET_NAME>\", gas)\nsegment = dataset[0]\n\nfor data in segment:\n    with data.open() as fp:\n        image = Image.open(fp)\n        width, height = image.size\n        image.show()\n```\n\n### Delete the Dataset\n\n```python\ngas.delete_dataset(\"<DATASET_NAME>\")\n```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Graviti TensorBay Python SDK",
    "version": "1.24.2",
    "split_keywords": [
        "graviti",
        "tensorbay",
        "dataset"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7ccf03be15e1751422f846bb02cd4e58c198e6665fcbe4b3cd70bcf75b778b73",
                "md5": "1cdad1709b65822ab540001721f2e608",
                "sha256": "c9db800234862a951e81e7609af11995bc9c5aee01cc754ecace9531a0b8a775"
            },
            "downloads": -1,
            "filename": "tensorbay-1.24.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1cdad1709b65822ab540001721f2e608",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 376923,
            "upload_time": "2023-02-10T15:39:46",
            "upload_time_iso_8601": "2023-02-10T15:39:46.053836Z",
            "url": "https://files.pythonhosted.org/packages/7c/cf/03be15e1751422f846bb02cd4e58c198e6665fcbe4b3cd70bcf75b778b73/tensorbay-1.24.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "65571891408f546f5434efb92df4b795569a28a2f52694a10c31b1784b68a965",
                "md5": "a79ee45a35647c9985920017389b8828",
                "sha256": "d186890f6a796cfdadc9ff4a13bb3fd31f6b928dbf346f61d4e0530052109dcb"
            },
            "downloads": -1,
            "filename": "tensorbay-1.24.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a79ee45a35647c9985920017389b8828",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 254510,
            "upload_time": "2023-02-10T15:39:48",
            "upload_time_iso_8601": "2023-02-10T15:39:48.203988Z",
            "url": "https://files.pythonhosted.org/packages/65/57/1891408f546f5434efb92df4b795569a28a2f52694a10c31b1784b68a965/tensorbay-1.24.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-10 15:39:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Graviti-AI",
    "github_project": "tensorbay-python-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "tensorbay"
}
        
Elapsed time: 0.04254s