Skip to main content

Duino-Coin Mining library for Python.

Project description

Official DUCO module for Python 3

To build your own Duino-Coin apps we've created Duino-Coin API for Python 3.

Created by Connorhess, maintained by Alicia426

Getting Started

import ducoapi

Initialize the connection to the server

api_connection = ducoapi.api_actions() #creates the api connection instance

The next step is to Login/Register Note: login and register do not require you to init but they close the connection after use

Login

api_connection.login(username="username", password="password")

Register

api_connection.register(username="username", password="password", email="user@example.com")

Functions

These functions require user being loged-in.

Balance

Gets the current balance of the logged-in user
api_connection.balance() # takes no args

Transfer

Transfers Duco from logged-in user to the specified username
api_connection.transfer(recipient_username='test_user1', amount=1)

reset password

Resets the password of the logged-in user
api_connection.reset_pass(old_password='123', new_password='abc')

Get Latests Transactions

Get the latests transactions
api_connection.getTransactions(7) # 7 is the number of transactions to get
# returns JSON

Other Functions

Use of this functions does not require being loged-in.

Get Duco Price

returns the current Duco price as a float
>>> ducoapi.get_duco_price() 
0.01249

Duco price update timer

starts a timer that updates the price at a specified interval in seconds (default is 15)
>>> ducoapi.start_duco_price_timer(interval = 5) # start the timer that updates the price every 5 seconds
>>> ducoapi.duco_price # you can get the updated price from a global variable <duco_price>
0.01249

Example API script

import ducoapi

api_connection = ducoapi.api_actions()

api_connection.login(username='YourUsername', password='YourPassword')

current_balance = api_connection.balance()
print(current_balance)

api_connection.close()

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

ducoapi-0.0.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

ducoapi-0.0.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ducoapi-0.0.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.8.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.8.0 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for ducoapi-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4fd86bcbae8e3b320784c56ce62f023c8daefb00ef0c9c1d33205728844db95c
MD5 4c87e587341fd764a8b6c7e6aa719990
BLAKE2b-256 8a6abbb50d0c8b7a592950cee8c3055fdd0b9248181d9366924cfeff129edd33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ducoapi-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.8.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.8.0 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for ducoapi-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9bc9b12125fd3e6af2bd1ee8728c16dd67f53f54d5cdafd91fca617fbeb090fb
MD5 37938a7b92e5a2dc2956ac79873ed5bd
BLAKE2b-256 d32fcf6626278c41fb06e0c302007bdd8c7577d423b44292ff34e709cd9c92ae

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