gryphon.lib package

Subpackages

Submodules

gryphon.lib.arbitrage module

gryphon.lib.assets module

gryphon.lib.bitcoincharts module

gryphon.lib.bitcoinwisdom module

gryphon.lib.cache module

gryphon.lib.configurable_object module

Several objects in the gryphon-framework use the pattern of initializing their properties from a dictionary, in which the properties are unpredictable and may not be present from a dictionary, in which the properties are unpredictable and may not be present.

class gryphon.lib.configurable_object.ConfigurableObject[source]

Bases: object

configure(configuration)[source]

This function is called to configure the object. It should be a series of calls to self.init_configurable(configuration).

init_configurable(configurable_name, configuration)[source]

Helper function to initialize a single configurable property on the object if we find a value set for it in the configuration. If we don’t find an entry for a configurable name, or find a None value, we don’t don’t do anything (which should mean we stick to the default if you’ve written the class properly).

gryphon.lib.configuration module

gryphon.lib.dict_differ module

class gryphon.lib.dict_differ.DictDiffer(current_dict, past_dict)[source]

Bases: object

Calculate the difference between two dictionaries as: (1) items added (2) items removed (3) keys same in both but changed values (4) keys same in both and unchanged values

added()[source]
changed()[source]
removed()[source]
unchanged()[source]

gryphon.lib.encrypt module

gryphon.lib.encrypted_field module

gryphon.lib.environment module

gryphon.lib.exchange_volume_lib module

gryphon.lib.forex module

gryphon.lib.gryphon_json_serialize module

Module that monkey-patches json module when it’s imported so JSONEncoder.default() automatically checks for a special “to_json()” method and uses it to encode the object if found.

gryphon.lib.hackernewsie module

gryphon.lib.logger module

gryphon.lib.logger.get_logger(name, debug=False)[source]

gryphon.lib.logperf module

gryphon.lib.logperf.log_request_perf(handler)[source]

gryphon.lib.market_making module

gryphon.lib.money module

gryphon.lib.order_sliding module

gryphon.lib.papertrail module

gryphon.lib.redditor module

gryphon.lib.retry_request module

class gryphon.lib.retry_request.RetryRequest[source]

Bases: object

static get(url, retry_attempts=0, **kwargs)[source]
static post(url, retry_attempts=0, **kwargs)[source]

gryphon.lib.session module

This library provides functions for creating various types of database connections.

gryphon.lib.session.commit_mysql_session(session)[source]
gryphon.lib.session.get_a_dashboard_db_mysql_session()[source]
gryphon.lib.session.get_a_gds_db_mysql_session()[source]
gryphon.lib.session.get_a_memcache_connection()[source]
gryphon.lib.session.get_a_mongo_connection()[source]
gryphon.lib.session.get_a_mysql_session(creds)[source]
gryphon.lib.session.get_a_redis_connection(creds=None)[source]

This is used for workers to get an adhoc redis connection. Call .connection_pool.disconnect() at the end.

gryphon.lib.session.get_a_trading_db_mysql_session()[source]
gryphon.lib.session.get_a_worker_queue()[source]
gryphon.lib.session.get_an_rq_connection()[source]
gryphon.lib.session.get_dashboard_db_mysql_creds()[source]
gryphon.lib.session.get_gds_db_mysql_creds()[source]
gryphon.lib.session.get_mongo_creds()[source]
gryphon.lib.session.get_redis_creds()[source]
gryphon.lib.session.get_trading_db_mysql_creds()[source]

gryphon.lib.singleton module

class gryphon.lib.singleton.Singleton[source]

Bases: type

gryphon.lib.slacker module

class gryphon.lib.slacker.Slacker(channel, username, icon_url=None, icon_emoji=None, link_names=True)[source]

Bases: object

notify(message)[source]
exception gryphon.lib.slacker.SlackerException[source]

Bases: exceptions.Exception

gryphon.lib.strong_worker module

gryphon.lib.test_helper module

gryphon.lib.test_helper.skipped(func)[source]

gryphon.lib.time_parsing module

gryphon.lib.twistedbitcoinwisdom module

gryphon.lib.validation module

gryphon.lib.worker_scale module

Module contents

gryphon.lib.main()[source]

Entry point for the application script

gryphon.lib.monkeypatch_decimal_to_cdecimal()[source]
gryphon.lib.prepare()[source]