A modern Lavalink v4 wrapper for py-cord, based on Pomice
Project description
Lyra
A modern Lavalink v4 wrapper designed for py-cord, based on the excellent Pomice library by cloudwithax.
What's New in Lyra
Lyra is a complete refactor of Pomice for Lavalink v4, bringing significant improvements:
- Full Lavalink v4 REST API support
- Server-side plugin integration (LavaSrc, YouTube plugin, etc.)
- Simplified setup - No more API credentials needed in client
- Better error handling and plugin support
- Removed deprecated modules (client-side Spotify/Apple Music parsing)
- Optimized for py-cord instead of discord.py
- Improved documentation and examples
Key Differences from Pomice
| Feature | Pomice (v2.x) | Lyra (v1.x) |
|---|---|---|
| Lavalink Support | v3.x & v4.x | v4.x |
| Discord Library | discord.py | py-cord |
| Spotify Support | Client-side API | Server plugin |
| Apple Music Support | Client-side API | Server plugin |
| Setup Complexity | API keys required | Plugin configuration only |
| Architecture | Mixed client/server | Pure server-side |
Quick Start
Installation
pip install lava_lyra
Basic Usage
import discord
import lava_lyra
class Bot(discord.Bot):
def __init__(self):
super().__init__(intents=discord.Intents.default())
self.node = None
async def on_ready(self):
print(f'Logged in as {self.user}')
# Create Lavalink nodes - much simpler than before!
nodes = await lava_lyra.NodePool.create_nodes(
self,
host='http://localhost:2333',
port=3030,
password='youshallnotpass',
identifier='MAIN',
lyrics=False,
fallback=True
)
print(f"Created {len(nodes)} nodes")
bot = Bot()
bot.run('your_bot_token')
Playing Music
@bot.slash_command(description="Play music")
async def play(ctx, query: str):
# Connect to voice channel
if not ctx.author.voice:
return await ctx.respond("You need to be in a voice channel!")
player = await ctx.author.voice.channel.connect(cls=lava_lyra.Player)
# Search for tracks (supports Spotify, YouTube, Apple Music via plugins!)
results = await player.get_tracks(query)
if not results:
return await ctx.respond("No tracks found!")
# Play the track
track = results[0]
await player.play(track)
await ctx.respond(f"Now playing: **{track.title}**")
Lavalink v4 Server Setup
Lyra requires a Lavalink v4 server with plugins. Here's a basic application.yml:
server:
port: 2333
address: 127.0.0.1
lavalink:
plugins:
# Required for YouTube support
- dependency: "dev.lavalink.youtube:youtube-plugin:VERSION"
- repository: "https://maven.lavalink.dev/releases"
# Required for Spotify, Apple Music, Deezer, etc.
- dependency: "com.github.topi314.lavasrc:lavasrc-plugin:VERSION"
repository: "https://maven.lavalink.dev/releases"
server:
password: "youshallnotpass"
plugins:
youtube:
enabled: true
allowSearch: true
lavasrc:
sources:
spotify: true
applemusic: true
deezer: true
spotify:
clientId: "your_spotify_client_id"
clientSecret: "your_spotify_client_secret"
countryCode: "US"
Supported Platforms
All platforms are now supported via Lavalink server plugins:
- YouTube - via YouTube plugin
- Spotify - via LavaSrc plugin
- Apple Music - via LavaSrc plugin
- Bilibili - via Lavabili plugin
- SoundCloud - built-in Lavalink
- And many more via community plugins!
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License and Credits
License
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
Credits and Attribution
Lyra is based on the excellent Pomice library:
- Original Pomice: Copyright (c) 2023, cloudwithax
- Lyra (Lavalink v4 refactor): Copyright (c) 2025, ParrotXray
We extend our heartfelt thanks to cloudwithax and all Pomice contributors for creating the solid foundation that made Lyra possible. This project builds upon their excellent work to provide Lavalink v4 compatibility and modern server-side plugin support.
Key Contributors
- cloudwithax - Original Pomice library creator
- ParrotXray - Lavalink v4 refactoring and Lyra development
- Community contributors - Bug reports, features, and improvements
Links
Credits and Attribution
Lyra is based on the excellent Pomice library:
- Original Pomice: Copyright (c) 2023, cloudwithax
- Lyra (Lavalink v4 refactor): Copyright (c) 2025, ParrotXray
We extend our heartfelt thanks to cloudwithax and all Pomice contributors for creating the solid foundation that made Lyra possible. This project builds upon their excellent work to provide Lavalink v4 compatibility and modern server-side plugin support.
Key Contributors
- cloudwithax - Original Pomice library creator
- ParrotXray - Lavalink v4 refactoring and Lyra development
- Community contributors - Bug reports, features, and improvements
Star History
If you find Lyra useful, please consider giving it a star!
Made with love for the Discord music bot community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lava_lyra-1.4.2.tar.gz.
File metadata
- Download URL: lava_lyra-1.4.2.tar.gz
- Upload date:
- Size: 55.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3fc54a69acba0b8eaf99286739929035e6f476558be3879ee43013fd43518fa
|
|
| MD5 |
8a16a8ce67eb7116af0c8ac260e8bd79
|
|
| BLAKE2b-256 |
c8fceb70fd835ad0d3bea461963d20743ed7fd078c04752a93f532981112a2d4
|
Provenance
The following attestation bundles were made for lava_lyra-1.4.2.tar.gz:
Publisher:
publish.yml on ParrotXray/lava-lyra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lava_lyra-1.4.2.tar.gz -
Subject digest:
f3fc54a69acba0b8eaf99286739929035e6f476558be3879ee43013fd43518fa - Sigstore transparency entry: 640152475
- Sigstore integration time:
-
Permalink:
ParrotXray/lava-lyra@f8fe95003cec53f74eade04c22a5884fd5844a76 -
Branch / Tag:
refs/tags/v1.4.2 - Owner: https://github.com/ParrotXray
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f8fe95003cec53f74eade04c22a5884fd5844a76 -
Trigger Event:
release
-
Statement type:
File details
Details for the file lava_lyra-1.4.2-py3-none-any.whl.
File metadata
- Download URL: lava_lyra-1.4.2-py3-none-any.whl
- Upload date:
- Size: 55.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d767833bf92c91b3779a19bce5c01fe572dcc97469e7bef8102fd16d6291c56
|
|
| MD5 |
07a67a93d16f3d8ca6d23bef2336f19d
|
|
| BLAKE2b-256 |
892dc240909888d2d26f9ab210daa78335c2f7037297637b5865506ac51916b5
|
Provenance
The following attestation bundles were made for lava_lyra-1.4.2-py3-none-any.whl:
Publisher:
publish.yml on ParrotXray/lava-lyra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lava_lyra-1.4.2-py3-none-any.whl -
Subject digest:
7d767833bf92c91b3779a19bce5c01fe572dcc97469e7bef8102fd16d6291c56 - Sigstore transparency entry: 640152515
- Sigstore integration time:
-
Permalink:
ParrotXray/lava-lyra@f8fe95003cec53f74eade04c22a5884fd5844a76 -
Branch / Tag:
refs/tags/v1.4.2 - Owner: https://github.com/ParrotXray
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f8fe95003cec53f74eade04c22a5884fd5844a76 -
Trigger Event:
release
-
Statement type: