Skip to main content

Allows interacting with the P2Pool API.

Project description

P2Pool API

This module provides the P2PoolAPI object to allow interacting with the P2Pool API.

Installation

The module can be installed from PyPi or Github with pip:

pip install p2pool-api
# or to install from the Github repository
pip install p2pool-api@git+https://github.com/hreikin/p2pool-api.git@main

Usage

API data is updated on initialization and can be updated individually or altogether using the relevant methods. Data is also available as properties to allow accessing the cached endpoint data all at once or as individual items.

import p2pool_api, logging

logging.basicConfig()
logging.getLogger("P2PoolAPI").setLevel(logging.INFO)           # Change to DEBUG to print out all responses when their methods are called
log = logging.getLogger("MyLOG")

api_path = "/path/to/p2pool/api"
x = p2pool_api.P2PoolAPI(api_path)

log.info(x._local_stratum)                                      # Log entire reponse
log.info(x.local_p2p_uptime)                                    # Log property representing individual data from the API
x.get_stats_mod()                                               # Update individual `stats_mod` endpoint
x.get_all_data()                                                # Update all endpoints at once

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

p2pool_api-0.0.2.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

p2pool_api-0.0.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file p2pool_api-0.0.2.tar.gz.

File metadata

  • Download URL: p2pool_api-0.0.2.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for p2pool_api-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e9f05fcaa2005585b290242b52e1ec7169a5ff4ce23226b82ceb4d2d913ad924
MD5 fc6218e96c77f712cee586f574498592
BLAKE2b-256 b7da43bf2d964ffd4550f73e2574a46d3477606a09f0bc4f69fe177fcb34fb9e

See more details on using hashes here.

File details

Details for the file p2pool_api-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: p2pool_api-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for p2pool_api-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 00c27d4d829087fdd5e2529561087f82cc08b3c11975a7043956f6aba58b2897
MD5 94e82356f0e9f3103449a5791ea75a06
BLAKE2b-256 30b8a600b13d53d9a13c97fba9da0ac1810fceff63249eadbb141ca9115ad0a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page