Skip to content

About

πŸ‘¨β€πŸ« BigBlueButton Python API

Topics

Resources

Stars

25 stars

Watchers

7 watching

Forks

Latest commit

Β 

History

68 Commits

Folders and files

Repository files navigation

bigbluebutton-python

PyPI

Python client for the BigBlueButton API, tested against BigBlueButton 4.0 and compatible with 2.4 and later.

Installation

pip install bigbluebutton-python

The import name is bigbluebutton_api_python, so code written against the older package keeps working.

Quick start

from bigbluebutton_api_python import BigBlueButton

# The secret comes from `bbb-conf --secret`.
bbb = BigBlueButton("https://bbb.example.com/bigbluebutton/api/", "your-shared-secret")
# BBB >= 2.5 also accepts checksum_algorithm="sha256" (or sha384 / sha512).

print(bbb.get_api_version().get_version())

bbb.create_meeting("room-1", params={"name": "Daily standup", "record": True}, meta={"team": "core"})

moderator_url = bbb.get_join_meeting_url("Alice", "room-1", role=BigBlueButton.MODERATOR)
viewer_url = bbb.get_join_meeting_url("Bob", "room-1", role=BigBlueButton.VIEWER)

bbb.send_chat_message("room-1", "Welcome!")  # BBB >= 3.0
info = bbb.get_meeting_info("room-1").get_meetinginfo()
bbb.end_meeting("room-1")

Presentations

from bigbluebutton_api_python.parameters import BBBModule

slides = BBBModule()
slides.add_slide(BBBModule.URL, "https://example.com/deck.pdf")
slides.add_slide(BBBModule.FILE, "local/agenda.pdf")

bbb.create_meeting("room-1", slides=slides)  # preload slides when the meeting is created
bbb.insert_document("room-1", slides)        # add slides to a meeting that is already running

Recordings

for rec in bbb.get_recordings(meeting_id="room-1").get_recordings():
    print(rec.get_recordid(), rec.get_name())

bbb.publish_recordings("record-id", publish=False)
bbb.update_recordings("record-id", meta={"title": "Renamed"})
bbb.get_recording_text_tracks("record-id")
bbb.put_recording_text_track("record-id", kind="subtitles", lang="en_US", label="English", file_path="en.vtt")
bbb.delete_recordings("record-id")

Async

AsyncBigBlueButton takes the same arguments and has the same methods. Each API call is a coroutine, so it does not block the event loop. get_join_meeting_url only builds a string, so it stays a normal call.

import asyncio
from bigbluebutton_api_python import AsyncBigBlueButton

async def main():
    bbb = AsyncBigBlueButton("https://bbb.example.com/bigbluebutton/api/", "your-shared-secret")
    await bbb.create_meeting("room-1")
    running, meetings = await asyncio.gather(bbb.is_meeting_running("room-1"), bbb.get_meetings())
    print(running.is_meeting_running(), meetings.get_meetings())

asyncio.run(main())

A request that fails raises bigbluebutton_api_python.exception.BBBException. Its .key attribute holds the BBB messageKey.

Supported endpoints

create, join, end, isMeetingRunning, getMeetingInfo, getMeetings, insertDocument, sendChatMessage, getRecordings, publishRecordings, deleteRecordings, updateRecordings, getRecordingTextTracks, putRecordingTextTrack, getAttendance.

Upgrading from 0.0.x

  • setConfigXML and getDefaultConfigXML are gone. BigBlueButton itself removed them in 2.4.
  • Joining with role= is preferred over the deprecated password. end_meeting no longer needs a password.
  • Python 3.10 or newer is required.

Development

pip install -e .
python -m unittest discover -s tests

Releasing

Pushing a v* tag runs the tests and publishes to PyPI through GitHub Actions (Trusted Publishing).

License

LGPL-3.0-or-later

About

πŸ‘¨β€πŸ« BigBlueButton Python API

Topics

Resources

Stars

25 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages