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.5.0.tar.gz (46.7 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.5.0-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: brightcove_async-0.5.0.tar.gz
  • Upload date:
  • Size: 46.7 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.5.0.tar.gz
Algorithm Hash digest
SHA256 c59fd7ad896fdae3e8310832be5614005c690c0208802cb639a1213a53530b7c
MD5 42b98a3728c7bf1e3a7f9abbf8755057
BLAKE2b-256 101a29d3faf955fdfefd5a25a4d9f249f08c4b07bfb7b4e01197a4dbc1a91447

See more details on using hashes here.

Provenance

The following attestation bundles were made for brightcove_async-0.5.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.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for brightcove_async-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee04c0a2fd6aa5c436153648652c984a0d6080d67108f589b1806ea75f2917b5
MD5 561be9f2301a2bade1fd97b619a52fc6
BLAKE2b-256 f1490f072432cfc86d2d5906bbe3a89f368b2840314b9afb779fe7fec15b864a

See more details on using hashes here.

Provenance

The following attestation bundles were made for brightcove_async-0.5.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