No project description provided
Project description
PyBRY, a Python API Wrapper for lbry & lbrycrd
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
-
Make sure that
lbry-daemon
is up and running, as you will not be able to do anything without it. -
First, import
LbrydApi
orLbrycrdApi
frompybry
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"})
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pybry-1.6.3.tar.gz
.
File metadata
- Download URL: pybry-1.6.3.tar.gz
- Upload date:
- Size: 33.6 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7e9878ec2aa67f9725867feb8f396aa04cc44a0853652d59e811e8ea1bff706 |
|
MD5 | 3ec58071add54fb7e6ef9ff7e50e45a6 |
|
BLAKE2b-256 | 15850c3e6d928829393cd52e330167eb4603983042d3b8539824d9d367140ca2 |
File details
Details for the file pybry-1.6.3-py3-none-any.whl
.
File metadata
- Download URL: pybry-1.6.3-py3-none-any.whl
- Upload date:
- Size: 37.8 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b25040a249030b0adb02e6db3008878639cc3d473795e150cb5ec52dce5c8a9 |
|
MD5 | 8be737d799320024f9fae7d8d9db0fa7 |
|
BLAKE2b-256 | 51874240632e9b3ce23aabc70a2a43d7cd6707a46b1e291984b788f3f6ee4d0d |