Skip to main content

pyLBRY

A Python library for reading from and archiving the LBRY network.

Requires Python 3.12 or later and a running lbrynet daemon. See docs/superpowers/specs/2026-08-02-pylbry-design.md for the design.

Install

uv add pylbry

Usage

from pathlib import Path

from pylbry import Archiver, Client

with Client() as client:
    channel = client.claims.resolve("lbry://@example")
    with Archiver(client, Path("archive")) as archiver:
        archiver.index_channel(channel.claim_id)
        archiver.fetch_pending(limit=10)

Or from the command line:

pylbry resolve lbry://@example
pylbry --root archive archive channel lbry://@example --limit 10
pylbry --root archive archive resume --limit 10
pylbry --root archive status

Archiving happens in two phases. Indexing records every claim in the channel into a SQLite database without downloading media, so the metadata survives even if the media never does. Fetching then downloads the queued claims.

Media downloads are large. Without --limit, archive channel fetches the entire channel, which is routinely tens of gigabytes.

Daemon setup

The default lbryum_servers list is mostly dead: LBRY Inc's spv*.lbry.com hosts refuse connections. If the daemon reports available_servers: 0 and its wallet never starts, pin it to a server that still runs, in ~/.local/share/lbry/lbrynet/daemon_settings.yml:

lbryum_servers:
  - hub.lbry.grin.io:50001

Entries must be host:port strings. The nested-list form that settings_get returns is silently discarded on load, yielding no servers at all.

Development

uv venv && uv sync
uv run pytest --cov-fail-under=100
uv run ruff check && uv run ty check

The suite has no mocks: every network path runs against a real daemon with its wallet started. Set PYLBRY_TEST_DAEMON if the daemon is not at http://localhost:5279, and PYLBRY_TEST_CHANNEL to draw test content from a channel other than the default. Tests reuse media the daemon already holds before starting any new download.

Release files for pylbry 0.1.0

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

Source distribution (sdist)

Source distribution for pylbry 0.1.0
File Size Uploaded
pylbry-0.1.0.tar.gz 16.8 kB Details

Built distribution (wheel)

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

Total release size: 38.7 kB

Release files / pylbry-0.1.0.tar.gz

Download URL pylbry-0.1.0.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1e22b1994e4d12ee1723aa691b310326499f14b81b61fa3b413f42c0db43413e
BLAKE2b-256 checksum
How to use checksums
03c79a39e61b541e7f556efe1e45ffdd9809ac1f3ea037cffd87288f66bd340e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pylbry-0.1.0-py3-none-any.whl

Download URL pylbry-0.1.0-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41d35ac31eb604e668f883f9a7a5739a5800a8ae45bc66c6776b2f68b4e6f1fa
BLAKE2b-256 checksum
How to use checksums
72cb62a83e61e4a1ec0530f068ab520f254bd5022d0719274a408098cd5be2d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.0 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