Registry / communication / davey
library0.1.5pypypi✓ verified 89d ago

Davey is a Python library that provides an implementation of the Discord Audio & Video End-to-End Encryption (DAVE) Protocol. It acts as a Python binding to a Rust-based implementation that leverages OpenMLS. The library is currently in beta (0.1.5) but actively maintained, with recent updates focusing on security fixes related to its internal OpenMLS dependency.

pip install davey
INSTALL
IMPORT
SIG · DAVEY
D
davey
communicationpythonv0.1.5
Install
1.6s avg
Import
—
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.1.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20.3MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 1.6s · import 0.000s · 20MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SigningKeyPair
✓ from davey import SigningKeyPair
Represents a P256 signing key pair used within the DAVE protocol.
generate_p256_keypair
✓ from davey import generate_p256_keypair
A utility function to create a new P256 signing key pair.
generate_displayable_code
✓ from davey import generate_displayable_code
Used for generating human-readable codes for verification, as specified in the DAVE Protocol.
SessionStatus
✓ from davey import SessionStatus
An Enum representing the current status of a DAVE session.

This quickstart demonstrates how to generate a P256 signing key pair and a displayable verification code, which are core components of the DAVE protocol. Proper integration requires interaction with Discord's voice server APIs for session management and media handling.

from davey import SigningKeyPair, generate_p256_keypair, generate_displayable_code import os # Note: In a real application, keys and session data should be securely managed # and integrated with Discord's voice gateway interactions. This is a minimal example. # 1. Generate a P256 signing key pair # This key pair is fundamental for establishing trust in DAVE sessions. key_pair = generate_p256_keypair() print(f"Generated Private Key (truncated): {key_pair.private.hex()[:10]}...") print(f"Generated Public Key (truncated): {key_pair.public.hex()[:10]}...") # 2. Generate a displayable code for user verification # The 'data' parameter would typically be a unique session identifier or # derived from shared secrets in a real DAVE handshake. example_data_for_code = os.urandom(32) # Using random bytes for demonstration display_code = generate_displayable_code( data=example_data_for_code, desired_length=12, # Total length of the code string group_size=4 # How many characters per group (e.g., AAAA-BBBB-CCCC) ) print(f"Generated Displayable Code: {display_code}") # Further steps would involve Discord API interaction to manage DAVE sessions, # process proposals, and handle media encryption/decryption, which is highly # application-specific and not directly covered by simple library calls here. # Refer to the DAVE Protocol whitepaper and library's typings for advanced usage.
Debug
Known issues
breakingVersion 0.1.4 and later fixed a high-severity vulnerability in the internal OpenMLS dependency. Users on older versions (0.1.3 and below) are strongly advised to update immediately to mitigate potential security risks.
fix
Upgrade to davey>=0.1.4 using `pip install --upgrade davey`.
affects: <0.1.4
gotchaThe library is in 'Beta' (Development Status 4) as per PyPI. This indicates that the API might still undergo non-backward-compatible changes, and it may not yet be considered stable for production environments without careful testing.
fix
Be aware of potential API instability. Pin your dependency versions strictly (e.g., `davey==0.1.5`) and thoroughly test new updates.
affects: All versions <1.0.0
gotchaOfficial, comprehensive usage documentation for the Python `davey` library is currently limited. The GitHub README suggests checking the Python typings (`davey.pyi`) for usage examples and available functions. Deeper understanding requires referring to the DAVE Protocol Whitepaper.
fix
Rely on the library's type hints (`.pyi` files) for API discovery. Consult the DAVE Protocol Whitepaper for conceptual understanding and implement carefully based on the source code or typings.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'davey'
The `davey` package is not installed in the current Python environment or the environment is not activated.
fix
Ensure the library is installed with `pip install davey` and that your Python interpreter is running in the correct environment.
AttributeError: 'DaveySession' object has no attribute 'encrypt_audio'
Attempting to call a method or access an attribute that does not exist on the object, often due to an outdated understanding of the API or an assumption about its functionality without consulting the typings. The DAVE implementation is low-level and might require specific protocol message handling.
fix
Review the `davey.pyi` typing file in the installed package for available methods and attributes. The library provides protocol primitives rather than a high-level Discord bot integration layer.
TypeError: argument 'private_key' must be bytes, not str
Passing arguments of incorrect types, such as a string when a bytes-like object is expected, particularly for cryptographic keys or data payloads.
fix
Ensure all cryptographic material and protocol data (e.g., keys, nonces, payloads) are provided as `bytes` objects. Convert strings using `.encode('utf-8')` if necessary, or use byte literals (e.g., `b'mydata'`).
Upgrade
Version history
0.1.5latest on PyPI · released Mar 29, 2026
Audit
Dependencies
OpenMLS (Rust)requiredThe core protocol implementation is in Rust, using the OpenMLS library. While `pip install` typically handles pre-built wheels bundling the Rust components, building from source would require a Rust toolchain.
Agent activity
69 hits · last 30 days
node
60
OpenAI (training)
1
Resources
davey — pip install davey · libregistry