Skip to main content

UNOFFICIAL Python bindings for Earnapp dashboard API

Project description

EarnApp API

A Python binding to interact with Earnapp dashboard API.

Installation

pip install pyEarnapp

Usage

from pyEarnapp import EarnApp
AUTH = "YOUR_AUTH_CODE_FROM_EARNAPP_DASHBOARD"

api = EarnApp(AUTH) # Initiallise the EarnApp object

Functions

  1. Get information about the user.

    get_user_data()
    
    • Returns an object of type UserData with the following attributes.
    first_name
    last_name
    name
    email
    
  2. Get information on user's earnings.

    get_earning_info()
    
    • Returns an object of type EarningInfo with the following attributes.
    balance
    earnings_total
    multiplier
    tokens
    redeem_details
    
  3. Get all the connected device's information.

    get_devices_info()
    
    • Returns an object of type DevicesInfo with the following attributes.
    devices # List of nodes connected with each node of object type "Device"
    windows_devices
    linux_devices
    other_devices
    
    • The devices attribute is a list of devices with each device of object type Device.
    • The object Device has the following attributes.
    uuid
    bandwidth_usage
    total_bandwidth
    redeemed_bandwidth
    rate
    country
    device_type
    
  4. Get a list of all the transactions.

    get_transaction_info()
    
    • Returns an object of type Transactions with the following attributes.
    transactions # List of all transactions
    pending_payments
    paid
    total_transactions
    
    • The attribute transactions is a list of all transactions with each item of object type Transaction.
    • The Transaction object has the following attributes.
    uuid
    status
    payment_method
    payment_date
    amount
    payout_date
    is_paid
    
  5. Add new node/device to your ID.

    add_new_device("EARNAPP_NODE_ID")
    
    • Returns the response from the server on success. Else raise an exception.
  6. Get a list of all referrals and their bonuses.

    get_referral_info()
    
    • Returns an obejct of type Referrals with the following attributes.
    referrals
    referral_earnings
    total_referral_earnings
    number_of_referrals
    
    • The attribute referrals is a list of all the referrals with each object of type Referee.
    • The Referee object has the following attributes.
    id
    bonuses
    bonuses_total
    email
    

Exceptions

The following exceptions are defined.

Exception Reason
AuthenticationError Raised on authentication failure.
DeviceAddError When the attempt to add device is failed.
DeviceNotFoundError When the device to be added is not found.
DeviceAlreadyAddedError When the device ID is already linked
UnKnownDeviceAddError When cause of failure is not known.
TooManyRequestsError Raised when earnapp rate limit is reached.

Project details


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

pyEarnapp-0.0.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file pyEarnapp-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pyEarnapp-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for pyEarnapp-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9df0ad4dcab48581f309a34742a4d866d5524ede1cb7cc4262c711e5c395e96e
MD5 a972f2506e46e76650b9f8bbfa8a3ba9
BLAKE2b-256 d7cf8e05787ab1ce177a50625f8fdff57bea203950173dea2263b7a91aef34f5

See more details on using hashes here.

Supported by

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