Skip to main content

Interface to interact with OKX by GetMoney Inc.

Project description

GetMoney Inc. Utils

gmi_exception

Exceptions caused by GMI must be instances of GmiException:

# using plain GmiException
if is_something_bad_happened:
    raise GmiException('something bad happened!')

# using child of GmiException
class MyGmiException(GmiException):
    # your code...
    pass

if is_something_bad_happened_inside_lib:
    raise MyGmiException('something bad happened inside my lib!')

interval

call_repeatedly

stop_func = call_repeatedly(timeout, func, *args) starts calling func(*args) every timeout seconds in different thread. It also returns func that will stop this behaviour.

def bla_bla(last_bla: str):
    print(f"bla bla {last_bla}")

stop_func = call_repeatedly(1., bla_bla, "BLA!")
time.sleep(2.5)
stop_func()

# will print:
# bla bla BLA!
# bla bla BLA!

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

gmi_okx-0.1.7.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file gmi_okx-0.1.7.tar.gz.

File metadata

  • Download URL: gmi_okx-0.1.7.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for gmi_okx-0.1.7.tar.gz
Algorithm Hash digest
SHA256 643cc1417276a9dd2c69735d27a3fce643160a4e00421631166cba02f712960c
MD5 ed87422a6199477b8a9abc5da3f6f2ab
BLAKE2b-256 1a12ea16591ceee0554fe4d9f8184f78d2ad4576a01f35fc5fd8685178c1c851

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