vipas


Namevipas JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
SummaryPython SDK for Vipas AI Platform
upload_time2024-06-14 11:23:42
maintainerNone
docs_urlNone
authorVipas Team
requires_python>=3.7
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # VIPAS AI Platform SDK
The Vipas AI Python SDK provides a simple and intuitive interface to interact with the Vipas AI platform. This SDK allows you to easily make predictions using pre-trained models hosted on the Vipas AI platform.

## Requirements.

Python 3.7+

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/vipas-engineering/vipas-python-sdk.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/vipas-engineering/vipas-python-sdk.git`)

Then import the package:
```python
import vipas
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import vipas
```

## Getting Started

To get started with the Vipas AI Python SDK, you need to create a ModelClient object and use it to make predictions. Below is a step-by-step guide on how to do this.

### Basic Usage

1. Import the necessary modules:
```python
from vipas import model
```

2. Create a ModelClient object:
```python
vps_model_client = model.ModelClient()
```

3. Make a prediction:

```python
model_id = "mdl-test"
api_response = vps_model_client.predict(model_id=model_id, input_data="Test input")
```

### Handling Exceptions
The SDK provides specific exceptions to handle different error scenarios:

1. UnauthorizedException: Raised when the API key is invalid or missing.
2. NotFoundException: Raised when the model is not found.
3. BadRequestException: Raised when the input data is invalid.
4. ForbiddenException: Raised when the user does not have permission to access the model.
5. ConnectionException: Raised when there is a connection error.
6. RateLimitException: Raised when the rate limit is exceeded.
7. ClientException: Raised when there is a client error.

### Example Usage

```python
from vipas import model
from pprint import pprint
from vipas.exceptions import UnauthorizedException, NotFoundException, ClientException

def main():
    # Create a ModelClient object
    vps_model_client = model.ModelClient()

    # Make a prediction
    try:
        model_id = "model_id"
        api_response = vps_model_client.predict(model_id=model_id, input_data="Test input")
        pprint(api_response)
    except UnauthorizedException as err:
        print(err)
    except NotFoundException as err:
        print(err)
    except ClientException as err:
        print(err)

main()

```

## Logging
The SDK provides a LoggerClient class to handle logging. Here's how you can use it:

### LoggerClient Usage

1. Import the `LoggerClient` class:
```python
from vipas.logger import LoggerClient
```

2. Initialize the `LoggerClient`:
```python
logger = LoggerClient(__name__)

```

3. Log messages at different levels:
```python
logger.debug("This is a debug message")
logger.info("This is an info message")
logger.warning("This is a warning message")
logger.error("This is an error message")
logger.critical("This is a critical message")

```

### Example of LoggerClient
Here is a complete example demonstrating the usage of the LoggerClient:

```python
from vipas.logger import LoggerClient

def main():
    logger = LoggerClient(__name__)
    
    logger.info("Starting the main function")
    
    try:
        # Example operation
        result = 10 / 2
        logger.debug(f"Result of division: {result}")
    except ZeroDivisionError as e:
        logger.error("Error occurred: Division by zero")
    except Exception as e:
        logger.critical(f"Unexpected error: {str(e)}")
    finally:
        logger.info("End of the main function")

