diff --git a/README.rst b/README.rst index 63217220efe57c3294cc57e7b51a0dfd0ff6cbaa..ad7bc6429b273344090bb3a0b45cd48131bb6f9a 100644 --- a/README.rst +++ b/README.rst @@ -11,13 +11,13 @@ The library name is derived from a beam maschine, similar to the analogy between .. image:: https://img.shields.io/pypi/pyversions/beem.svg :target: https://pypi.python.org/pypi/beem/ :alt: Python Versions - -.. image:: https://anaconda.org/conda-forge/beem/badges/version.svg + +.. image:: https://anaconda.org/conda-forge/beem/badges/version.svg :target: https://anaconda.org/conda-forge/beem - -.. image:: https://anaconda.org/conda-forge/beem/badges/downloads.svg + +.. image:: https://anaconda.org/conda-forge/beem/badges/downloads.svg :target: https://anaconda.org/conda-forge/beem @@ -36,7 +36,7 @@ Current build status .. image:: https://readthedocs.org/projects/beem/badge/?version=latest :target: http://beem.readthedocs.org/en/latest/?badge=latest -.. image:: https://api.codacy.com/project/badge/Grade/e5476faf97df4c658697b8e7a7efebd7 +.. image:: https://api.codacy.com/project/badge/Grade/e5476faf97df4c658697b8e7a7efebd7 :target: https://www.codacy.com/app/holgern/beem?utm_source=github.com&utm_medium=referral&utm_content=holgern/beem&utm_campaign=Badge_Grade .. image:: https://pyup.io/repos/github/holgern/beem/shield.svg @@ -68,7 +68,7 @@ Advantages over the official steem-python library * Contains all broadcast operations * Estimation of virtual account operation index from date or block number * the command line tool beempy uses click and has more commands -* SteemNodeRPC can be used to excecute even not implemented RPC-Calls +* SteemNodeRPC can be used to execute even not implemented RPC-Calls * More complete implemention Installation @@ -78,7 +78,7 @@ The minimal working python version is 2.7.x. or 3.4.x beem can be installed parallel to python-steem. For Debian and Ubuntu, please ensure that the following packages are installed: - + .. code:: bash sudo apt-get install build-essential libssl-dev python-dev @@ -106,32 +106,32 @@ Signing and Verify can be fasten (200 %) by installing cryptography: .. code:: bash pip install -U cryptography - + Install beem by pip:: pip install -U beem - + You can install beem from this repository if you want the latest but possibly non-compiling version:: git clone https://github.com/holgern/beem.git cd beem python setup.py build - + python setup.py install --user Run tests after install:: pytest - - + + Installing beem with conda-forge -------------------------------- Installing beem from the conda-forge channel can be achieved by adding conda-forge to your channels with:: conda config --add channels conda-forge - + Once the conda-forge channel has been enabled, beem can be installed with:: conda install beem @@ -139,7 +139,7 @@ Once the conda-forge channel has been enabled, beem can be installed with:: Signing and Verify can be fasten (200 %) by installing cryptography:: conda install cryptography - + CLI tool beempy --------------- @@ -228,7 +228,7 @@ Changelog ------- * get_feed_entries, get_blog_authors, get_savings_withdrawals, get_escrow, verify_account_authority, get_expiring_vesting_delegations, get_vesting_delegations, get_tags_used_by_author added to Account * get_account_reputations, get_account_count added to Blockchain -* Replies_by_last_update, Trending_tags, Discussions_by_author_before_date +* Replies_by_last_update, Trending_tags, Discussions_by_author_before_date * ImageUploader class added * Score calculation improved in update_nodes * apidefinitions added to docs, which includes a complete condenser API call list. @@ -237,7 +237,7 @@ Changelog ------- * Bug fixes * Bool variables for SteemConnect link creation fixed -* Account handling in beem.account is improved +* Account handling in beem.account is improved * json_metadata property added to beem.account * missing addTzInfo added to beem.blockchain * json_metadata update for comment edit improved @@ -397,7 +397,7 @@ Changelog 0.19.23 ------- -* new function for beempy added: power, follower, following, muter, muting, mute, nextnode, pingnode, currentnode +* new function for beempy added: power, follower, following, muter, muting, mute, nextnode, pingnode, currentnode * support for read-only systems added * more unit tests * Several improvements and bug fixes @@ -540,7 +540,7 @@ Changelog 0.19.1 ------ -* Imported from https://github.com/xeroc/python-bitshares +* Imported from https://github.com/xeroc/python-bitshares * Replaced all BitShares by Steem * Flake8 fixed * Unit tests are working diff --git a/beem/account.py b/beem/account.py index 7f11859997836216d5780fa75e44f74665d2711f..8fbe7eb4435fc500d126b6b10ed7736ea8dc4abb 100644 --- a/beem/account.py +++ b/beem/account.py @@ -1320,7 +1320,7 @@ class Account(BlockchainObject): if latest_blocknum - created == 0: return 0 - # set inital search range + # set initial search range op_num = 0 op_lower = 0 block_lower = created diff --git a/beem/blockchain.py b/beem/blockchain.py index c903d0be81540f3612067b2d4ffc7e410b479ac3..a2828f5421c7ec89e758f57e0e215406dee295e9 100644 --- a/beem/blockchain.py +++ b/beem/blockchain.py @@ -407,8 +407,6 @@ class Blockchain(object): # We are going to loop indefinitely latest_block = 0 while True: - - # Get chain properies to identify the if stop: head_block = stop else: @@ -615,7 +613,7 @@ class Blockchain(object): :param dict add_to_ops_stat: if set, the result is added to add_to_ops_stat :param bool verbose: if True, the current block number and timestamp is printed - This call returns a dict with all possible operations and their occurence. + This call returns a dict with all possible operations and their occurrence. """ if add_to_ops_stat is None: @@ -659,7 +657,7 @@ class Blockchain(object): The dict output is formated such that ``type`` carries the operation type. Timestamp and block_num are taken from the block the operation was stored in and the other keys depend - on the actualy operation. + on the actual operation. .. note:: If you want instant confirmation, you need to instantiate class:`beem.blockchain.Blockchain` with diff --git a/beem/blockchainobject.py b/beem/blockchainobject.py index b280f1d8dad632c08987d32a833bc5a37fa7deac..d58e1c104240965ae2ab2afff6a1cd4f42275cca 100644 --- a/beem/blockchainobject.py +++ b/beem/blockchainobject.py @@ -128,7 +128,7 @@ class BlockchainObject(dict): self.identifier = data.get(self.id_item) super(BlockchainObject, self).__init__(data) elif isinstance(data, integer_types): - # This is only for block number bascially + # This is only for block number basically self.identifier = data if not lazy and not self.cached: self.refresh() diff --git a/beem/cli.py b/beem/cli.py index 7da02b3c5f3c296ddf2574d79d7596c907f4b6c8..d24292d310f7843d49a628fdf6562da4511162d2 100644 --- a/beem/cli.py +++ b/beem/cli.py @@ -505,7 +505,7 @@ def walletinfo(test_unlock): t.add_row(["keyring installed", "no"]) if test_unlock: if unlock_wallet(stm): - t.add_row(["Wallet unlock", "sucessful"]) + t.add_row(["Wallet unlock", "successful"]) else: t.add_row(["Wallet unlock", "not working"]) # t.add_row(["getPublicKeys", str(stm.wallet.getPublicKeys())]) @@ -2148,7 +2148,7 @@ def votes(account, direction, outgoing, incoming, days, export): @click.option('--min-vote', '-v', help='Show only votes higher than the given value') @click.option('--max-vote', '-w', help='Show only votes lower than the given value') @click.option('--min-performance', '-x', help='Show only votes with performance higher than the given value') -@click.option('--max-performance', '-y', help='Show only votes with perfromance lower than the given value') +@click.option('--max-performance', '-y', help='Show only votes with performance lower than the given value') @click.option('--payout', default=None, help="Show the curation for a potential payout in SBD as float") @click.option('--export', '-e', default=None, help="Export results to HTML-file") @click.option('--short', '-s', is_flag=True, default=False, help="Show only Curation without sum") diff --git a/beem/comment.py b/beem/comment.py index 24b044d5ca1723f3557cbaa25821434b459ea415..4403a86da9a05fa0e65717bc9ad9b12d0cacc775 100644 --- a/beem/comment.py +++ b/beem/comment.py @@ -259,12 +259,12 @@ class Comment(BlockchainObject): return {} def is_main_post(self): - """ Retuns True if main post, and False if this is a comment (reply). + """ Returns True if main post, and False if this is a comment (reply). """ return self['depth'] == 0 def is_comment(self): - """ Retuns True if post is a comment + """ Returns True if post is a comment """ return self['depth'] > 0 diff --git a/beem/imageuploader.py b/beem/imageuploader.py index 3009bf8c0c24e96864c33f1be299f62c4896f2c1..fac6808cdec06924411b655acdc163e3c8b48c7f 100644 --- a/beem/imageuploader.py +++ b/beem/imageuploader.py @@ -21,10 +21,10 @@ class ImageUploader(object): def __init__( self, base_url="https://steemitimages.com", - challange="ImageSigningChallenge", + challenge="ImageSigningChallenge", steem_instance=None, ): - self.challange = challange + self.challenge = challenge self.base_url = base_url self.steem = steem_instance or shared_steem_instance() @@ -59,7 +59,7 @@ class ImageUploader(object): else: image_data = image - message = py23_bytes(self.challange, "ascii") + image_data + message = py23_bytes(self.challenge, "ascii") + image_data signature = sign_message(message, posting_wif) signature_in_hex = hexlify(signature).decode("ascii") diff --git a/beem/market.py b/beem/market.py index fb58322fc2e2a6384225b699237979e068587d13..776b92d5ccdbd5ae96acef395e081bf9a739dcc0 100644 --- a/beem/market.py +++ b/beem/market.py @@ -326,7 +326,7 @@ class Market(dict): intervall times to reduce the call duration time. E.g. it is possible to receive the trades from the last 7 days, by fetching 100 trades each 6 hours. - When intervall is set to None, all trades are recieved between start and stop. + When intervall is set to None, all trades are received between start and stop. This can take a while. :param datetime start: Start date diff --git a/beem/nodelist.py b/beem/nodelist.py index 09903146f185dfb3828e5f2c76f0c4e5782de9f9..9c5e8f2640591c5cef8c0b51df73aae7c189bf47 100644 --- a/beem/nodelist.py +++ b/beem/nodelist.py @@ -300,8 +300,8 @@ class NodeList(list): if not result["ok"]: rank = max_score + 1 score = (max_score - rank) / (max_score - 1) * 100 - weigthed_score = score * weights_dict[benchmark] - scores.append(weigthed_score) + weighted_score = score * weights_dict[benchmark] + scores.append(weighted_score) sum_score = 0 for score in scores: sum_score += score diff --git a/beem/price.py b/beem/price.py index 5e28b5b962248dfd34ad3c85e42042e7b580f827..6b7dffd2803c73678cab2b329792158edb5ad019 100644 --- a/beem/price.py +++ b/beem/price.py @@ -449,7 +449,7 @@ class Order(Price): elif isinstance(base, Amount) and isinstance(quote, Amount): super(Order, self).__init__(None, base=base, quote=quote) else: - raise ValueError("Unkown format to load Order") + raise ValueError("Unknown format to load Order") def __repr__(self): if "deleted" in self and self["deleted"]: diff --git a/beem/transactionbuilder.py b/beem/transactionbuilder.py index b94f92c5637193efed30ea344c541df2fb013606..fa5b1f3812862e6a2256a31f5841a3f918839860 100644 --- a/beem/transactionbuilder.py +++ b/beem/transactionbuilder.py @@ -367,7 +367,7 @@ class TransactionBuilder(dict): Returns the signed transaction and clears itself after broadast - Clears itself when broadcast was not sucessfully. + Clears itself when broadcast was not successfully. :param int max_block_age: paramerter only used for appbase ready nodes diff --git a/beem/utils.py b/beem/utils.py index 81ad5d58530842a5aae6cb713a7b308cd2e8a57c..385090d71d124e46e437d9357bacc855e0ff219d 100644 --- a/beem/utils.py +++ b/beem/utils.py @@ -45,7 +45,7 @@ def formatTimeString(t): def formatToTimeStamp(t): - """ Retuns a timestamp integer + """ Returns a timestamp integer :param datetime t: datetime object :return: Timestamp as integer diff --git a/beemapi/graphenerpc.py b/beemapi/graphenerpc.py index b35a164c2fcc9dadfd25c059778e32f68b300b55..106ec5ad338d92cd8a4477eb6c67aaaefe1d5163 100644 --- a/beemapi/graphenerpc.py +++ b/beemapi/graphenerpc.py @@ -225,7 +225,7 @@ class GrapheneRPC(object): self.current_rpc = self.rpc_methods['appbase'] props = self.get_config(api="database") if props is None: - raise RPCError("Could not recieve answer for get_config") + raise RPCError("Could not receive answer for get_config") if is_network_appbase_ready(props): if self.ws: self.current_rpc = self.rpc_methods["wsappbase"] diff --git a/beemapi/websocket.py b/beemapi/websocket.py index 998e35cfb4a888f1f232930f55e4a4b8720c5aa8..12c5816322d302862b62cb9f807af69f2a5cc986 100644 --- a/beemapi/websocket.py +++ b/beemapi/websocket.py @@ -78,7 +78,7 @@ class SteemWebsocket(Events): self.only_block_id = only_block_id self.nodes = Nodes(urls, num_retries, 5) - # Instanciate Events + # Instantiate Events Events.__init__(self) self.events = Events() diff --git a/beemgraphenebase/base58.py b/beemgraphenebase/base58.py index 605695c0afd8e8429db5434f552e83b15795d99a..461ea6788f848fe907a4b922cb49ea0aedda9901 100644 --- a/beemgraphenebase/base58.py +++ b/beemgraphenebase/base58.py @@ -86,7 +86,7 @@ class Base58(object): elif _format.upper() in known_prefixes: return _format.upper() + str(self) else: - log.warn("Format %s unkown. You've been warned!\n" % _format) + log.warn("Format %s unknown. You've been warned!\n" % _format) return _format.upper() + str(self) def __repr__(self): diff --git a/docs/cli.rst b/docs/cli.rst index 09f1f86183af25afe14fbacb39498b4c1e64812b..bb729bc35049a7dff1b13e51d315b64309c8043d 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -20,7 +20,7 @@ You can change the password via `changewalletpassphrase` command. From this point on, every time an action requires your private keys, you will be prompted ot enter this password (from CLI as well as while using `steem` library). -To bypass password entry, you can set an environmnet variable ``UNLOCK``. +To bypass password entry, you can set an environment variable ``UNLOCK``. :: @@ -105,7 +105,7 @@ You can see all available commands with ``beempy --help`` ~ % beempy --help Usage: cli.py [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]... - + Options: -n, --node TEXT URL for public Steem API (e.g. https://api.steemit.com) @@ -118,7 +118,7 @@ You can see all available commands with ``beempy --help`` -v, --verbose INTEGER Verbosity --version Show the version and exit. --help Show this message and exit. - + Commands: addkey Add key to wallet When no [OPTION] is given,... allow Allow an account/key to interact with your... @@ -177,6 +177,3 @@ You can see all available commands with ``beempy --help`` witnesscreate Create a witness witnesses List witnesses witnessupdate Change witness properties - - - diff --git a/docs/tutorials.rst b/docs/tutorials.rst index e7f5b96215fc4ec8a083e4dbed0618790ef32046..761ec49193db4124afe2271c5f27ef9945958e61 100644 --- a/docs/tutorials.rst +++ b/docs/tutorials.rst @@ -36,7 +36,7 @@ one comment operation from each sender. # Account and Comment will use now stm account = Account("test") - # Post + # Post c = Comment("@gtg/witness-gtg-log") account.transfer("test1", 1, "STEEM") @@ -122,12 +122,12 @@ Simple Sell Script from beem.market import Market from beem.price import Price from beem.amount import Amount - + # Only for testing not a real working key wif = "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3" - + # - # Instanciate Steem (pick network via API node) + # Instantiate Steem (pick network via API node) # steem = Steem( nobroadcast=True, # <<--- set this to False when you want to fire! @@ -179,7 +179,7 @@ Sell at a timely rate if __name__ == "__main__": # - # Instanciate Steem (pick network via API node) + # Instantiate Steem (pick network via API node) # steem = Steem( nobroadcast=True, # <<--- set this to False when you want to fire! @@ -235,7 +235,7 @@ Lets calculate the curation reward from the last 7 days: from datetime import datetime, timedelta from beem.account import Account from beem.amount import Amount - + acc = Account("gtg") stop = datetime.utcnow() - timedelta(days=7) reward_vests = Amount("0 VESTS") diff --git a/examples/account_curation_per_week_and_1k_sp.py b/examples/account_curation_per_week_and_1k_sp.py index 492704b0bf090317a869551e9ae22d5b782828a0..0843fb2bc90f74b6a40e521363cd8f0647e685ea 100644 --- a/examples/account_curation_per_week_and_1k_sp.py +++ b/examples/account_curation_per_week_and_1k_sp.py @@ -14,7 +14,7 @@ import matplotlib.pyplot as plt if __name__ == "__main__": if len(sys.argv) != 2: - # print("ERROR: command line paramter mismatch!") + # print("ERROR: command line parameter mismatch!") # print("usage: %s [account]" % (sys.argv[0])) account = "holger80" else: diff --git a/examples/account_rep_over_time.py b/examples/account_rep_over_time.py index d497f4556902967bb5ded131b3457118083afd4e..8af7d19d9925965901b1abad5b10f5cafa3c6756 100644 --- a/examples/account_rep_over_time.py +++ b/examples/account_rep_over_time.py @@ -14,7 +14,7 @@ import matplotlib.pyplot as plt if __name__ == "__main__": if len(sys.argv) != 2: - # print("ERROR: command line paramter mismatch!") + # print("ERROR: command line parameter mismatch!") # print("usage: %s [account]" % (sys.argv[0])) account = "holger80" else: diff --git a/examples/account_sp_over_time.py b/examples/account_sp_over_time.py index 0477657afd9347a394a33686e5c79bad0392dd67..bd7108a6a231fcfc2317ed32a5612aed82bff01d 100644 --- a/examples/account_sp_over_time.py +++ b/examples/account_sp_over_time.py @@ -14,7 +14,7 @@ import matplotlib.pyplot as plt if __name__ == "__main__": if len(sys.argv) != 2: - # print("ERROR: command line paramter mismatch!") + # print("ERROR: command line parameter mismatch!") # print("usage: %s [account]" % (sys.argv[0])) account = "holger80" else: diff --git a/examples/account_vp_over_time.py b/examples/account_vp_over_time.py index f07b96092bab04aac5581dc474ccb9c869dbbbe6..dff893b66469e20e0ca03c501e4d09ce323758c3 100644 --- a/examples/account_vp_over_time.py +++ b/examples/account_vp_over_time.py @@ -14,7 +14,7 @@ import matplotlib.pyplot as plt if __name__ == "__main__": if len(sys.argv) != 2: - # print("ERROR: command line paramter mismatch!") + # print("ERROR: command line parameter mismatch!") # print("usage: %s [account]" % (sys.argv[0])) account = "holger80" else: diff --git a/examples/benchmark_nodes2.py b/examples/benchmark_nodes2.py index ebfba89709078bffa13310b4573d37019724b73a..5efdc85afcd04b46ebd36cbe4b83c4a84f2c1468 100644 --- a/examples/benchmark_nodes2.py +++ b/examples/benchmark_nodes2.py @@ -36,7 +36,7 @@ def benchmark_node(node, how_many_minutes=10, how_many_seconds=30): access_time = 0 follow_time = 0 blockchain_version = u'0.0.0' - sucessfull = True + successful = True error_msg = None start_total = timer() max_batch_size = None @@ -102,16 +102,16 @@ def benchmark_node(node, how_many_minutes=10, how_many_seconds=30): except NumRetriesReached: error_msg = 'NumRetriesReached' history_count = -1 - sucessfull = False + successful = False except KeyboardInterrupt: error_msg = 'KeyboardInterrupt' history_count = -1 - sucessfull = False + successful = False # quit = True except Exception as e: error_msg = str(e) history_count = -1 - sucessfull = False + successful = False try: stm = Steem(node=node, num_retries=3, num_retries_call=3, timeout=30) @@ -144,7 +144,7 @@ def benchmark_node(node, how_many_minutes=10, how_many_seconds=30): except Exception as e: error_msg = str(e) access_time = -1 - return {'sucessfull': sucessfull, 'node': node, 'error': error_msg, + return {'successful': successful, 'node': node, 'error': error_msg, 'total_duration': timer() - start_total, 'block_count': block_count, 'history_count': history_count, 'access_time': access_time, 'follow_time': follow_time, 'version': blockchain_version} @@ -188,7 +188,7 @@ if __name__ == "__main__": sortedList = sorted(results, key=lambda self: self["history_count"], reverse=True) for result in sortedList: - if result["sucessfull"]: + if result["successful"]: t.add_row([ result["node"], result["block_count"],