beem.instance module

class beem.instance.SharedInstance

Bases: object

config = {}
instance = None
beem.instance.clear_cache()

Clear Caches

beem.instance.set_shared_config(config)

This allows to set a config that will be used when calling shared_steem_instance and allows to define the configuration without requiring to actually create an instance

beem.instance.set_shared_steem_instance(steem_instance)

This method allows us to override default steem instance for all users of SharedInstance.instance.

Parameters:steem_instance (steem.steem.Steem) – Steem instance
beem.instance.shared_steem_instance()

This method will initialize SharedInstance.instance and return it. The purpose of this method is to have offer single default steem instance that can be reused by multiple classes.

from beem.account import Account
from beem.instance import shared_steem_instance

account = Account("test")
# is equivalent with
account = Account("test", steem_instance=shared_steem_instance())