Skip to main content

PyDLNA

A simple, zero-dependency Python library for DLNA streaming, discovery, and device control.

Most DLNA libraries out there are either overly complex, poorly documented, or unmaintained. PyDLNA is built to be fit-for-purpose, straightforward, and ready to use in a few lines of code.

pip install PyDLNA

Quick Concepts

  • DLNADiscovery() — Your best friend for finding DLNA devices (renderers, media servers, etc.) on your local network.
  • DLNAServer() — Hosts and serves your local media files over HTTP with proper DLNA headers.
  • device.controller() — Gives you an active playback control session (.play(), .pause(), track info) for a specific renderer.

Usage Examples

1. Basic Streaming — examples/basic.py

Serve a directory, find a smart TV or speaker on the network, and throw a video/audio track directly to it:

import time
from pydlna import DLNADiscovery, DLNAServer

folder = "D:/Movies"

with DLNAServer(name="PyDLNA Example") as server:
    server.library.add_directory(folder)

    target = None
    with DLNADiscovery().discover() as devices:
        for device in devices:
            if device.is_renderer:
                print(f"Found renderer: {device.name}")
                target = device
                break

    if target is None:
        print("No renderer found.")
    else:
        with target.controller() as session:
            media = server.library[0]
            print(f"Sending: {media.url_for(target.address)}")
            session.play(media)

            while session.is_playing():
                current = session.currently_playing
                print(f"Playing: {media.title[:18]} > {current.position}:{current.duration}", end="\r")
                time.sleep(1)

2. Inspecting Network Devices — examples/client_info.py

Scan your network and inspect the hardware, model numbers, and supported playback formats of discovered renderers:

from pydlna import DLNADiscovery

for client in DLNADiscovery().discover():
    if client.is_renderer:
        print(f"{client.name or '(unnamed)'}  @  {client.address}")
        print(f"  Manufacturer       : {client.manufacturer} ({client.manufacturer_url})")
        print(f"  Model              : {client.model_name} {client.model_number}")
        print(f"  Playable formats   : {client.playback_formats}")
        print(f"  Supported protocols: {client.supported_protocols}")
        print("-" * 50)

Metadata

Release files for PyDLNA 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyDLNA 0.1.4
File Size Uploaded
pydlna-0.1.4.tar.gz 19.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyDLNA 0.1.4
File Interpreter ABI Platform
pydlna-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 41.3 kB

Release files / pydlna-0.1.4.tar.gz

Download URL pydlna-0.1.4.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
81c937629cb72ba2230d939ca7d64fc276e5b1bc3f93cab78cebb9c14011c166
BLAKE2b-256 checksum
How to use checksums
392ddd316be1603a8ed2effa2be5da3c06d28c89fe4494929545be2720e879a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / pydlna-0.1.4-py3-none-any.whl

Download URL pydlna-0.1.4-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94051c7c1c9d0138698099ad1a164280dc8bb21c0c88f316cea883398c545f05
BLAKE2b-256 checksum
How to use checksums
e0f6ab1077dbaddc8e0949104480f053dcab8019758bfffabdc420dd36b4555a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.4 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page