A tool which pairs Pandas to LND Lightning Network Data for Data Science
Project description
lnpanda
lnpanda allows you to query Bitcoin lightning network data using Pandas dataframes. Pandas is a powerful data science tool, and the combination can be used to find insights about your node. In addition, pandas dataframes are a just convenient and powerful way to interact with your node, while staying on the command line!
Install
pip install lnpanda
Environment Variables
Add information like node ip address, and directory containing:
- tls.cert
- admin.macaroon
export CRED_PATH=/path/to/macaroon/and/tls/cert
export LND_NODE_IP=192.168.1.xx
Basic Usage
from lnpanda import lnpanda
# initialize lnpanda object
a = lnpanda()
# Get info about channel balances and fee rates in 1 view
a.list_channels_and_fees()
# List routed transactions, shows eff_fee_rate of fwd
a.list_forwards()
Using pandas queries
# List channels with a fee rate > 100
a.list_channels_and_fees().query("fee_rate > 0.000100")
# Get sum of latest 25 routed transactions in sats
a.list_forwards().tail(25).fee_msat.sum()/1000
# Get a set of alias' of the last 10 outgoing forwards
outgoing_chan_ids = list(a.list_forwards().tail(10).chan_id_out)
set(map(lambda x: a.get_peer_alias(x), outgoing_chan_ids))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file lnpanda-0.2.4-py3-none-any.whl
.
File metadata
- Download URL: lnpanda-0.2.4-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bea701ef6ff254e71e1e5e21ca5ae4df2f9ad56d06c1485eb534cb38d53d0329 |
|
MD5 | 4da6ce88fca726dcb5d5f68df0148481 |
|
BLAKE2b-256 | 8ba2e0bbb4af2bbb7eee6e77dc0ce7fd449ea8f2b966bf462f6708a280dffb4d |