Skip to main content

Python SDK for SRG+

Project description

SRG+ Python SDK

Python client for the SRG+ API — manage hub profiles, channels, contents, assets, workspaces, and permissions.

Installation

pip install srgplus

Requires Python 3.11+ and depends on httpx and pydantic.

Quick start

from srg import SRGClient

with SRGClient(api_key="srgplus_...") as client:
    profiles = client.hub_profiles.list()
    contents = client.contents.filter(profiles[0].id)

The api_key can also be provided via the SRG_API_KEY environment variable:

export SRG_API_KEY=srgplus_...
client = SRGClient()  # reads from env

Async

import asyncio
from srg import AsyncSRGClient

async def main():
    async with AsyncSRGClient(api_key="srgplus_...") as client:
        channels = await client.channels.list(hub_profile_id="hp-id")

asyncio.run(main())

Configuration

Parameter Env var Default
api_key SRG_API_KEY required
timeout 30.0 s

Documentation

Full API reference and usage examples are in docs/:

Section Reference
Client (SRGClient, AsyncSRGClient) docs/client.md
Users docs/resources/users.md
Invitations docs/resources/invitations.md
Permissions docs/resources/permissions.md
Permission Groups docs/resources/permission_groups.md
Hub Profiles docs/resources/hub_profiles.md
Workspaces docs/resources/workspaces.md
Assets docs/resources/assets.md
Channels docs/resources/channels.md
Contents docs/resources/contents.md
Error handling docs/exceptions.md

License

MIT — see LICENSE.

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

srgplus-0.1.1.tar.gz (85.3 kB view details)

Uploaded Source

Built Distribution

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

srgplus-0.1.1-py3-none-any.whl (57.0 kB view details)

Uploaded Python 3

File details

Details for the file srgplus-0.1.1.tar.gz.

File metadata

  • Download URL: srgplus-0.1.1.tar.gz
  • Upload date:
  • Size: 85.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for srgplus-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2308928b0be1fc8836f5e8702cc66cba9e2cfc0140d84309afd4c407c2afe5a7
MD5 690a2a5440eb3d618089a0ea5f4091ab
BLAKE2b-256 07adc5d21572d3e2fb33116ac14b59bddb6969a755280a99019c39ea9b8bc286

See more details on using hashes here.

File details

Details for the file srgplus-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: srgplus-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 57.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for srgplus-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 78e90210bb78495fc5bb3131de27e32c10cb4667c68e9c96e7a2a274a76a01d1
MD5 b55f1b5e1d651a9a98123ae4b5895c38
BLAKE2b-256 f8fa918cf30aa65dca2ac446f36b72409c4c5c493033f6933316b246796d9db3

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