Skip to main content

An asynchronous client for the Brightcove API.

Project description

brightcove_async

brightcove_async is an asynchronous Python client library for interacting with the Brightcove video platform APIs. This library is designed to provide easy, non-blocking access to Brightcove's RESTful endpoints, making it ideal for use in modern async Python applications.

Features

  • Fully asynchronous API using asyncio
  • Simple authentication with OAuth2 client credentials
  • Support for core Brightcove API endpoints (Videos, Analytics, Audience, etc.)
  • Strong typing and data validation powered by Pydantic for reliable development and rich IDE autocompletion

Installation

pip install brightcove_async

Quick Start

import asyncio

import brightcove_async
from brightcove_async.schemas.cms_model import (
    CreateVideoRequestBodyFields,
    State,
)

async def main() -> None:
    client = brightcove_async.initialise_brightcove_client()
    async with client as client_instance:
        result = await client_instance.cms.create_video(
            account_id="12345",
            video_data=CreateVideoRequestBodyFields(
                name="test",
                State=State.ACTIVE,
            ),
        )
        print(result.model_dump())


if __name__ == "__main__":
    asyncio.run(main())

Usage

Audience API

Retrieve leads and view events captured by Brightcove's Audience module:

import asyncio

import brightcove_async
from brightcove_async.schemas.params import GetLeadsParams, GetViewEventsParams

async def main() -> None:
    client = brightcove_async.initialise_brightcove_client()
    async with client as client_instance:
        leads = await client_instance.audience.get_leads(
            account_id="12345",
            params=GetLeadsParams(limit=10, sort="created_at"),
        )
        print(leads.model_dump())

        view_events = await client_instance.audience.get_view_events(
            account_id="12345",
            params=GetViewEventsParams(limit=10),
        )
        print(view_events.model_dump())


if __name__ == "__main__":
    asyncio.run(main())

Authentication

brightcove_async handles OAuth2 token management automatically. The easiest way to do this is to set the following environmental variables:

export CLIENT_ID="your_client_id"
export CLIENT_SECRET="your_client_secret"

API Coverage

  • Videos - In progress
  • Analytics - In progress
  • Audience - In progress
  • Syndication - In progress

Documentation

Requirements

  • Python 3.13+

Contributing

Pull requests are welcome! Please open an issue to discuss your feature or bugfix before submitting a PR.

License

MIT License

Disclaimer

This project is not affiliated with or endorsed by Brightcove Inc.

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

brightcove_async-0.4.0.tar.gz (43.4 kB view details)

Uploaded Source

Built Distribution

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

brightcove_async-0.4.0-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file brightcove_async-0.4.0.tar.gz.

File metadata

  • Download URL: brightcove_async-0.4.0.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for brightcove_async-0.4.0.tar.gz
Algorithm Hash digest
SHA256 641929cc2d2f33d55b347875fd9bc11af1f37c0b27a4450a9951b4b6cbaa66a4
MD5 3e17f4a166798aa736d01f9284e9308c
BLAKE2b-256 625349a5368c8ccbc2d71a2b3befe04b7a5a087e94ad7e04cd07758bcc124279

See more details on using hashes here.

Provenance

The following attestation bundles were made for brightcove_async-0.4.0.tar.gz:

Publisher: package-publish.yml on Winne004/brightcove_async

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brightcove_async-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for brightcove_async-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0aa61c876900e8755adadbb91310c1352e2549d016a3317a9732fb427863239
MD5 6e0283717e3f8a29b9fdd241f1e5c824
BLAKE2b-256 0f9751c55b2df2877eb986b30835ece750a885f31ab81957c301a7da0d27eafa

See more details on using hashes here.

Provenance

The following attestation bundles were made for brightcove_async-0.4.0-py3-none-any.whl:

Publisher: package-publish.yml on Winne004/brightcove_async

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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