diff --git a/beem/account.py b/beem/account.py index 6e043716294d7e8caec809c7f5b2bce3be3be2f7..7d9308c3ca9bb3269e83eafc29979327c66166db 100644 --- a/beem/account.py +++ b/beem/account.py @@ -172,12 +172,17 @@ class Account(BlockchainObject): def getSimilarAccountNames(self, limit=5): """ Returns limit similar accounts with name as list + :param int limit: limits the number of accounts, which will be returned + :returns: Similar account names as list + :rtype: list + .. code-block:: python >>> from beem.account import Account >>> account = Account("test") >>> account.getSimilarAccountNames(limit=5) ['test', 'test-1', 'test-2', 'test-ico', 'test-ilionx-123'] + """ if self.steem.rpc.get_use_appbase(): account = self.steem.rpc.list_accounts({'start': self.name, 'limit': limit}, api="database") @@ -506,10 +511,28 @@ class Account(BlockchainObject): @property def balances(self): + """ Returns all account balances as dictionary + """ return self.get_balances() def get_balances(self): + """ Returns all account balances as dictionary + + :returns: Account balances + :rtype: dictionary + + Sample output: + .. code-block:: js + + { + 'available': [102.985 STEEM, 0.008 SBD, 146273.695970 VESTS], + 'savings': [0.000 STEEM, 0.000 SBD], + 'rewards': [0.000 STEEM, 0.000 SBD, 0.000000 VESTS], + 'total': [102.985 STEEM, 0.008 SBD, 146273.695970 VESTS] + } + + """ return { 'available': self.available_balances, 'savings': self.saving_balances, @@ -519,14 +542,30 @@ class Account(BlockchainObject): def get_balance(self, balances, symbol): """ Obtain the balance of a specific Asset. This call returns instances of - :class:`beem.amount.Amount`. + :class:`beem.amount.Amount`. Available balance types: + + * "available" + * "saving" + * "reward" + * "total" + + :param str balances: Defines the balance type + :param (str, dict) symbol: Can be "SBD", "STEEM" or "VESTS + + .. code-block:: python + + >>> from beem.account import Account + >>> account = Account("test") + >>> account.get_balance("rewards", "SBD") + 0.000 SBD + """ if isinstance(balances, string_types): if balances == "available": balances = self.available_balances - elif balances == "saving": + elif balances == "savings": balances = self.saving_balances - elif balances == "reward": + elif balances == "rewards": balances = self.reward_balances elif balances == "total": balances = self.total_balances @@ -542,8 +581,23 @@ class Account(BlockchainObject): return Amount(0, symbol, steem_instance=self.steem) def interest(self): - """ Caluclate interest for an account + """ Calculate interest for an account + :param str account: Account name to get interest for + :rtype: dictionary + + Sample output: + + .. code-block:: js + + { + 'interest': 0.0, + 'last_payment': datetime.datetime(2018, 1, 26, 5, 50, 27, tzinfo=<UTC>), + 'next_payment': datetime.datetime(2018, 2, 25, 5, 50, 27, tzinfo=<UTC>), + 'next_payment_duration': datetime.timedelta(-65, 52132, 684026), + 'interest_rate': 0.0 + } + """ last_payment = (self["sbd_last_interest_payment"]) next_payment = last_payment + timedelta(days=30) @@ -563,10 +617,13 @@ class Account(BlockchainObject): @property def is_fully_loaded(self): """ Is this instance fully loaded / e.g. all data available? + + :rtype: bool """ return (self.full) def ensure_full(self): + """Ensure that all data are loaded""" if not self.is_fully_loaded: self.full = True self.refresh() @@ -582,7 +639,20 @@ class Account(BlockchainObject): return self.steem.rpc.get_account_bandwidth(account, bandwidth_type) def get_bandwidth(self): - """Returns used and allocated bandwidth""" + """ Returns used and allocated bandwidth + + :rtype: dict + + Sample output: + + .. code-block:: js + + { + 'used': 0, + 'allocated': 2211037 + } + + """ account = self["name"] global_properties = self.steem.get_dynamic_global_properties() reserve_ratio = self.steem.get_reserve_ratio() @@ -618,7 +688,11 @@ class Account(BlockchainObject): # print("bandwidth percent remaining: " + str(100 - (100 * used_bandwidth / allocated_bandwidth))) def get_owner_history(self, account=None): - """ get_owner_history """ + """ get_owner_history + + :rtype: list + + """ if account is None: account = self["name"] if self.steem.rpc.get_use_appbase(): @@ -627,7 +701,11 @@ class Account(BlockchainObject): return self.steem.rpc.get_owner_history(account) def get_conversion_requests(self, account=None): - """ get_owner_history """ + """ Returns get_owner_history + + :rtype: list + + """ if account is None: account = self["name"] if self.steem.rpc.get_use_appbase(): @@ -636,7 +714,11 @@ class Account(BlockchainObject): return self.steem.rpc.get_conversion_requests(account) def get_withdraw_routes(self, account=None): - """Returns withdraw_routes """ + """ Returns withdraw_routes + + :rtype: list + + """ if account is None: account = self["name"] if self.steem.rpc.get_use_appbase(): @@ -645,7 +727,11 @@ class Account(BlockchainObject): return self.steem.rpc.get_withdraw_routes(account, 'all') def get_recovery_request(self, account=None): - """ get_recovery_request """ + """ Returns get_recovery_request + + :rtype: list + + """ if account is None: account = self["name"] if self.steem.rpc.get_use_appbase(): @@ -696,7 +782,10 @@ class Account(BlockchainObject): return self["name"] in active_votes def virtual_op_count(self, until=None): - """Returns the number of individual account transactions""" + """ Returns the number of individual account transactions + + :rtype: list + """ if until is not None and isinstance(until, datetime): limit = until last_gen = self.history_reverse(limit=limit) @@ -737,6 +826,20 @@ class Account(BlockchainObject): def curation_stats(self): """Returns the curation reward of the last 24h and 7d and the average of the last 7 days + + :returns: Account curation + :rtype: dictionary + + Sample output: + + .. code-block:: js + + { + '24hr': 0.0, + '7d': 0.0, + 'avg': 0.0 + } + """ return {"24hr": self.get_curation_reward(days=1), "7d": self.get_curation_reward(days=7), @@ -868,32 +971,55 @@ class Account(BlockchainObject): beembase.operationids.ops. Example: ['transfer', 'vote'] - .. code-block:: python + .. testsetup:: * + + from beem.account import Account + from datetime import datetime + acc = Account("gtg") + + .. testcode:: + + from beem.account import Account + from datetime import datetime + acc = Account("gtg") + max_op_count = acc.virtual_op_count() + # Returns the 100 latest operations + acc_op = [] + for h in acc.history(start=max_op_count - 99, stop=max_op_count, use_block_num=False): + acc_op.append(h) + len(acc_op) + + .. testoutput:: - >>> from beem.account import Account - >>> from datetime import datetime - >>> acc = Account("gtg") - >>> max_op_count = acc.virtual_op_count() - >>> # Returns the 100 latest operations - >>> acc_op = [] - >>> for h in acc.history(start=max_op_count - 99, stop=max_op_count, use_block_num=False): acc_op.append(h) - >>> len(acc_op) 100 - >>> acc = Account("test") - >>> max_block = 21990141 - >>> # Returns the account operation inside the last 100 block. This can be empty. - >>> acc_op = [] - >>> for h in acc.history(start=max_block - 99, stop=max_block, use_block_num=True): acc_op.append(h) - >>> len(acc_op) + .. testcode:: + + acc = Account("test") + max_block = 21990141 + # Returns the account operation inside the last 100 block. This can be empty. + acc_op = [] + for h in acc.history(start=max_block - 99, stop=max_block, use_block_num=True): + acc_op.append(h) + len(acc_op) + + .. testoutput:: + 0 - >>> start_time = datetime(2018, 3, 1, 0, 0, 0) - >>> stop_time = datetime(2018, 3, 2, 0, 0, 0) - >>> # Returns the account operation from 1.4.2018 back to 1.3.2018 - >>> acc_op = [] - >>> for h in acc.history(start=start_time, stop=stop_time): acc_op.append(h) - >>> len(acc_op) + .. testcode:: + + acc = Account("test") + start_time = datetime(2018, 3, 1, 0, 0, 0) + stop_time = datetime(2018, 3, 2, 0, 0, 0) + # Returns the account operation from 1.4.2018 back to 1.3.2018 + acc_op = [] + for h in acc.history(start=start_time, stop=stop_time): + acc_op.append(h) + len(acc_op) + + .. testoutput:: + 0 """ @@ -986,32 +1112,54 @@ class Account(BlockchainObject): beembase.operationids.ops. Example: ['transfer', 'vote'] - .. code-block:: python + .. testsetup:: + + from beem.account import Account + from datetime import datetime + acc = Account("gtg") + + .. testcode:: + + from beem.account import Account + from datetime import datetime + acc = Account("gtg") + max_op_count = acc.virtual_op_count() + # Returns the 100 latest operations + acc_op = [] + for h in acc.history_reverse(start=max_op_count, stop=max_op_count - 99, use_block_num=False): + acc_op.append(h) + len(acc_op) + + .. testoutput:: - >>> from beem.account import Account - >>> from datetime import datetime - >>> acc = Account("gtg") - >>> max_op_count = acc.virtual_op_count() - >>> # Returns the 100 latest operations - >>> acc_op = [] - >>> for h in acc.history_reverse(start=max_op_count, stop=max_op_count - 99, use_block_num=False): acc_op.append(h) - >>> len(acc_op) 100 - >>> max_block = 21990141 - >>> acc = Account("test") - >>> # Returns the account operation inside the last 100 block. This can be empty. - >>> acc_op = [] - >>> for h in acc.history_reverse(start=max_block, stop=max_block-100, use_block_num=True): acc_op.append(h) - >>> len(acc_op) + .. testcode:: + + max_block = 21990141 + acc = Account("test") + # Returns the account operation inside the last 100 block. This can be empty. + acc_op = [] + for h in acc.history_reverse(start=max_block, stop=max_block-100, use_block_num=True): + acc_op.append(h) + len(acc_op) + + .. testoutput:: + 0 - >>> start_time = datetime(2018, 4, 1, 0, 0, 0) - >>> stop_time = datetime(2018, 3, 1, 0, 0, 0) - >>> # Returns the account operation from 1.4.2018 back to 1.3.2018 - >>> acc_op = [] - >>> for h in acc.history_reverse(start=start_time, stop=stop_time): acc_op.append(h) - >>> len(acc_op) + .. testcode:: + + start_time = datetime(2018, 4, 1, 0, 0, 0) + stop_time = datetime(2018, 3, 1, 0, 0, 0) + # Returns the account operation from 1.4.2018 back to 1.3.2018 + acc_op = [] + for h in acc.history_reverse(start=start_time, stop=stop_time): + acc_op.append(h) + len(acc_op) + + .. testoutput:: + 0 """ diff --git a/beem/amount.py b/beem/amount.py index 9c06a6d2c6c7ac74458a8fec9c62577642b11582..b96b275d1512c19a9bf59f90790171f7350a37f7 100644 --- a/beem/amount.py +++ b/beem/amount.py @@ -42,19 +42,22 @@ class Amount(dict): Instances of this class can be used in regular mathematical expressions (``+-*/%``) such as: - .. code-block:: python - - >>> from beem.amount import Amount - >>> from beem.asset import Asset - >>> a = Amount("1 STEEM") - >>> b = Amount(1, "STEEM") - >>> c = Amount("20", Asset("STEEM")) - >>> a + b + .. testcode:: + + from beem.amount import Amount + from beem.asset import Asset + a = Amount("1 STEEM") + b = Amount(1, "STEEM") + c = Amount("20", Asset("STEEM")) + a + b + a * 2 + a += b + a /= 2.0 + + .. testoutput:: + 2.000 STEEM - >>> a * 2 2.000 STEEM - >>> a += b - >>> a /= 2.0 """ def __init__(self, amount, asset=None, new_appbase_format=False, steem_instance=None): diff --git a/beem/asciichart.py b/beem/asciichart.py index e10ae537b1988623c8b04517205bf266b2d692e7..b06b7f9008b3da90cf5664fa7debdb7f03f71e05 100644 --- a/beem/asciichart.py +++ b/beem/asciichart.py @@ -78,16 +78,16 @@ class AsciiChart(object): :param list series: time series to plot - .. code-block:: python + .. testcode:: - >>> from beem.asciichart import AsciiChart - >>> chart = AsciiChart() - >>> series = [1, 2, 3, 7, 2, -4, -2] - >>> chart.adapt_on_series(series) - >>> chart.new_chart() - >>> chart.add_axis() - >>> chart.add_curve(series) - >>> print(str(chart)) # doctest: +SKIP + from beem.asciichart import AsciiChart + chart = AsciiChart() + series = [1, 2, 3, 7, 2, -4, -2] + chart.adapt_on_series(series) + chart.new_chart() + chart.add_axis() + chart.add_curve(series) + print(str(chart)) # doctest: +SKIP """ self.minimum = min(series) @@ -129,12 +129,12 @@ class AsciiChart(object): def plot(self, series, return_str=False): """All in one function for plotting - .. code-block:: python + .. testcode:: - >>> from beem.asciichart import AsciiChart - >>> chart = AsciiChart() - >>> series = [1, 2, 3, 7, 2, -4, -2] - >>> chart.plot(series) # doctest: +SKIP + from beem.asciichart import AsciiChart + chart = AsciiChart() + series = [1, 2, 3, 7, 2, -4, -2] + chart.plot(series) # doctest: +SKIP """ self.clear_data() self.adapt_on_series(series) @@ -149,16 +149,17 @@ class AsciiChart(object): def new_chart(self, minimum=None, maximum=None, n=None): """Clears the canvas - .. code-block:: python + .. testcode:: + + from beem.asciichart import AsciiChart + chart = AsciiChart() + series = [1, 2, 3, 7, 2, -4, -2] + chart.adapt_on_series(series) + chart.new_chart() + chart.add_axis() + chart.add_curve(series) + print(str(chart)) # doctest: +SKIP - >>> from beem.asciichart import AsciiChart - >>> chart = AsciiChart() - >>> series = [1, 2, 3, 7, 2, -4, -2] - >>> chart.adapt_on_series(series) - >>> chart.new_chart() - >>> chart.add_axis() - >>> chart.add_curve(series) - >>> print(str(chart)) # doctest: +SKIP """ if minimum is not None: self.minimum = minimum @@ -172,16 +173,16 @@ class AsciiChart(object): def add_axis(self): """Adds a y-axis to the canvas - .. code-block:: python + .. testcode:: - >>> from beem.asciichart import AsciiChart - >>> chart = AsciiChart() - >>> series = [1, 2, 3, 7, 2, -4, -2] - >>> chart.adapt_on_series(series) - >>> chart.new_chart() - >>> chart.add_axis() - >>> chart.add_curve(series) - >>> print(str(chart)) # doctest: +SKIP + from beem.asciichart import AsciiChart + chart = AsciiChart() + series = [1, 2, 3, 7, 2, -4, -2] + chart.adapt_on_series(series) + chart.new_chart() + chart.add_axis() + chart.add_curve(series) + print(str(chart)) # doctest: +SKIP """ # axis and labels @@ -210,16 +211,16 @@ class AsciiChart(object): :param list series: List width float data points - .. code-block:: python + .. testcode:: - >>> from beem.asciichart import AsciiChart - >>> chart = AsciiChart() - >>> series = [1, 2, 3, 7, 2, -4, -2] - >>> chart.adapt_on_series(series) - >>> chart.new_chart() - >>> chart.add_axis() - >>> chart.add_curve(series) - >>> print(str(chart)) # doctest: +SKIP + from beem.asciichart import AsciiChart + chart = AsciiChart() + series = [1, 2, 3, 7, 2, -4, -2] + chart.adapt_on_series(series) + chart.new_chart() + chart.add_axis() + chart.add_curve(series) + print(str(chart)) # doctest: +SKIP """ if self.n is None: diff --git a/beem/asset.py b/beem/asset.py index 703efb4ae5c71b6dd004f17c11ef99f634282bdd..bfccc20067527a9dc7d6f869c163ed5dc0b4ea66 100644 --- a/beem/asset.py +++ b/beem/asset.py @@ -17,7 +17,6 @@ class Asset(BlockchainObject): :param beem.steem.Steem steem_instance: Steem instance :returns: All data of an asset - :rtype: dict .. note:: This class comes with its own caching function to reduce the load on the API server. Instances of this class can be diff --git a/beem/blockchain.py b/beem/blockchain.py index 5e852ceaee04e767dbeed068de0b55775ea732b8..9dc74b7ba5dca4708ec88a930564e6c49a800b41 100644 --- a/beem/blockchain.py +++ b/beem/blockchain.py @@ -40,38 +40,37 @@ class Blockchain(object): This class let's you deal with blockchain related data and methods. Read blockchain related data: - .. code-block:: python + .. testsetup:: - >>> from beem.blockchain import Blockchain - >>> chain = Blockchain() + from beem.blockchain import Blockchain + chain = Blockchain() Read current block and blockchain info - .. code-block:: python + .. testcode:: - >>> from beem.blockchain import Blockchain - >>> chain = Blockchain() - >>> print(chain.get_current_block()) # doctest: +SKIP - >>> print(chain.steem.info()) # doctest: +SKIP + print(chain.get_current_block()) # doctest: +SKIP + print(chain.steem.info()) # doctest: +SKIP Monitor for new blocks. When ``stop`` is not set, monitoring will never stop. - .. code-block:: python - - >>> from beem.blockchain import Blockchain - >>> chain = Blockchain() - >>> blocks = [] - >>> current_num = chain.get_current_block_num() - >>> for block in chain.blocks(start=current_num - 99, stop=current_num): blocks.append(block) - >>> len(blocks) + .. testcode:: + + blocks = [] + current_num = chain.get_current_block_num() + for block in chain.blocks(start=current_num - 99, stop=current_num): + blocks.append(block) + len(blocks) + + .. testoutput:: + 100 or each operation individually: - .. code-block:: python + .. testcode:: - >>> from beem.blockchain import Blockchain - >>> chain = Blockchain() - >>> ops = [] - >>> current_num = chain.get_current_block_num() - >>> for operation in chain.ops(start=current_num - 99, stop=current_num): ops.append(operation) + ops = [] + current_num = chain.get_current_block_num() + for operation in chain.ops(start=current_num - 99, stop=current_num): + ops.append(operation) """ def __init__( @@ -274,9 +273,10 @@ class Blockchain(object): def wait_for_and_get_block(self, block_number, blocks_waiting_for=None, last_fetched_block_num=None): """ Get the desired block from the chain, if the current head block is smaller (for both head and irreversible) then we wait, but a maxmimum of blocks_waiting_for * max_block_wait_repetition time before failure. + :param int block_number: desired block number :param int blocks_waiting_for: (default) difference between block_number and current head - how many blocks we are willing to wait, positive int + how many blocks we are willing to wait, positive int """ if last_fetched_block_num is None or (last_fetched_block_num is not None and block_number > last_fetched_block_num): diff --git a/beem/discussions.py b/beem/discussions.py index ffcdf681be2f6ece4fe3606b081048a906e18f20..7aded8d276bad4910297fad9077a288d1174848a 100644 --- a/beem/discussions.py +++ b/beem/discussions.py @@ -12,17 +12,23 @@ log = logging.getLogger(__name__) class Query(dict): - """ - :param int limit - :param str tag - :param int truncate_body - :param array filter_tags - :param array select_authors - :param array select_tags - :param str start_author - :param str start_permlink - :param str parent_author - :param str parent_permlink + """ Query to be used for all discussion queries + + :param int limit: limits the number of posts + :param str tag: tag query + :param int truncate_body: + :param array filter_tags: + :param array select_authors: + :param array select_tags: + :param str start_author: + :param str start_permlink: + :param str parent_author: + :param str parent_permlink: + + .. testcode:: + from beem.discussions import Query + query = Query(limit=10, tag="steemit") + """ def __init__(self, limit=0, tag="", truncate_body=0, filter_tags=[], select_authors=[], select_tags=[], @@ -40,10 +46,11 @@ class Query(dict): class Discussions_by_trending(list): - """ get_discussions_by_trending + """ Get Discussions by trending + + :param beem.discussions.Query: discussion_query + :param beem.steem.Steem steem_instance: Steem instance - :param Query discussion_query - :param steem steem_instance: Steem() instance to use when accesing a RPC """ def __init__(self, discussion_query, steem_instance=None): self.steem = steem_instance or shared_steem_instance() @@ -62,10 +69,11 @@ class Discussions_by_trending(list): class Comment_discussions_by_payout(list): - """ get_comment_discussions_by_payout + """ Get comment_discussions_by_payout + + :param beem.discussions.Query: discussion_query + :param beem.steem.Steem steem_instance: Steem instance - :param str discussion_query - :param steem steem_instance: Steem() instance to use when accesing a RPC """ def __init__(self, discussion_query, steem_instance=None): self.steem = steem_instance or shared_steem_instance() @@ -84,10 +92,10 @@ class Comment_discussions_by_payout(list): class Post_discussions_by_payout(list): - """ get_post_discussions_by_payout + """ Get post_discussions_by_payout - :param str discussion_query - :param steem steem_instance: Steem() instance to use when accesing a RPC + :param beem.discussions.Query: discussion_query + :param beem.steem.Steem steem_instance: Steem instance """ def __init__(self, discussion_query, steem_instance=None): self.steem = steem_instance or shared_steem_instance() @@ -106,10 +114,10 @@ class Post_discussions_by_payout(list): class Discussions_by_created(list): - """ get_discussions_by_created + """ Get discussions_by_created - :param str discussion_query - :param steem steem_instance: Steem() instance to use when accesing a RPC + :param beem.discussions.Query: discussion_query + :param beem.steem.Steem steem_instance: Steem instance """ def __init__(self, discussion_query, steem_instance=None): self.steem = steem_instance or shared_steem_instance() @@ -150,11 +158,11 @@ class Discussions_by_active(list): class Discussions_by_cashout(list): - """ get_discussions_by_cashout. This query seems to be broken at the moment. + """ Get discussions_by_cashout. This query seems to be broken at the moment. The output is always empty. - :param str discussion_query - :param steem steem_instance: Steem() instance to use when accesing a RPC + :param beem.discussions.Query: discussion_query + :param beem.steem.Steem steem_instance: Steem instance """ def __init__(self, discussion_query, steem_instance=None): self.steem = steem_instance or shared_steem_instance() @@ -173,10 +181,10 @@ class Discussions_by_cashout(list): class Discussions_by_votes(list): - """ get_discussions_by_votes + """ Get discussions_by_votes - :param str discussion_query - :param steem steem_instance: Steem() instance to use when accesing a RPC + :param beem.discussions.Query: discussion_query + :param beem.steem.Steem steem_instance: Steem instance """ def __init__(self, discussion_query, steem_instance=None): self.steem = steem_instance or shared_steem_instance() @@ -195,10 +203,10 @@ class Discussions_by_votes(list): class Discussions_by_children(list): - """ get_discussions_by_children + """ Get discussions by children - :param str discussion_query - :param steem steem_instance: Steem() instance to use when accesing a RPC + :param beem.discussions.Query: discussion_query + :param beem.steem.Steem steem_instance: Steem instance """ def __init__(self, discussion_query, steem_instance=None): self.steem = steem_instance or shared_steem_instance() @@ -217,10 +225,10 @@ class Discussions_by_children(list): class Discussions_by_hot(list): - """ get_discussions_by_hot + """ Get discussions by hot - :param str discussion_query - :param steem steem_instance: Steem() instance to use when accesing a RPC + :param beem.discussions.Query: discussion_query + :param beem.steem.Steem steem_instance: Steem instance """ def __init__(self, discussion_query, steem_instance=None): self.steem = steem_instance or shared_steem_instance() @@ -239,10 +247,10 @@ class Discussions_by_hot(list): class Discussions_by_feed(list): - """ get_discussions_by_feed + """ Get discussions by feed - :param str discussion_query, tag musst be set to a username - :param steem steem_instance: Steem() instance to use when accesing a RPC + :param beem.discussions.Query: discussion_query, tag musst be set to a username + :param beem.steem.Steem steem_instance: Steem instance """ def __init__(self, discussion_query, steem_instance=None): self.steem = steem_instance or shared_steem_instance() @@ -265,10 +273,10 @@ class Discussions_by_feed(list): class Discussions_by_blog(list): - """ get_discussions_by_blog + """ Get discussions by blog - :param str discussion_query, tag musst be set to a username - :param steem steem_instance: Steem() instance to use when accesing a RPC + :param beem.discussions.Query: discussion_query, tag musst be set to a username + :param beem.steem.Steem steem_instance: Steem instance """ def __init__(self, discussion_query, steem_instance=None): self.steem = steem_instance or shared_steem_instance() @@ -291,10 +299,10 @@ class Discussions_by_blog(list): class Discussions_by_comments(list): - """ get_discussions_by_comments + """ Get discussions by comments - :param str discussion_query - :param steem steem_instance: Steem() instance to use when accesing a RPC + :param beem.discussions.Query: discussion_query + :param beem.steem.Steem steem_instance: Steem instance """ def __init__(self, discussion_query, steem_instance=None): self.steem = steem_instance or shared_steem_instance() @@ -313,10 +321,10 @@ class Discussions_by_comments(list): class Discussions_by_promoted(list): - """ get_discussions_by_promoted + """ Get discussions by promoted - :param str discussion_query - :param steem steem_instance: Steem() instance to use when accesing a RPC + :param beem.discussions.Query: discussion_query + :param beem.steem.Steem steem_instance: Steem instance """ def __init__(self, discussion_query, steem_instance=None): self.steem = steem_instance or shared_steem_instance() diff --git a/beem/market.py b/beem/market.py index 30f44195103341c1463a0a863ffacc9f23f7845b..37714b07806db8fcfdb0c9545caa3cfdab0aa82d 100644 --- a/beem/market.py +++ b/beem/market.py @@ -187,19 +187,51 @@ class Market(dict): """ Returns the order book for SBD/STEEM market. :param int limit: Limit the amount of orders (default: 25) - Sample output: - .. code-block:: js - - {'bids': [0.003679 USD/BTS (1.9103 USD|519.29602 BTS), - 0.003676 USD/BTS (299.9997 USD|81606.16394 BTS), - 0.003665 USD/BTS (288.4618 USD|78706.21881 BTS), - 0.003665 USD/BTS (3.5285 USD|962.74409 BTS), - 0.003665 USD/BTS (72.5474 USD|19794.41299 BTS)], - 'asks': [0.003738 USD/BTS (36.4715 USD|9756.17339 BTS), - 0.003738 USD/BTS (18.6915 USD|5000.00000 BTS), - 0.003742 USD/BTS (182.6881 USD|48820.22081 BTS), - 0.003772 USD/BTS (4.5200 USD|1198.14798 BTS), - 0.003799 USD/BTS (148.4975 USD|39086.59741 BTS)]} + Sample output (raw_data=False): + .. code-block:: js + + { + 'asks': [ + 380.510 STEEM 460.291 SBD @ 1.209669 SBD/STEEM, + 53.785 STEEM 65.063 SBD @ 1.209687 SBD/STEEM + ], + 'bids': [ + 0.292 STEEM 0.353 SBD @ 1.208904 SBD/STEEM, + 8.498 STEEM 10.262 SBD @ 1.207578 SBD/STEEM + ], + 'asks_date': [ + datetime.datetime(2018, 4, 30, 21, 7, 24, tzinfo=<UTC>), + datetime.datetime(2018, 4, 30, 18, 12, 18, tzinfo=<UTC>) + ], + 'bids_date': [ + datetime.datetime(2018, 4, 30, 21, 1, 21, tzinfo=<UTC>), + datetime.datetime(2018, 4, 30, 20, 38, 21, tzinfo=<UTC>) + ] + } + + Sample output (raw_data=True): + .. code-block:: js + + { + 'asks': [ + { + 'order_price': {'base': '8.000 STEEM', 'quote': '9.618 SBD'}, + 'real_price': '1.20225000000000004', + 'steem': 4565, + 'sbd': 5488, + 'created': '2018-04-30T21:12:45' + } + ], + 'bids': [ + { + 'order_price': {'base': '10.000 SBD', 'quote': '8.333 STEEM'}, + 'real_price': '1.20004800192007677', + 'steem': 8333, + 'sbd': 10000, + 'created': '2018-04-30T20:29:33' + } + ] + } .. note:: Each bid is an instance of class:`beem.price.Order` and thus carries the keys @@ -232,22 +264,32 @@ class Market(dict): specify "all" to get the orderbooks of all markets. :param int limit: Limit the amount of orders (default: 25) + :param bool raw_data: when False, FilledOrder objects will be + returned - Sample output: + Sample output (raw_data=False): - .. code-block:: js + .. code-block:: js - {'bids': [0.003679 USD/BTS (1.9103 USD|519.29602 BTS), - 0.003676 USD/BTS (299.9997 USD|81606.16394 BTS), - 0.003665 USD/BTS (288.4618 USD|78706.21881 BTS), - 0.003665 USD/BTS (3.5285 USD|962.74409 BTS), - 0.003665 USD/BTS (72.5474 USD|19794.41299 BTS)], - 'asks': [0.003738 USD/BTS (36.4715 USD|9756.17339 BTS), - 0.003738 USD/BTS (18.6915 USD|5000.00000 BTS), - 0.003742 USD/BTS (182.6881 USD|48820.22081 BTS), - 0.003772 USD/BTS (4.5200 USD|1198.14798 BTS), - 0.003799 USD/BTS (148.4975 USD|39086.59741 BTS)]} + [ + (2018-04-30 21:00:54+00:00) 0.267 STEEM 0.323 SBD @ 1.209738 SBD/STEEM, + (2018-04-30 20:59:30+00:00) 0.131 STEEM 0.159 SBD @ 1.213740 SBD/STEEM, + (2018-04-30 20:55:45+00:00) 0.093 STEEM 0.113 SBD @ 1.215054 SBD/STEEM, + (2018-04-30 20:55:30+00:00) 26.501 STEEM 32.058 SBD @ 1.209690 SBD/STEEM, + (2018-04-30 20:55:18+00:00) 2.108 STEEM 2.550 SBD @ 1.209677 SBD/STEEM, + ] + Sample output (raw_data=True): + + .. code-block:: js + + [ + {'date': '2018-04-30T21:02:45', 'current_pays': '0.235 SBD', 'open_pays': '0.194 STEEM'}, + {'date': '2018-04-30T21:02:03', 'current_pays': '24.494 SBD', 'open_pays': '20.248 STEEM'}, + {'date': '2018-04-30T20:48:30', 'current_pays': '175.464 STEEM', 'open_pays': '211.955 SBD'}, + {'date': '2018-04-30T20:48:30', 'current_pays': '0.999 STEEM', 'open_pays': '1.207 SBD'}, + {'date': '2018-04-30T20:47:54', 'current_pays': '0.273 SBD', 'open_pays': '0.225 STEEM'}, + ] .. note:: Each bid is an instance of class:`steem.price.Order` and thus carries the keys @@ -362,21 +404,23 @@ class Market(dict): (default: now/0) Example: - .. code-block:: js - - {'close_sbd': 2493387, - 'close_steem': 7743431, - 'high_sbd': 1943872, - 'high_steem': 5999610, - 'id': '7.1.5252', - 'low_sbd': 534928, - 'low_steem': 1661266, - 'open': '2016-07-08T11:25:00', - 'open_sbd': 534928, - 'open_steem': 1661266, - 'sbd_volume': 9714435, - 'seconds': 300, - 'steem_volume': 30088443}, + .. code-block:: js + + { + 'close_sbd': 2493387, + 'close_steem': 7743431, + 'high_sbd': 1943872, + 'high_steem': 5999610, + 'id': '7.1.5252', + 'low_sbd': 534928, + 'low_steem': 1661266, + 'open': '2016-07-08T11:25:00', + 'open_sbd': 534928, + 'open_steem': 1661266, + 'sbd_volume': 9714435, + 'seconds': 300, + 'steem_volume': 30088443 + } """ buckets = self.market_history_buckets() @@ -450,16 +494,16 @@ class Market(dict): :param string returnOrderId: If set to "head" or "irreversible" the call will wait for the tx to appear in the head/irreversible block and add the key "orderid" to the tx output - Prices/Rates are denoted in 'base', i.e. the USD_BTS market - is priced in BTS per USD. + Prices/Rates are denoted in 'base', i.e. the SBD_STEEM market + is priced in STEEM per SBD. - **Example:** in the USD_BTS market, a price of 300 means - a USD is worth 300 BTS + **Example:** in the SBD_STEEM market, a price of 300 means + a SBD is worth 300 STEEM .. note:: All prices returned are in the **reversed** orientation as the - market. I.e. in the BTC/BTS market, prices are BTS per BTC. + market. I.e. in the STEEM/SBD market, prices are SBD per STEEM. That way you can multiply prices with `1.05` to get a +5%. .. warning:: @@ -470,9 +514,9 @@ class Market(dict): buy asset than you placed the order for. Example: - * You place and order to buy 10 USD for 100 BTS/USD - * This means that you actually place a sell order for 1000 BTS in order to obtain **at least** 10 USD - * If an order on the market exists that sells USD for cheaper, you will end up with more than 10 USD + * You place and order to buy 10 SBD for 100 STEEM/SBD + * This means that you actually place a sell order for 1000 STEEM in order to obtain **at least** 10 SBD + * If an order on the market exists that sells SBD for cheaper, you will end up with more than 10 SBD """ if not expiration: expiration = self.steem.config["order-expiration"] @@ -547,16 +591,16 @@ class Market(dict): :param string returnOrderId: If set to "head" or "irreversible" the call will wait for the tx to appear in the head/irreversible block and add the key "orderid" to the tx output - Prices/Rates are denoted in 'base', i.e. the USD_BTS market - is priced in BTS per USD. + Prices/Rates are denoted in 'base', i.e. the SBD_STEEM market + is priced in STEEM per SBD. - **Example:** in the USD_BTS market, a price of 300 means - a USD is worth 300 BTS + **Example:** in the SBD_STEEM market, a price of 300 means + a SBD is worth 300 STEEM .. note:: All prices returned are in the **reversed** orientation as the - market. I.e. in the BTC/BTS market, prices are BTS per BTC. + market. I.e. in the STEEM/SBD market, prices are SBD per STEEM. That way you can multiply prices with `1.05` to get a +5%. """ if not expiration: @@ -612,9 +656,9 @@ class Market(dict): def cancel(self, orderNumbers, account=None, **kwargs): """ Cancels an order you have placed in a given market. Requires - only the "orderNumbers". An order number takes the form - ``1.7.xxx``. - :param str orderNumbers: The Order Object ide of the form ``1.7.xxxx`` + only the "orderNumbers". + + :param int/list orderNumbers: A single order number or a list of order numbers """ if not account: if "default_account" in self.steem.config: diff --git a/beem/memo.py b/beem/memo.py index e33acdeebeb4f65dece3207fea63ab8b28115f25..6fa53708b8b3e4324739ddc8e0511f4ff7078e49 100644 --- a/beem/memo.py +++ b/beem/memo.py @@ -111,26 +111,26 @@ class Memo(object): .. code-block:: python - from getpass import getpass - from beem.block import Block - from beem.memo import Memo - - # Obtain a transfer from the blockchain - block = Block(23755086) # block - transaction = block["transactions"][3] # transactions - op = transaction["operations"][0] # operation - op_id = op[0] # operation type - op_data = op[1] # operation payload - - # Instantiate Memo for decoding - memo = Memo() - - # Unlock wallet - memo.unlock_wallet(getpass()) - - # Decode memo - # Raises exception if required keys not available in the wallet - print(memo.decrypt(op_data["transfer"])) + from getpass import getpass + from beem.block import Block + from beem.memo import Memo + + # Obtain a transfer from the blockchain + block = Block(23755086) # block + transaction = block["transactions"][3] # transactions + op = transaction["operations"][0] # operation + op_id = op[0] # operation type + op_data = op[1] # operation payload + + # Instantiate Memo for decoding + memo = Memo() + + # Unlock wallet + memo.unlock_wallet(getpass()) + + # Decode memo + # Raises exception if required keys not available in the wallet + print(memo.decrypt(op_data["transfer"])) """ def __init__( diff --git a/beem/price.py b/beem/price.py index a884383fd7efc6cf2f5a72e0b13763f05f401bc3..f2d0bc3a9aba4b615d176e4dffdf70f7436f3259 100644 --- a/beem/price.py +++ b/beem/price.py @@ -68,6 +68,8 @@ class Price(dict): >>> from beem.price import Price >>> Price("0.3314 SBD/STEEM") * 2 0.662804 SBD/STEEM + >>> Price(0.3314, "SBD", "STEEM") + 0.331402 SBD/STEEM """ def __init__( @@ -160,7 +162,8 @@ class Price(dict): return Price( None, base=self["base"].copy(), - quote=self["quote"].copy()) + quote=self["quote"].copy(), + steem_instance=self.steem) def _safedivide(self, a, b): if b != 0.0: @@ -175,6 +178,13 @@ class Price(dict): """ Returns the price instance so that the base asset is ``base``. Note: This makes a copy of the object! + + .. code-block:: python + + >>> from beem.price import Price + >>> Price("0.3314 SBD/STEEM").as_base("STEEM") + 3.017483 STEEM/SBD + """ if base == self["base"]["symbol"]: return self.copy() @@ -187,6 +197,13 @@ class Price(dict): """ Returns the price instance so that the quote asset is ``quote``. Note: This makes a copy of the object! + + .. code-block:: python + + >>> from beem.price import Price + >>> Price("0.3314 SBD/STEEM").as_quote("SBD") + 3.017483 STEEM/SBD + """ if quote == self["quote"]["symbol"]: return self.copy() @@ -197,6 +214,13 @@ class Price(dict): def invert(self): """ Invert the price (e.g. go from ``SBD/STEEM`` into ``STEEM/SBD``) + + .. code-block:: python + + >>> from beem.price import Price + >>> Price("0.3314 SBD/STEEM").invert() + 3.017483 STEEM/SBD + """ tmp = self["quote"] self["quote"] = self["base"] diff --git a/beem/steem.py b/beem/steem.py index 47059f5c62a4453d24b9edd203e8353950f36bce..310511ec2971f1ce1f7ae75e9fe247bb0ea27dc5 100644 --- a/beem/steem.py +++ b/beem/steem.py @@ -1337,14 +1337,14 @@ class Steem(object): For the options, you have these defaults::: - { - "author": "", - "permlink": "", - "max_accepted_payout": "1000000.000 SBD", - "percent_steem_dollars": 10000, - "allow_votes": True, - "allow_curation_rewards": True, - } + { + "author": "", + "permlink": "", + "max_accepted_payout": "1000000.000 SBD", + "percent_steem_dollars": 10000, + "allow_votes": True, + "allow_curation_rewards": True, + } """ if not account and config["default_account"]: diff --git a/beemgrapheneapi/graphenerpc.py b/beemgrapheneapi/graphenerpc.py index aae2305233d35f87d6d12ef795d5abc3e2ce505e..e685ef8779f8fb2e61031303eed6594c84689398 100644 --- a/beemgrapheneapi/graphenerpc.py +++ b/beemgrapheneapi/graphenerpc.py @@ -118,13 +118,14 @@ class GrapheneRPC(object): Usage: - .. code-block:: python - from beemgrapheneapi.graphenerpc import GrapheneRPC - ws = GrapheneRPC("wss://steemd.pevo.science","","") - print(ws.get_account_count()) + .. code-block:: python - ws = GrapheneRPC("https://api.steemit.com","","") - print(ws.get_account_count()) + from beemgrapheneapi.graphenerpc import GrapheneRPC + ws = GrapheneRPC("wss://steemd.pevo.science","","") + print(ws.get_account_count()) + + ws = GrapheneRPC("https://api.steemit.com","","") + print(ws.get_account_count()) .. note:: This class allows to call methods available via websocket. If you want to use the notification diff --git a/docs/_static/beem-logo_2.png b/docs/_static/beem-logo_2.png new file mode 100644 index 0000000000000000000000000000000000000000..8488b6e0a5907297726f310b931921175b485691 Binary files /dev/null and b/docs/_static/beem-logo_2.png differ diff --git a/docs/_static/beem-logo_2.svg b/docs/_static/beem-logo_2.svg new file mode 100644 index 0000000000000000000000000000000000000000..014be475f77589ea071c27c3249073fec044372d --- /dev/null +++ b/docs/_static/beem-logo_2.svg @@ -0,0 +1 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 569 569" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="Layer-1" serif:id="Layer 1"><g><path d="M80.075,367.29c34.301,-1.394 157.829,-5.859 157.829,-5.859l-8.818,-24.675c-5.203,-17.054 3.282,-36.78 17.163,-45.714c12.077,-7.774 39.77,-11.502 57.625,-17.877c4.215,-1.505 7.881,-3.157 10.664,-5.044c11.886,-8.06 22.845,-25.031 19.153,-37.134l-17.296,-56.672c-3.869,-12.683 -16.337,-20.847 -31.758,-20.8c-1.745,0.006 -3.512,0.123 -5.25,0.353c-10.213,1.345 -21.077,3.752 -31.414,6.957c-9.773,3.032 -19.242,6.826 -27.38,10.975c-22.66,11.538 -24.282,21.326 -19.308,37.628l6.333,20.754l59.516,-18.156l3.382,11.096l-200.136,103.926c0,0 -4.276,2.032 -7.533,4.021c-2.206,1.347 -3.723,2.821 -3.982,3.067c-4.99,4.732 -5.951,9.425 -5.937,14.408c0.027,8.349 8.127,16.429 13.421,17.917c2.859,0.804 3.17,0.668 5.186,0.794c4.08,0.255 8.54,0.035 8.54,0.035Zm11.104,-11.507c-1.112,0.339 -2.236,0.503 -3.344,0.506c-5.033,0.015 -9.71,-3.28 -11.273,-8.406c-1.915,-6.273 1.528,-12.9 7.697,-14.783c1.097,-0.334 2.208,-0.496 3.305,-0.499c5.042,-0.016 9.761,3.315 11.332,8.468c1.909,6.252 -1.57,12.839 -7.717,14.714Zm130.849,-167.423c1.112,-0.336 2.238,-0.496 3.344,-0.496c5.035,0 9.702,3.31 11.25,8.44c1.893,6.28 -1.568,12.896 -7.744,14.759c-1.097,0.332 -2.21,0.489 -3.305,0.489c-5.042,0 -9.752,-3.344 -11.308,-8.503c-1.889,-6.257 1.609,-12.833 7.763,-14.689Z" style="fill:#314bff;stroke:#7e8eff;stroke-width:1px;"/><path d="M495.37,202.989c9.538,0 16.713,9.037 16.452,18.575c-0.147,5.417 -2.935,11.267 -7.105,14.075c-1.631,1.098 -4.589,2.733 -6.213,3.489c-0.771,0.359 -3.967,2.052 -6.044,2.968c-3.325,1.466 -5.648,2.634 -5.648,2.634l-182.667,93.318l-2.995,1.53l0.971,3.213l2.285,7.552l1.165,3.828l3.862,-1.232l55.64,-16.922l5.685,18.573c3.753,12.438 -2.635,23.578 -18.985,34.171c-18.461,11.975 -35.609,16.228 -57.335,16.228l-0.541,0c-10.804,0 -29.653,-1.314 -34.489,-17.339l-17.114,-55.648c-3.067,-10.164 6.958,-25.578 15.255,-30.96c14.693,-9.532 44.937,-7.888 69.899,-24.513c15.63,-10.41 26.943,-29.476 21.506,-47.502l-7.118,-24.252c0,0 24.027,-0.283 53.047,-0.623c43.964,-0.515 99.388,-1.163 100.089,-1.163l0.398,0Zm-147.688,170.731c-5.768,0.017 -10.458,-4.644 -10.477,-10.411c-0.018,-5.768 4.645,-10.457 10.413,-10.476c5.767,-0.017 10.456,4.644 10.474,10.412c0.017,5.767 -4.643,10.457 -10.41,10.475Zm135.822,-140.57c-5.767,0 -10.442,-4.676 -10.442,-10.443c0,-5.768 4.675,-10.443 10.442,-10.443c2.489,0 4.776,0.871 6.571,2.325c2.363,1.914 3.874,4.839 3.874,8.118c0,5.767 -4.677,10.443 -10.445,10.443Z" style="fill:#ffe531;stroke:#e4c700;stroke-width:1px;"/></g><path d="M367.9,542.179c-25.067,7.738 -52.852,11.805 -82.887,11.668c-0.315,-0.001 -0.631,-0.003 -0.947,-0.006c-45.461,-0.34 -85.019,-10.205 -122.595,-28.296c-33.811,-16.279 -62.302,-40.424 -85.497,-68.515l-13.721,-18.111c-14.942,-21.598 -26.793,-45.512 -35.092,-71.208c-22.225,-68.83 -16.318,-142.193 16.635,-206.579c32.953,-64.384 89.006,-112.084 157.834,-134.309c27.403,-8.849 55.513,-13.237 83.501,-13.237c42.309,0 84.326,10.038 123.077,29.871c64.386,32.953 112.084,89.068 134.31,157.897c22.226,68.828 12.469,149.834 -16.634,206.638c-29.103,56.804 -88.108,112.617 -157.984,134.187Zm186.989,-344.882c-23.293,-72.133 -73.282,-130.877 -140.758,-165.412c-67.477,-34.535 -144.363,-40.725 -216.495,-17.433c-72.133,23.293 -130.877,73.282 -165.412,140.758c-34.535,67.476 -40.727,144.362 -17.434,216.495c23.293,72.132 73.282,130.878 140.759,165.412c0.283,0.145 0.565,0.289 0.848,0.432c40.38,20.502 84.102,30.873 128.138,30.873c29.326,0 58.794,-4.599 87.508,-13.872c72.134,-23.293 130.878,-73.282 165.413,-140.758c34.535,-67.476 40.726,-144.362 17.433,-216.495" style="fill:url(#_Linear1);fill-rule:nonzero;"/></g><defs><linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(567.844,0,0,567.842,0.917694,284.501)"><stop offset="0" style="stop-color:#314bff;stop-opacity:1"/><stop offset="1" style="stop-color:#ffe531;stop-opacity:1"/></linearGradient></defs></svg> \ No newline at end of file diff --git a/docs/_static/beem-logo_bw.png b/docs/_static/beem-logo_bw.png new file mode 100644 index 0000000000000000000000000000000000000000..e986635206f9726afc747131b678c907c2373807 Binary files /dev/null and b/docs/_static/beem-logo_bw.png differ diff --git a/docs/_static/beem-logo_bw.svg b/docs/_static/beem-logo_bw.svg new file mode 100644 index 0000000000000000000000000000000000000000..b4c60997e26aed0dcbf90a45d2c4d7e56c81fc0b --- /dev/null +++ b/docs/_static/beem-logo_bw.svg @@ -0,0 +1 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 1000 1000" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="Layer-1" serif:id="Layer 1"><g><path d="M300.075,443.29c34.301,-1.394 157.829,-5.859 157.829,-5.859l-8.818,-24.675c-5.203,-17.054 3.282,-36.78 17.163,-45.714c12.077,-7.774 39.77,-11.502 57.625,-17.877c4.215,-1.505 7.881,-3.157 10.664,-5.044c11.886,-8.06 22.845,-25.031 19.153,-37.134l-17.296,-56.672c-3.869,-12.683 -16.337,-20.847 -31.758,-20.8c-1.745,0.006 -3.512,0.123 -5.25,0.353c-10.213,1.345 -21.077,3.752 -31.414,6.957c-9.773,3.032 -19.242,6.826 -27.38,10.975c-22.66,11.538 -24.282,21.326 -19.308,37.628l6.333,20.754l59.516,-18.156l3.382,11.096l-200.136,103.926c0,0 -4.276,2.032 -7.533,4.021c-2.206,1.347 -3.723,2.821 -3.982,3.067c-4.99,4.732 -5.951,9.425 -5.937,14.408c0.027,8.349 8.127,16.429 13.421,17.917c2.859,0.804 3.17,0.668 5.186,0.794c4.08,0.255 8.54,0.035 8.54,0.035Zm11.104,-11.507c-1.112,0.339 -2.236,0.503 -3.344,0.506c-5.033,0.015 -9.71,-3.28 -11.273,-8.406c-1.915,-6.273 1.528,-12.9 7.697,-14.783c1.097,-0.334 2.208,-0.496 3.305,-0.499c5.042,-0.016 9.761,3.315 11.332,8.468c1.909,6.252 -1.57,12.839 -7.717,14.714Zm130.849,-167.423c1.112,-0.336 2.238,-0.496 3.344,-0.496c5.035,0 9.702,3.31 11.25,8.44c1.893,6.28 -1.568,12.896 -7.744,14.759c-1.097,0.332 -2.21,0.489 -3.305,0.489c-5.042,0 -9.752,-3.344 -11.308,-8.503c-1.889,-6.257 1.609,-12.833 7.763,-14.689Z"/><path d="M715.37,278.989c9.538,0 16.713,9.037 16.452,18.575c-0.147,5.417 -2.935,11.267 -7.105,14.075c-1.631,1.098 -4.589,2.733 -6.213,3.489c-0.771,0.359 -3.967,2.052 -6.044,2.968c-3.325,1.466 -5.648,2.634 -5.648,2.634l-182.667,93.318l-2.995,1.53l0.971,3.213l2.285,7.552l1.165,3.828l3.862,-1.232l55.64,-16.922l5.685,18.573c3.753,12.438 -2.635,23.578 -18.985,34.171c-18.461,11.975 -35.609,16.228 -57.335,16.228l-0.541,0c-10.804,0 -29.653,-1.314 -34.489,-17.339l-17.114,-55.648c-3.067,-10.164 6.958,-25.578 15.255,-30.96c14.693,-9.532 44.937,-7.888 69.899,-24.513c15.63,-10.41 26.943,-29.476 21.506,-47.502l-7.118,-24.252c0,0 24.027,-0.283 53.047,-0.623c43.964,-0.515 99.388,-1.163 100.089,-1.163l0.398,0Zm-147.688,170.731c-5.768,0.017 -10.458,-4.644 -10.477,-10.411c-0.018,-5.768 4.645,-10.457 10.413,-10.476c5.767,-0.017 10.456,4.644 10.474,10.412c0.017,5.767 -4.643,10.457 -10.41,10.475Zm135.822,-140.57c-5.767,0 -10.442,-4.676 -10.442,-10.443c0,-5.768 4.675,-10.443 10.442,-10.443c2.489,0 4.776,0.871 6.571,2.325c2.363,1.914 3.874,4.839 3.874,8.118c0,5.767 -4.677,10.443 -10.445,10.443Z"/></g><path d="M324.787,830.39c0,-18.921 -15.498,-29.79 -42.671,-29.79l-48.91,0l0,60.183l48.91,0c27.173,0.201 42.671,-10.87 42.671,-30.393m-7.044,-66.02c0,-17.511 -13.083,-27.575 -35.627,-27.575l-48.91,0l0,55.553l48.91,0c22.544,0 35.627,-10.064 35.627,-27.978m8.453,-1.006c0,17.31 -9.862,29.185 -27.173,32.406c21.739,2.616 34.218,15.9 34.218,35.626c0,23.952 -18.719,37.841 -50.52,37.841l-57.969,0l0,-140.695l57.565,0c27.575,0 43.879,12.882 43.879,34.822" style="fill-rule:nonzero;"/><path d="M461.455,728.542l0,8.253l-82.322,0l0,56.156l73.265,0l0,8.454l-73.265,0l0,59.578l84.939,0l0,8.253l-93.393,0l0,-140.694l90.776,0Z" style="fill-rule:nonzero;"/><path d="M591.683,728.542l0,8.253l-82.322,0l0,56.156l73.265,0l0,8.454l-73.265,0l0,59.578l84.939,0l0,8.253l-93.393,0l0,-140.694l90.776,0Z" style="fill-rule:nonzero;"/><path d="M638.78,728.542l56.56,110.703l56.157,-110.703l11.674,0l0,140.694l-8.051,0l-0.201,-129.019l-57.768,113.722l-3.824,0l-58.17,-113.722l0,129.019l-8.051,0l0,-140.694l11.674,0Z" style="fill-rule:nonzero;"/></g></svg> \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index b655ad22a877ed68ca4c409c8f97247b09d19b61..411a7b3ade4adc60dc2f3d4171181b5fd7e23494 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -31,7 +31,7 @@ sys.path.insert(0, os.path.abspath('../scripts/')) # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ["sphinx.ext.autodoc"] +extensions = ["sphinx.ext.autodoc", "sphinx.ext.doctest"] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -129,7 +129,7 @@ html_theme = 'sphinx_rtd_theme' # The name of an image file (relative to this directory) to place at the top # of the sidebar. -html_logo = '_static/beem-logo.png' +html_logo = '_static/beem-logo_2.svg' # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 @@ -269,7 +269,7 @@ man_pages = [ # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'beem', 'beem Documentation', - author, 'beem', 'One line description of project.', + author, 'beem', 'python library for steem', 'Miscellaneous'), ] diff --git a/docs/quickstart.rst b/docs/quickstart.rst index b2cb28e16458e58e019e8d2b73a849c59372ebe4..3c529d4d47956a4d2f267267db2e23fa9c762b4c 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -32,7 +32,8 @@ By creating this object different options can be set. Wallet and Keys --------------- -Each account has a: +Each account has the following keys: + * Posting key (allows accounts to post, vote, edit, resteem and follow/mute) * Active key (allows accounts to transfer, power up/down, voting for witness, ...) * Memo key (Can be used to encrypt/decrypt memos)