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
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20.3MB
glibcpy 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.fixUpgrade 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.fixBe 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.fixRely 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.
fixEnsure 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.
fixReview 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.
fixEnsure 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.