SDKs overview

Catalogopolis offers Software Development Kits (SDKs) to facilitate integration with its video platform. These SDKs are designed to abstract the complexities of direct API interaction, providing developers with language-specific methods and objects for common operations such as uploading videos, managing content, initiating live streams, and configuring monetization settings. The goal of these SDKs is to reduce development time and effort when building applications that utilize Catalogopolis services, as outlined in the official Catalogopolis developer documentation.

Developers can choose from a range of officially supported SDKs, which are maintained by Catalogopolis, or explore community-driven libraries that extend functionality or support additional languages/frameworks. The official SDKs typically offer higher stability, comprehensive documentation, and direct support, while community libraries can sometimes provide specialized features or cater to niche use cases not covered by the official offerings.

Official SDKs by language

Catalogopolis provides official SDKs for several popular programming languages, ensuring broad compatibility for various development environments. These SDKs are regularly updated to reflect new API features and improvements to the Catalogopolis platform. Each SDK is tailored to the conventions and best practices of its respective language, aiming to provide an idiomatic development experience.

The following table details the officially supported SDKs, including their typical package names and installation methods. Developers can find detailed usage guides and API references for each SDK within the Catalogopolis main documentation portal.

Language Package Name Installation Command Maturity
JavaScript @catalogopolis/js-sdk npm install @catalogopolis/js-sdk or yarn add @catalogopolis/js-sdk Stable
Python catalogopolis-python-sdk pip install catalogopolis-python-sdk Stable
Ruby catalogopolis-ruby-sdk gem install catalogopolis-ruby-sdk Stable
PHP catalogopolis/php-sdk composer require catalogopolis/php-sdk Stable
Java com.catalogopolis/java-sdk Maven: Add dependency to pom.xml | Gradle: Add dependency to build.gradle Stable
Go github.com/catalogopolis/go-sdk go get github.com/catalogopolis/go-sdk Stable

Installation

Installing Catalogopolis SDKs involves using the standard package manager for each respective programming language. Each SDK is published to its ecosystem's primary package repository, simplifying the process of adding it to a project. Before installation, developers should ensure they have the correct runtime environment and package manager set up for their chosen language. For example, JavaScript developers will need Node.js and npm/Yarn, while Python developers will require a Python interpreter and pip.

JavaScript Installation

For JavaScript projects, the Catalogopolis SDK can be installed via npm or Yarn:

npm install @catalogopolis/js-sdk
# or
yarn add @catalogopolis/js-sdk

This command adds the SDK as a dependency to your project's package.json file.

Python Installation

Python developers can install the Catalogopolis SDK using pip:

pip install catalogopolis-python-sdk

This command downloads and installs the package and its dependencies.

Ruby Installation

Ruby projects can include the Catalogopolis SDK by adding it to their Gemfile or installing directly via gem:

# In Gemfile
gem 'catalogopolis-ruby-sdk'

bundle install
# or direct install
gem install catalogopolis-ruby-sdk

PHP Installation

For PHP applications, Composer is used to manage dependencies:

composer require catalogopolis/php-sdk

This command adds the SDK to your composer.json and installs it into your vendor/ directory.

Java Installation

Java developers using Maven or Gradle can add the Catalogopolis SDK as a dependency in their project's build configuration. For Maven, add the following to your pom.xml:

<dependency>
    <groupId>com.catalogopolis</groupId>
    <artifactId>java-sdk</artifactId>
    <version>1.0.0</version> <!-- Use the latest version -->
</dependency>

For Gradle, add to your build.gradle:

implementation 'com.catalogopolis:java-sdk:1.0.0' // Use the latest version

Go Installation

Go developers can fetch the Catalogopolis SDK using the go get command:

go get github.com/catalogopolis/go-sdk

This command downloads the module and adds it to your Go module cache.

Quickstart example

This quickstart example demonstrates how to initialize the Catalogopolis SDK and upload a video using Python. Similar patterns apply to other languages, as shown in the Catalogopolis video upload guide.

Python Quickstart: Uploading a Video

First, ensure the Python SDK is installed (pip install catalogopolis-python-sdk).

import os
from catalogopolis_python_sdk import CatalogopolisClient

# Replace with your actual API Key and Secret
API_KEY = os.environ.get("CATALOGOPOLIS_API_KEY")
API_SECRET = os.environ.get("CATALOGOPOLIS_API_SECRET")

if not API_KEY or not API_SECRET:
    raise ValueError("CATALOGOPOLIS_API_KEY and CATALOGOPOLIS_API_SECRET environment variables must be set.")

client = CatalogopolisClient(api_key=API_KEY, api_secret=API_SECRET)

def upload_video(file_path, title, description):
    try:
        with open(file_path, 'rb') as video_file:
            # The SDK handles the actual API call and file transfer
            video_data = client.videos.upload(
                file=video_file,
                title=title,
                description=description,
                tags=['example', 'quickstart']
            )
            print(f"Video uploaded successfully! ID: {video_data['id']}, Title: {video_data['title']}")
            print(f"Playback URL: {video_data['playback_url']}")
            return video_data
    except Exception as e:
        print(f"Error uploading video: {e}")
        return None

# Example usage:
# Create a dummy video file for demonstration purposes
dummy_file_path = "./my_sample_video.mp4"
with open(dummy_file_path, 'w') as f:
    f.write("This is a dummy video file content.") # In a real scenario, this would be actual video data

upload_video(dummy_file_path, "My First Catalogopolis Video", "A quick test upload using the Python SDK.")

# Clean up the dummy file
os.remove(dummy_file_path)

This Python snippet demonstrates the basic flow: initializing the client with API credentials and then calling the videos.upload method. This method abstracts the underlying HTTP requests and multipart form data handling, as detailed by the IETF's RFC 7578 for multipart/form-data, making the API interaction more straightforward.

Community libraries

Beyond the official SDKs, the Catalogopolis ecosystem is supported by various community-contributed libraries and wrappers. These libraries are developed and maintained independently by developers who use the Catalogopolis platform. They often aim to provide specific integrations, add support for less common languages or frameworks, or offer alternative implementations of existing functionalities.

While community libraries can offer flexibility and cater to specific project needs, it is important to note that they may not receive the same level of support, maintenance, or feature parity as the official SDKs. Developers considering using a community library should verify its active maintenance, review its codebase, and check for compatibility with the latest Catalogopolis API versions. Resources for discovering community projects typically include GitHub, developer forums, and specific sections within the Catalogopolis community resources page (if available).

Examples of community contributions might include:

  • Framework-specific wrappers (e.g., a React component for embedding videos or a Laravel package for content management).
  • CLI tools built on top of the SDKs for quick command-line interactions.
  • Integrations with other popular services not directly supported by official SDKs.

Developers are encouraged to contribute to the Catalogopolis ecosystem by sharing their own tools and improvements, adhering to best practices for open-source development, such as clear documentation and licensing, as supported by organizations like the W3C Community Group Program.