diff --git a/beem/account.py b/beem/account.py index b8d604d06591271bcdb6716f01bd43acc8c73349..645b5a1cfdda6f10dcef2a0b89dcddc6a00d48e0 100644 --- a/beem/account.py +++ b/beem/account.py @@ -521,7 +521,7 @@ class Account(BlockchainObject): :param float voting_power_goal: voting power goal in percentage (default is 100) :param float starting_voting_power: returns recharge time if current voting power is - the provided value. + the provided value. """ remainingTime = self.get_recharge_timedelta(voting_power_goal=voting_power_goal, starting_voting_power=starting_voting_power) @@ -532,7 +532,7 @@ class Account(BlockchainObject): :param float voting_power_goal: voting power goal in percentage (default is 100) :param float starting_voting_power: returns recharge time if current voting power is - the provided value. + the provided value. """ if starting_voting_power is None: @@ -551,7 +551,7 @@ class Account(BlockchainObject): :param float voting_power_goal: voting power goal in percentage (default is 100) :param float starting_voting_power: returns recharge time if current voting power is - the provided value. + the provided value. """ return addTzInfo(datetime.utcnow()) + self.get_recharge_timedelta(voting_power_goal, starting_voting_power) @@ -1337,7 +1337,7 @@ class Account(BlockchainObject): def get_expiring_vesting_delegations(self, after=None, limit=1000, account=None): """ Returns the expirations for vesting delegations. - :param datetime after : expiration after (only for pre appbase nodes) + :param datetime after: expiration after (only for pre appbase nodes) :param int limit: limits number of shown entries (only for pre appbase nodes) :param str account: When set, a different account is used for the request (Default is object account name) @@ -1622,7 +1622,8 @@ class Account(BlockchainObject): :param bool raw_output: if False, the output is a dict, which includes all values. Otherwise, the output is list. - ... note:: + .. note:: + only_ops and exclude_ops takes an array of strings: The full list of operation ID's can be found in beembase.operationids.ops. @@ -1725,7 +1726,7 @@ class Account(BlockchainObject): :param bool raw_output: if False, the output is a dict, which includes all values. Otherwise, the output is list. - ... note:: + .. note:: only_ops and exclude_ops takes an array of strings: The full list of operation ID's can be found in beembase.operationids.ops. @@ -1887,7 +1888,7 @@ class Account(BlockchainObject): :param bool raw_output: if False, the output is a dict, which includes all values. Otherwise, the output is list. - ... note:: + .. note:: only_ops and exclude_ops takes an array of strings: The full list of operation ID's can be found in beembase.operationids.ops. @@ -2264,7 +2265,8 @@ class Account(BlockchainObject): if not ``default_account`` - transfer example: + Transfer example: + .. code-block:: python from beem.account import Account diff --git a/beem/blockchain.py b/beem/blockchain.py index 0c7a9613e22c3d194b6bfb770c5d74d03e6b23cc..ab36fca04cfb2055eab7ce313457f4d1b408035d 100644 --- a/beem/blockchain.py +++ b/beem/blockchain.py @@ -764,6 +764,7 @@ class Blockchain(object): def awaitTxConfirmation(self, transaction, limit=10): """ Returns the transaction as seen by the blockchain after being included into a block + :param dict transaction: transaction to wait for :param int limit: (optional) number of blocks to wait for the transaction (default: 10) diff --git a/beem/comment.py b/beem/comment.py index 31502a8e764ebabc51525586acc3d278d73c36f5..917ba8dc2ef9b714bae5a17f820b8da8621f4eac 100644 --- a/beem/comment.py +++ b/beem/comment.py @@ -415,7 +415,7 @@ class Comment(BlockchainObject): def get_author_rewards(self): """ Returns the author rewards. - Example::: + Example:: { 'pending_rewards': True, @@ -463,7 +463,7 @@ class Comment(BlockchainObject): amount of curation_rewards that goes to the author (self-vote or votes within the first 30 minutes). `active_votes` contains all voter with their curation reward. - Example::: + Example:: { 'pending_rewards': True, 'unclaimed_rewards': 0.245 STEEM, diff --git a/beem/discussions.py b/beem/discussions.py index f91241f175b3e5e50757a810a81a9946867bad24..f78a661177ec87420ddf3e39a05bc7c77abed481 100644 --- a/beem/discussions.py +++ b/beem/discussions.py @@ -227,6 +227,7 @@ class Discussions_by_author_before_date(list): :param beem.steem.Steem steem_instance: Steem instance .. testcode:: + from beem.discussions import Query, Discussions_by_author_before_date for h in Discussions_by_author_before_date(limit=10, author="gtg"): print(h) diff --git a/beem/market.py b/beem/market.py index 776b92d5ccdbd5ae96acef395e081bf9a739dcc0..383ad187a3bee91904c40a1cab41fbf37e971560 100644 --- a/beem/market.py +++ b/beem/market.py @@ -197,10 +197,12 @@ class Market(dict): def orderbook(self, limit=25, raw_data=False): """ Returns the order book for SBD/STEEM market. + :param int limit: Limit the amount of orders (default: 25) Sample output (raw_data=False): - .. code-block:: js + + .. code-block:: none { 'asks': [ @@ -222,6 +224,7 @@ class Market(dict): } Sample output (raw_data=True): + .. code-block:: js { @@ -281,7 +284,7 @@ class Market(dict): Sample output (raw_data=False): - .. code-block:: js + .. code-block:: none [ (2018-04-30 21:00:54+00:00) 0.267 STEEM 0.323 SBD @ 1.209738 SBD/STEEM, @@ -417,6 +420,7 @@ class Market(dict): :param bool raw_data: (optional) returns raw data if set True Example: + .. code-block:: js { diff --git a/beem/message.py b/beem/message.py index d6e8086f45376a22ad31da9d51ecb966d2257886..c0ff17ab2a10b25b77273006a6b61bd0bc691dae 100644 --- a/beem/message.py +++ b/beem/message.py @@ -100,7 +100,7 @@ class Message(object): :returns: True if the message is verified successfully - :raises: InvalidMessageSignature if the signature is not ok + :raises InvalidMessageSignature: if the signature is not ok """ # Split message into its parts diff --git a/beem/nodelist.py b/beem/nodelist.py index f0a82927eaf4985da96f732391b5fed4fabe4f83..77c706474a3af7c5234540b93e6a24ce67e364d4 100644 --- a/beem/nodelist.py +++ b/beem/nodelist.py @@ -265,6 +265,7 @@ class NodeList(list): :params list/dict weight: can be used to weight the different benchmarks .. code-block:: python + from beem.nodelist import NodeList nl = NodeList() weights = [0, 0.1, 0.2, 1] diff --git a/beem/steem.py b/beem/steem.py index 545a95f42b3b4e5d77f5114894b16c4761f52a52..97692157eae9e4cf2c6bee5b6b357a080b18aedf 100644 --- a/beem/steem.py +++ b/beem/steem.py @@ -358,8 +358,9 @@ class Steem(object): def get_current_median_history(self, use_stored_data=True): """ Returns the current median price + :param bool use_stored_data: if True, stored data will be returned. If stored data are - empty or old, refresh_data() is used. + empty or old, refresh_data() is used. """ if use_stored_data: self.refresh_data() @@ -379,8 +380,9 @@ class Steem(object): def get_hardfork_properties(self, use_stored_data=True): """ Returns Hardfork and live_time of the hardfork + :param bool use_stored_data: if True, stored data will be returned. If stored data are - empty or old, refresh_data() is used. + empty or old, refresh_data() is used. """ if use_stored_data: self.refresh_data() @@ -398,8 +400,9 @@ class Steem(object): def get_network(self, use_stored_data=True): """ Identify the network + :param bool use_stored_data: if True, stored data will be returned. If stored data are - empty or old, refresh_data() is used. + empty or old, refresh_data() is used. :returns: Network parameters :rtype: dict @@ -573,10 +576,12 @@ class Steem(object): def sp_to_sbd(self, sp, voting_power=STEEM_100_PERCENT, vote_pct=STEEM_100_PERCENT, not_broadcasted_vote=True, use_stored_data=True): """ Obtain the resulting SBD vote value from Steem power + :param number steem_power: Steem Power :param int voting_power: voting power (100% = 10000) :param int vote_pct: voting percentage (100% = 10000) :param bool not_broadcasted_vote: not_broadcasted or already broadcasted vote (True = not_broadcasted vote). + Only impactful for very big votes. Slight modification to the value calculation, as the not_broadcasted vote rshares decreases the reward pool. """ @@ -585,10 +590,12 @@ class Steem(object): def vests_to_sbd(self, vests, voting_power=STEEM_100_PERCENT, vote_pct=STEEM_100_PERCENT, not_broadcasted_vote=True, use_stored_data=True): """ Obtain the resulting SBD vote value from vests + :param number vests: vesting shares :param int voting_power: voting power (100% = 10000) :param int vote_pct: voting percentage (100% = 10000) :param bool not_broadcasted_vote: not_broadcasted or already broadcasted vote (True = not_broadcasted vote). + Only impactful for very big votes. Slight modification to the value calculation, as the not_broadcasted vote rshares decreases the reward pool. """ diff --git a/beem/steemconnect.py b/beem/steemconnect.py index 075751495df5604b90f67551b3134b98cc405184..d385623078b79c65663ef28a0e3e856b9542904e 100644 --- a/beem/steemconnect.py +++ b/beem/steemconnect.py @@ -37,6 +37,7 @@ class SteemConnect(object): post.upvote(voter="test") # replace "test" with your account Examples for creating steemconnect v2 urls for broadcasting in browser: + .. testoutput:: from beem import Steem diff --git a/beem/storage.py b/beem/storage.py index de7c0062b9889d998c2f1849d6ef74b3cbb46e2f..8a6c76589bef550d15bde78af2e86f361f41b413 100644 --- a/beem/storage.py +++ b/beem/storage.py @@ -194,8 +194,8 @@ class Key(DataDir): return [] def getPrivateKeyForPublicKey(self, pub): - """ Returns the (possibly encrypted) private key that - corresponds to a public key + """Returns the (possibly encrypted) private key that + corresponds to a public key :param str pub: Public key @@ -224,8 +224,8 @@ class Key(DataDir): connection.commit() def add(self, wif, pub): - """ Add a new public/private key pair (correspondence has to be - checked elsewhere!) + """Add a new public/private key pair (correspondence has to be + checked elsewhere!) :param str pub: Public key :param str wif: Private key @@ -317,8 +317,8 @@ class Token(DataDir): return [] def getTokenForPublicName(self, name): - """ Returns the (possibly encrypted) private token that - corresponds to a public name + """Returns the (possibly encrypted) private token that + corresponds to a public name :param str pub: Public name @@ -347,8 +347,8 @@ class Token(DataDir): connection.commit() def add(self, name, token): - """ Add a new public/private token pair (correspondence has to be - checked elsewhere!) + """Add a new public/private token pair (correspondence has to be + checked elsewhere!) :param str name: Public name :param str token: Private token diff --git a/beem/wallet.py b/beem/wallet.py index 826da59f0dccb3d6b4b76fd62adabb782b8fea99..acf99b1c3f5f9b4c2bfe8ec4f9f9ad17f1e4a7a6 100644 --- a/beem/wallet.py +++ b/beem/wallet.py @@ -256,12 +256,16 @@ class Wallet(object): return False def create(self, pwd): - """ Alias for newWallet() + """ Alias for :func:`newWallet` + + :param str pwd: Passphrase for the created wallet """ self.newWallet(pwd) def newWallet(self, pwd): """ Create a new wallet database + + :param str pwd: Passphrase for the created wallet """ if self.created(): raise WalletExists("You already have created a wallet!") @@ -602,7 +606,7 @@ class Wallet(object): Note: this returns only the first account with the given key. To get all accounts associated with a given public key, use - ``getAccountsFromPublicKey``. + :func:`getAccountsFromPublicKey`. """ names = list(self.getAccountsFromPublicKey(pub)) if not names: @@ -649,6 +653,7 @@ class Wallet(object): """ Get key type :param beem.account.Account/dict account: Account data + :type account: Account, dict :param str pub: Public key """ diff --git a/beem/witness.py b/beem/witness.py index 810e89c01abb7d2a90f7969460b7bded72ffc311..32cdf87c46c8a358c70aa2299e0d099277c8173b 100644 --- a/beem/witness.py +++ b/beem/witness.py @@ -120,11 +120,12 @@ class Witness(BlockchainObject): quote=None, account=None): """ Publish a feed price as a witness. + :param float base: USD Price of STEEM in SBD (implied price) :param float quote: (optional) Quote Price. Should be 1.000 (default), unless - we are adjusting the feed to support the peg. + we are adjusting the feed to support the peg. :param str account: (optional) the source account for the transfer - if not self["owner"] + if not self["owner"] """ quote = quote if quote is not None else "1.000 %s" % (self.steem.steem_symbol) if not account: diff --git a/beemgraphenebase/account.py b/beemgraphenebase/account.py index 391939f1ac2d7918fcf6833f6460bb6cfd7ef024..d4f24def9623be763a498d2869eb008bda114782 100644 --- a/beemgraphenebase/account.py +++ b/beemgraphenebase/account.py @@ -252,7 +252,7 @@ class PublicKey(Address): :param str pk: Base58 encoded public key :param str prefix: Network prefix (defaults to ``STM``) - Example::: + Example:: PublicKey("STM6UtYWWs3rkZGV8JA86qrgkG6tyFksgECefKE1MiH4HkLD8PFGL") @@ -343,7 +343,7 @@ class PrivateKey(PublicKey): :param str wif: Base58check-encoded wif key :param str prefix: Network prefix (defaults to ``STM``) - Example::: + Example:: PrivateKey("5HqUkGuo62BfcJU5vNhTXKJRXuUi9QSE6jp8C3uBJ2BVHtB8WSd") diff --git a/beemgraphenebase/base58.py b/beemgraphenebase/base58.py index c090bd0184b53425d3a17be829ea59c656c99186..297ce53092774a0555a4bcc6fcfa869cd46a0086 100644 --- a/beemgraphenebase/base58.py +++ b/beemgraphenebase/base58.py @@ -52,7 +52,8 @@ class Base58(object): * ``bytes(Base58)``: Returns the raw data * ``str(Base58)``: Returns the readable ``Base58CheckEncoded`` data. * ``repr(Base58)``: Gives the hex representation of the data. - * ``format(Base58,_format)`` Formats the instance according to ``_format``: + * ``format(Base58,_format)``: Formats the instance according to ``_format`` + * ``"btc"``: prefixed with ``0x80``. Yields a valid btc address * ``"wif"``: prefixed with ``0x00``. Yields a valid wif key * ``"bts"``: prefixed with ``BTS`` diff --git a/docs/contribute.rst b/docs/contribute.rst index cfc6a52ee217f6b12439bfa96ae7fee515cd4a4c..29410ea52378d4cea8c2a326075ba005f51e6acf 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -22,7 +22,7 @@ to understand is that: How to Contribute ----------------- -0. Familiarize yourself with `contributing on github <https://guides.github.com/activities/contributing-to-open-source/>` +0. Familiarize yourself with `contributing on github <https://guides.github.com/activities/contributing-to-open-source/>`_ 1. Fork or branch from the master. 2. Create commits following the commit style 3. Start a pull request to the master branch