Skip to main content

PyBRY, a Python API Wrapper for lbry & lbrycrd

License: MIT Language grade: Python

PyBry is a wrapper for the lbry daemon and lbrycrd daemon API for Python 3.x

(Python 2 support will be added very soon)

Installation

With pip

Simply run the following

$ pip install pybry

And you're done!

Manually Cloning the Repository

You can either clone this repository or get a tarball from PyPI's website for whatever version you want. Simply download it and

# Simply clone the repository somewhere
$ git clone https://github.com/osilkin98/pybry

# Or obtain a release from PyPI's site.
$ wget <extremely long link generated by PyPI> 

$ tar -xzf pybry-x.x.x.tar.gz PyBRY/

# Change directories into the newly created repository
$ cd PyBRY/

# Now you simply run the setup.py file:
$ python3 setup.py build_py install

Usage

Using the API

  1. Make sure that lbry-daemon is up and running, as you will not be able to do anything without it.

  2. First, import LbrydApi or LbrycrdApi from pybry into your project.

API for LBRYD

Using the Generated Code

The API generates all the functions from the lbryd documentation, and translates it into tangible, documented code.

[1] from pybry import LbrydApi

# Initialize the API
[2] lbry = LbrydApi()

# Just call the method as documented in the LBRYD API
[3] response = lbry.claim_list(name="bellflower")

Since all the code is properly documented, if you ask for its documentation in an IDE, or if you go to read it for yourself, it'll appear like this:

[4] response = lbry.account_balance()

    Return the balance of an account
    Params:
    account_id  If provided only the balance for this account will be given (Optional)
    address  If provided only the balance for this address will be given (Optional)
    include_unconfirmed  Include unconfirmed (Optional)
    Returns:
    (decimal) amount of lbry credits in wallet(decimal) amount of lbry credits in wallet

Calling the API Manually

Since all the code does is make requests to the lbry daemon, you can also use it as you would with cURL on the commandline. In fact, this is actually what the bodies of generated code do.

# You can also use the traditional method of making requests 
# if you prefer the cURL commandline syntax, works the same.
response = lbry.call("claim_list", {"name": "bellflower"})

API For LbryCRD

from pybry import LbrycrdApi

# Provide the username and password
lbrycrd = LbrycrdApi("username", "password")

# Just specify the method and the parameters
response = lbrycrd.call("wallet_unlock", {"wallet_username", "wallet_password"})

Release files for pybry 1.6.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 pybry 1.6.4
File Size Uploaded
pybry-1.6.4.tar.gz 33.6 kB Details

Built distribution (wheel)

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

Total release size: 71.4 kB

Release files / pybry-1.6.4.tar.gz

Download URL pybry-1.6.4.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
90973dec1abdb67fad2d813db684bc92a5731417b7c9f4d90e9bd1d6e999e2f8
BLAKE2b-256 checksum
How to use checksums
54a5ca381e18d3921cc76299cb3b0b0ea2f75d3f6c6333dd321d8cddcaac0c3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.5

Release files / pybry-1.6.4-py3-none-any.whl

Download URL pybry-1.6.4-py3-none-any.whl
Size 37.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a9231c9bb9a3a23f47260981539cfc5df6b472803ac45a5ea41828ac6483985
BLAKE2b-256 checksum
How to use checksums
c6f939d20e6eb47f0f3cfd001322f37e77027a7362ffc9d478f56e95a561f7d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.5

Release history Release notifications | RSS feed

This release

1.6.4 This release

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.5.0

1 release file

1.3.9

1 release file

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