Skip to main content

A Discord voice library using Python Songbird bindings.

Project description

Songbird-Py

Songbird bindings for python. The goal is to provide an easy to use alternitive to Lavalink. Its written with rust-bindings to Songbird.

Songbird-py Docs

Dependencies

This library requires Opus to be installed. ffmpeg functions also require FFmpeg to be installed.

:warning: The static-ffmpeg package on pypi does not work

Building Source Dist

If you are not on windows, macos, or linux x86_64 or need to use a version of python different than 3.8-3.10 you will need to build the source dist. The only change to the installation process is that Rust will need to be installed before installing from pip.

Playing a Song

Once you are connected to a channel, playing music is extremely easy.

from songbird import ytdl

# `voice` was created from a connection to the gateway.

track_handle = await voice.play_source(await ytdl("https://www.youtube.com/watch?v=r25MAkzkTF4"))

await sleep(5)
# Doesn't need to be awaited!
track_handle.pause()
await sleep(5)
track_handle.play()

Supported Libraries

Hikari and Pincer are currently the only supported libraries. See the examples directory for more information.

Using with your own Gateway

from asyncio import run
from songbird import Driver

async def main():
    voice = await Driver.create()
    # `server` is the server payload from the gateway.
    # `state` is the voice state payload from the gateway.
    await voice.connect(
        token=server.token,
        endpoint=server.endpoint,
        session_id=state.session_id,
        guild_id=server.guild_id,
        channel_id=state.channel_id,
        user_id=state.user_id
    )

run(main())

Contributing

Pyo3 asyncio is used with tokio.

Dependencies

Maturin should be installed though pip. This is used to build the Rust code to a python lib. Run command maturin develop when changes are made to the Rust src.

pyo3

pyo3 docs

pyo3 asyncio

pyo3 asyncio docs You can also look at the async secion of the pyo3 docs.

Songbird

Link

docs

Its a good idea to install all the dependencies.

Goal of the project

Create API for songbird driver and everything that is needed with it it.

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

songbird_py-0.1.6.tar.gz (116.0 kB view details)

Uploaded Source

Built Distributions

songbird_py-0.1.6-cp310-none-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.10 Windows x86-64

songbird_py-0.1.6-cp310-cp310-manylinux_2_24_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.24+ x86-64

songbird_py-0.1.6-cp310-cp310-macosx_10_9_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

songbird_py-0.1.6-cp39-none-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.9 Windows x86-64

songbird_py-0.1.6-cp39-cp39-manylinux_2_24_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.24+ x86-64

songbird_py-0.1.6-cp39-cp39-macosx_10_9_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

songbird_py-0.1.6-cp38-none-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.8 Windows x86-64

songbird_py-0.1.6-cp38-cp38-manylinux_2_24_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64

songbird_py-0.1.6-cp38-cp38-macosx_10_9_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file songbird_py-0.1.6.tar.gz.

File metadata

  • Download URL: songbird_py-0.1.6.tar.gz
  • Upload date:
  • Size: 116.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.6.tar.gz
Algorithm Hash digest
SHA256 223836524c7c97493c49f11649449028a2cf5805cf552af3843e84fb9566ce56
MD5 8ded95aa6868c87852ada60e59b82651
BLAKE2b-256 426e1e72f45c33836c5bbcbf0207738e8283aca3345a99cc08a047036343eee9

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.6-cp310-none-win_amd64.whl.

File metadata

  • Download URL: songbird_py-0.1.6-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.6-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 d374d50e23ce6e038896d7f53862063f20c93926c5478156ca4d0f422cf3248e
MD5 059ca93ae5192908f51ae41cebc86500
BLAKE2b-256 8f48847382f295a67f6030c7eb1f6ad1f443316fd0a8ac92527795480fce230b

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.6-cp310-cp310-manylinux_2_24_x86_64.whl.

File metadata

  • Download URL: songbird_py-0.1.6-cp310-cp310-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: CPython 3.10, manylinux: glibc 2.24+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.6-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 2ce7dcfe1a747728677448ce59945ac98f018a9e2e79af23cfe87c4c13fb4653
MD5 b743eae961524d076128fd09952fc70b
BLAKE2b-256 cfac0d447ad9ac3c7dfd0cb2b97956ff2cd586a5f27b5a3d9246e7f52307a82b

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.6-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: songbird_py-0.1.6-cp310-cp310-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: CPython 3.10, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.6-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 95ba8402d98977ebabc626ca87acab05ca54194be2a544f02a8ba7abde25be7b
MD5 7361a8f867534afb694a0b85b3315eaf
BLAKE2b-256 d7d00ff2285e172df74b6481ffc96ad1e94559e69ee61c6d7f411118aee312f2

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.6-cp39-none-win_amd64.whl.

File metadata

  • Download URL: songbird_py-0.1.6-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.6-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 be99053b88e3ebdf8191e2b1a4d10462a6c93839f36f9bcd665f381bab6d21c7
MD5 76d22c8b0c81650e0d31a0f364ded62e
BLAKE2b-256 3e4e4d80cc151f3817b61382d0fb018367755bdfc020d38bdae66eb7ea9e2b61

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.6-cp39-cp39-manylinux_2_24_x86_64.whl.

File metadata

  • Download URL: songbird_py-0.1.6-cp39-cp39-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: CPython 3.9, manylinux: glibc 2.24+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.6-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 eaf9de14e9953ea2ea5099acfc7bc1b0f5541b948b15cc12b582536472635ae1
MD5 d3fcc2c4066c8fd1f4660d00eb46756a
BLAKE2b-256 c4cc5575a05bf990ccc46f4652670eb860cdb1bf781265331761c60b050488d7

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.6-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: songbird_py-0.1.6-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.6-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 448105702e8042bf575981a397eb6e22809cc8b2eca570bbada945846f81aa16
MD5 c59cb92c6829312c4f9fa4bffa1dd0a9
BLAKE2b-256 968b1133e9cf5115e76a8d287eca043b147cb81a0928063e8ea5e777b2c6f69c

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.6-cp38-none-win_amd64.whl.

File metadata

  • Download URL: songbird_py-0.1.6-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.6-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 bbe60dcc58ced42def4cdb9f90c07fac8914d439b543a3b0e42eeb21029fa9cc
MD5 9948ca983f53832c5db9c36d89b529cf
BLAKE2b-256 140e56826c3b9cb0a93e7784ce81110fd74075be1a7ea417a17262a9dbded565

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.6-cp38-cp38-manylinux_2_24_x86_64.whl.

File metadata

  • Download URL: songbird_py-0.1.6-cp38-cp38-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: CPython 3.8, manylinux: glibc 2.24+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.6-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 5cfdb74eb3011116d8ef8f35d86efcbd37508b45be66680528100e04dd96e5fa
MD5 a4f17f069527232ee2306672d0a4cc67
BLAKE2b-256 3c2018b99610e9e9ad558c2d7e786c5b8292412b59a2656cfb6eaeb4d3ea6409

See more details on using hashes here.

File details

Details for the file songbird_py-0.1.6-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: songbird_py-0.1.6-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for songbird_py-0.1.6-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2ec9865bf51db092fbf9a4459579548cf463404b36a591dc49bd2b3f85792a24
MD5 e1eee1de4e68b2843750054d1d5516bd
BLAKE2b-256 e1f6d4f0768b9dad2f2fd3ce9fbb4beb6a5ad2facfd03541fe88f9f9329ce761

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page