main()
``` 

## Author
VIPAS.AI





            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "vipas",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Vipas Team",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/bf/a2/2d5b907ea66b951db612ae389bfa94f1b63565a7cdf25c759738fbb208c2/vipas-0.3.0.tar.gz",
    "platform": null,
    "description": "# VIPAS AI Platform SDK\nThe Vipas AI Python SDK provides a simple and intuitive interface to interact with the Vipas AI platform. This SDK allows you to easily make predictions using pre-trained models hosted on the Vipas AI platform.\n\n## Requirements.\n\nPython 3.7+\n\n## Installation & Usage\n### pip install\n\nIf the python package is hosted on a repository, you can install directly using:\n\n```sh\npip install git+https://github.com/vipas-engineering/vipas-python-sdk.git\n```\n(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/vipas-engineering/vipas-python-sdk.git`)\n\nThen import the package:\n```python\nimport vipas\n```\n\n### Setuptools\n\nInstall via [Setuptools](http://pypi.python.org/pypi/setuptools).\n\n```sh\npython setup.py install --user\n```\n(or `sudo python setup.py install` to install the package for all users)\n\nThen import the package:\n```python\nimport vipas\n```\n\n## Getting Started\n\nTo get started with the Vipas AI Python SDK, you need to create a ModelClient object and use it to make predictions. Below is a step-by-step guide on how to do this.\n\n### Basic Usage\n\n1. Import the necessary modules:\n```python\nfrom vipas import model\n```\n\n2. Create a ModelClient object:\n```python\nvps_model_client = model.ModelClient()\n```\n\n3. Make a prediction:\n\n```python\nmodel_id = \"mdl-test\"\napi_response = vps_model_client.predict(model_id=model_id, input_data=\"Test input\")\n```\n\n### Handling Exceptions\nThe SDK provides specific exceptions to handle different error scenarios:\n\n1. UnauthorizedException: Raised when the API key is invalid or missing.\n2. NotFoundException: Raised when the model is not found.\n3. BadRequestException: Raised when the input data is invalid.\n4. ForbiddenException: Raised when the user does not have permission to access the model.\n5. ConnectionException: Raised when there is a connection error.\n6. RateLimitException: Raised when the rate limit is exceeded.\n7. ClientException: Raised when there is a client error.\n\n### Example Usage\n\n```python\nfrom vipas import model\nfrom pprint import pprint\nfrom vipas.exceptions import UnauthorizedException, NotFoundException, ClientException\n\ndef main():\n    # Create a ModelClient object\n    vps_model_client = model.ModelClient()\n\n    # Make a prediction\n    try:\n        model_id = \"model_id\"\n        api_response = vps_model_client.predict(model_id=model_id, input_data=\"Test input\")\n        pprint(api_response)\n    except UnauthorizedException as err:\n        print(err)\n    except NotFoundException as err:\n        print(err)\n    except ClientException as err:\n        print(err)\n\nmain()\n\n```\n\n## Logging\nThe SDK provides a LoggerClient class to handle logging. Here's how you can use it:\n\n### LoggerClient Usage\n\n1. Import the `LoggerClient` class:\n```python\nfrom vipas.logger import LoggerClient\n```\n\n2. Initialize the `LoggerClient`:\n```python\nlogger = LoggerClient(__name__)\n\n```\n\n3. Log messages at different levels:\n```python\nlogger.debug(\"This is a debug message\")\nlogger.info(\"This is an info message\")\nlogger.warning(\"This is a warning message\")\nlogger.error(\"This is an error message\")\nlogger.critical(\"This is a critical message\")\n\n```\n\n### Example of LoggerClient\nHere is a complete example demonstrating the usage of the LoggerClient:\n\n```python\nfrom vipas.logger import LoggerClient\n\ndef main():\n    logger = LoggerClient(__name__)\n    \n    logger.info(\"Starting the main function\")\n    \n    try:\n        # Example operation\n        result = 10 / 2\n        logger.debug(f\"Result of division: {result}\")\n    except ZeroDivisionError as e:\n        logger.error(\"Error occurred: Division by zero\")\n    except Exception as e:\n        logger.critical(f\"Unexpected error: {str(e)}\")\n    finally:\n        logger.info(\"End of the main function\")\n\nmain()\n``` \n\n## Author\nVIPAS.AI\n\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python SDK for Vipas AI Platform",
    "version": "0.3.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bf9a62e90754ad87ca7b70776641b7615beb8300119415fc30ae8dc5215fe649",
                "md5": "52438b0b6ab599e54350488d9742b518",
                "sha256": "0ca928a46cdaaa23c7f5dd4bdf803dbdfca3d98a830aeb20be431bf63b0df124"
            },
            "downloads": -1,
            "filename": "vipas-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "52438b0b6ab599e54350488d9742b518",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 13459,
            "upload_time": "2024-06-14T11:23:40",
            "upload_time_iso_8601": "2024-06-14T11:23:40.716386Z",
            "url": "https://files.pythonhosted.org/packages/bf/9a/62e90754ad87ca7b70776641b7615beb8300119415fc30ae8dc5215fe649/vipas-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bfa22d5b907ea66b951db612ae389bfa94f1b63565a7cdf25c759738fbb208c2",
                "md5": "fa0451aebd298826baa300045059bdc8",
                "sha256": "fd9f0dc83c48466e3e2225b66e1f2f4a516aef621d8f7870e05fa8490233e2ea"
            },
            "downloads": -1,
            "filename": "vipas-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "fa0451aebd298826baa300045059bdc8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 12306,
            "upload_time": "2024-06-14T11:23:42",
            "upload_time_iso_8601": "2024-06-14T11:23:42.901028Z",
            "url": "https://files.pythonhosted.org/packages/bf/a2/2d5b907ea66b951db612ae389bfa94f1b63565a7cdf25c759738fbb208c2/vipas-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-14 11:23:42",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "vipas"
}
        
Elapsed time: 0.27375s