Skip to main content

No project description provided

Project description

Styley Python SDK

📚 Table of Contents

  1. Introduction
  2. Install Python
  3. Verify Installation
  4. Install SDK
  5. Environment Variables
  6. Usage
  7. Class & Method Reference

Introduction

The Styley Python SDK provides a simple and intuitive interface to interact with Styley’s deployment and model services. With this SDK, you can easily create and manage deployments, query models, and retrieve job statuses programmatically.


Install Python

Install Using Official Installer (Recommended)

  1. Download Python

    • Visit Python official download page.
    • Download the installer for your operating system:
      • Windows: Download the .exe file.
      • MacOS: Download the .pkg file.
      • Linux: Use the system's package manager (e.g., apt, yum).
  2. Run the installer

    • Check Add Python to PATH (important).
    • Select Install Now.
  3. Restart your terminal after the installation.


Verify Installation

Ensure Python and pip are installed correctly.

python --version
pip --version

Expected output:

Python 3.10.0  # Example version
pip 23.1.2     # Example pip version

If you see "command not found", double-check if Python is installed and in your PATH.


Install SDK

Install the Python SDK via pip:

pip install styleysdk

This installs the Styley SDK and its dependencies.


Environment Variables

To authenticate API requests, set the following environment variable:

export X_STYLEY_KEY=***************************

Usage

This section covers available methods for interacting with deployments and models.


Deployments

📤 Create Deployment

The Create Deployment method allows you to create a new deployment using a model name and arguments. It returns an output with a job_id that you can use to fetch the final results.

Example:

from styleysdk import Styley
from styleysdk.deployments.model import CreateDeployment
from styleysdk.deployments.model import Job

styley = Styley()
deployment = styley.deployments.create(
    deployment=CreateDeployment(
        name="Translate Pro",
        model="e77a0be0-dedb-4f9d-acf6-9878df149d33",
        args={
            "Target_Language": "SL",
            "Text": "what is how",
        }
    )
)
print(deployment)

📄 Get Deployment By ID

Fetch details of a specific deployment using its deployment ID.

Example:

from styleysdk import Styley
from styleysdk.deployments.model import CreateDeployment
from styleysdk.deployments.model import Job

styley = Styley()
deployment_details = styley.deployments.get_by_id(deployment_id)
print(deployment_details)

📜 List Deployments

Retrieve a list of all deployments.

Example:

from styleysdk import Styley
from styleysdk.deployments.model import CreateDeployment
from styleysdk.deployments.model import Job

styley = Styley()
deployments_list = styley.deployments.list()
print(deployments_list)

🚀 Get Deployment Job

Get the status of a deployment job using its job ID.

Example:

from styleysdk import Styley
from styleysdk.deployments.model import CreateDeployment
from styleysdk.deployments.model import Job

styley = Styley()
job_status = styley.deployments.get_job(job_id)
print(job_status)

Models

📜 List Models

Retrieve a list of all models available for deployments.

Example:

from styleysdk import Styley
from styleysdk.deployments.model import CreateDeployment
from styleysdk.deployments.model import Job

styley = Styley()
models_list = styley.models.list()
print(models_list)

🔍 Get Model By ID

Fetch a specific model’s details using its model ID.

Example:

from styleysdk import Styley
from styleysdk.deployments.model import CreateDeployment
from styleysdk.deployments.model import Job

styley = Styley()
model_details = styley.models.get_by_id(model_id)
print(model_details)

🔍 Get Model By Name

Fetch a specific model’s details using its model name.

Example:

from styleysdk import Styley
from styleysdk.deployments.model import CreateDeployment
from styleysdk.deployments.model import Job

styley = Styley()
model_details = styley.models.get_by_name(model_name)
print(model_details)

Class & Method Reference

Class Method Description
Deployments create(payload) Create a new deployment.
Deployments get_by_id(id) Get deployment details by deployment ID.
Deployments list() List all deployments.
Deployments get_job(job_id) Get the status of a deployment job.
Models list() List all available models.
Models get_by_id(id) Get model details by model ID.
Models get_by_name(name) Get model details by model name.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

styleysdk-0.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

styleysdk-0.0.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file styleysdk-0.0.0.tar.gz.

File metadata

  • Download URL: styleysdk-0.0.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.10.4 Linux/5.15.0-25-generic

File hashes

Hashes for styleysdk-0.0.0.tar.gz
Algorithm Hash digest
SHA256 662c43923c82f8c89ba20272d8997cb5c3d615d91e29913735abcd43cb326cfb
MD5 527b2e854471df2a4ffa8e86daa3b353
BLAKE2b-256 115c5673f3f676ac1a17681cbf8f5d1ae8596c2a3106134fbc35a868af18b92b

See more details on using hashes here.

File details

Details for the file styleysdk-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: styleysdk-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.10.4 Linux/5.15.0-25-generic

File hashes

Hashes for styleysdk-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61f3416c2b946e72d4cd47b43f63aba321ef4c87d97372ace73e8c3aedd23490
MD5 5bb5bf18d6cf3d0c24a27c1086c64364
BLAKE2b-256 4ce77a39178a9ef8aaa0601938d63c5a454fcd56ecf1f1354c8c5b8b349486d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page