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.

      Attribute Description
      first_name User's first name
      last_name User's last name
      name User's full name
      email User's login email
  2. Get information on user's earnings.

    get_earning_info()
    
    • Returns an object of type EarningInfo with the following attributes.

      Attribute Description
      balance Current earned balance.
      earnings_total Amount earned till date.
      multiplier Earning multiplier.
      tokens No idea what this is.
      redeem_details Returns object of type RedeemDetails.
      bonuses Earnings from referrals.
      bonuses_total Total earnings from referrals till date.
      referral_part Referral bonus percentage.
    • The object RedeemDetails has the following attributes.

      Attribute Description
      email Redemption email
      payment_method Redemption method
  3. Get all the connected device's information.

    get_devices_info()
    
    • Returns an object of type DevicesInfo with the following attributes.

      Attribute Description
      devices List of nodes connected with each node of object type Device.
      windows_devices Number of Windows devices.
      linux_devices Number of Linux devices.
      other_devices Number of other type of devices.
    • The object Device has the following attributes.

      Attribute Description
      uuid UUID of the device.
      bandwidth_usage Unredeemed bandwidth usage.
      total_bandwidth Total bandwindth usage.
      redeemed_bandwidth Redeemed bandwidth usage.
      rate Price/GB of the device.
      country Country of the device.
      device_type Type of device. (win/node/None)
  4. Get a list of all the transactions.

    get_transaction_info()
    
    • Returns an object of type Transactions with the following attributes.

      Attribute Description
      transactions List of all transactions with each object of type Transaction.
      pending_payments Number of pending payments.
      paid Number of payments completed.
      total_transactions Total number of transactions.
    • The Transaction object has the following attributes.

      Attribute Description
      uuid Transaction ID.
      status Status of transaction (pending/paid).
      payment_method Mode of payment.
      payment_date Date of payment.
      amount Amount redeemed.
      redeem_date Date on which balance was redeemed.
      is_paid True if the payment is completed.
  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.

      Attribute Description
      referrals List of all the referrals with each object of type Referee.
      referral_earnings Unredeemed earnings from referrals. (Same as get_earning_info().bonuses)
      total_referral_earnings Total earnings from referrals. (Same as get_earning_info().bonuses_total)
      number_of_referrals Total number of accepted referrals
    • The Referee object has the following attributes.

      Attribute Description
      id Referral ID.
      bonuses Unredeemed bonus from referred user.
      bonuses_total Total bonus from referred user.
      email Partially hidden referred user's 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.4-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyEarnapp-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.6 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 52dfe455dc90a54af3fe02559faea8d005ca0748562888a4b63f9463e0e932db
MD5 529f5442469af15cfc903ed59cb45705
BLAKE2b-256 a1a580a61b65abf9b90d6953dd3d2c7eb9b5e293f2a0c9e0be90d3e23b785775

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