From fa99d2b06ae0457944c33e267cd7bb34e50ea9ef Mon Sep 17 00:00:00 2001 From: Holger Nahrstaedt <holger@nahrstaedt.de> Date: Fri, 16 Feb 2018 09:34:05 +0100 Subject: [PATCH] renamed everyting to steempy --- MANIFEST.in | 2 +- Makefile | 2 +- README.rst | 8 +-- setup.py | 10 +-- {steem => steempy}/__init__.py | 0 {steem => steempy}/account.py | 4 +- {steem => steempy}/aes.py | 0 {steem => steempy}/amount.py | 2 +- {steem => steempy}/asset.py | 6 +- {steem => steempy}/block.py | 0 {steem => steempy}/blockchain.py | 4 +- {steem => steempy}/blockchainobject.py | 2 +- {steem => steempy}/exceptions.py | 0 {steem => steempy}/instance.py | 2 +- {steem => steempy}/market.py | 4 +- {steem => steempy}/memo.py | 6 +- {steem => steempy}/message.py | 6 +- {steem => steempy}/notify.py | 48 +++++++------- {steem => steempy}/price.py | 48 +++++++------- {steem => steempy}/steem.py | 64 +++++++++---------- {steem => steempy}/storage.py | 4 +- {steem => steempy}/transactionbuilder.py | 12 ++-- {steem => steempy}/utils.py | 0 {steem => steempy}/vesting.py | 0 {steem => steempy}/vote.py | 0 {steem => steempy}/wallet.py | 4 +- {steem => steempy}/witness.py | 2 +- {steemapi => steempyapi}/__init__.py | 0 {steemapi => steempyapi}/exceptions.py | 0 {steemapi => steempyapi}/steemnoderpc.py | 2 +- {steemapi => steempyapi}/websocket.py | 0 {steembase => steempybase}/__init__.py | 0 {steembase => steempybase}/account.py | 0 .../asset_permissions.py | 0 {steembase => steempybase}/bip38.py | 0 {steembase => steempybase}/chains.py | 0 {steembase => steempybase}/memo.py | 0 {steembase => steempybase}/objects.py | 0 {steembase => steempybase}/objecttypes.py | 0 {steembase => steempybase}/operationids.py | 0 {steembase => steempybase}/operations.py | 0 .../signedtransactions.py | 0 {steembase => steempybase}/transactions.py | 0 tests/test_account.py | 12 ++-- tests/test_aes.py | 2 +- tests/test_amount.py | 8 +-- tests/test_asset.py | 8 +-- tests/test_base_objects.py | 8 +-- tests/test_memo.py | 4 +- tests/test_message.py | 6 +- tests/test_price.py | 10 +-- tests/test_proposals.py | 6 +- tests/test_steem.py | 10 +-- tests/test_transactions.py | 6 +- tests/test_txbuffers.py | 6 +- tests/test_utils.py | 4 +- tests/test_wallet.py | 12 ++-- 57 files changed, 172 insertions(+), 172 deletions(-) rename {steem => steempy}/__init__.py (100%) rename {steem => steempy}/account.py (98%) rename {steem => steempy}/aes.py (100%) rename {steem => steempy}/amount.py (99%) rename {steem => steempy}/asset.py (95%) rename {steem => steempy}/block.py (100%) rename {steem => steempy}/blockchain.py (98%) rename {steem => steempy}/blockchainobject.py (98%) rename {steem => steempy}/exceptions.py (100%) rename {steem => steempy}/instance.py (97%) rename {steem => steempy}/market.py (99%) rename {steem => steempy}/memo.py (96%) rename {steem => steempy}/message.py (96%) rename {steem => steempy}/notify.py (76%) rename {steem => steempy}/price.py (94%) rename {steem => steempy}/steem.py (96%) rename {steem => steempy}/storage.py (99%) rename {steem => steempy}/transactionbuilder.py (97%) rename {steem => steempy}/utils.py (100%) rename {steem => steempy}/vesting.py (100%) rename {steem => steempy}/vote.py (100%) rename {steem => steempy}/wallet.py (99%) rename {steem => steempy}/witness.py (96%) rename {steemapi => steempyapi}/__init__.py (100%) rename {steemapi => steempyapi}/exceptions.py (100%) rename {steemapi => steempyapi}/steemnoderpc.py (98%) rename {steemapi => steempyapi}/websocket.py (100%) rename {steembase => steempybase}/__init__.py (100%) rename {steembase => steempybase}/account.py (100%) rename {steembase => steempybase}/asset_permissions.py (100%) rename {steembase => steempybase}/bip38.py (100%) rename {steembase => steempybase}/chains.py (100%) rename {steembase => steempybase}/memo.py (100%) rename {steembase => steempybase}/objects.py (100%) rename {steembase => steempybase}/objecttypes.py (100%) rename {steembase => steempybase}/operationids.py (100%) rename {steembase => steempybase}/operations.py (100%) rename {steembase => steempybase}/signedtransactions.py (100%) rename {steembase => steempybase}/transactions.py (100%) diff --git a/MANIFEST.in b/MANIFEST.in index efa752ea..bb37a272 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include *.md +include *.rst diff --git a/Makefile b/Makefile index ad8b946e..a3a8ac03 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ clean-pyc: find . -name '*~' -exec rm -f {} + lint: - flake8 steemapi/ steembase/ steem/ + flake8 steempyapi/ steempybase/ steempy/ test: python3 setup.py test diff --git a/README.rst b/README.rst index 00d09da1..31e94f3e 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -Unofficial Python 3 Library for Steem +steempy - Unofficial Python 3 Library for Steem ===================================== !!!NOT WORKING AT THE MOMENT - DO NOT USE!!! @@ -34,8 +34,8 @@ For OSX, please do the following:: You can install py-scrypt from this repository if you want the latest but possibly non-compiling version:: - git clone https://github.com/holgern/pySteemi.git - cd pySteemi + git clone https://github.com/holgern/steempy.git + cd steempy python setup.py build python setup.py install --user @@ -52,4 +52,4 @@ Changelog * Replaced all BitShares by Steem * Flake8 fixed * Unit tests are working -* \ No newline at end of file +* renamed to steempy \ No newline at end of file diff --git a/setup.py b/setup.py index 7ba0d381..f4f206e5 100755 --- a/setup.py +++ b/setup.py @@ -14,11 +14,11 @@ except LookupError: VERSION = '0.18.1' setup( - name='steemi', + name='steempy', version=VERSION, description='Unofficial Python library for STEEM', long_description=open('README.rst').read(), - download_url='https://github.com/holgern/pySteemi/tarball/' + VERSION, + download_url='https://github.com/holgern/steempy/tarball/' + VERSION, author='Holger Nahrstaedt', author_email='holger@nahrstaedt.de', maintainer='Holger Nahrstaedt', @@ -26,9 +26,9 @@ setup( url='http://www.github.com/holgern/pySteemi', keywords=['steem', 'library', 'api', 'rpc'], packages=[ - "steem", - "steemapi", - "steembase" + "steempy", + "steempyapi", + "steempybase" ], classifiers=[ 'License :: OSI Approved :: MIT License', diff --git a/steem/__init__.py b/steempy/__init__.py similarity index 100% rename from steem/__init__.py rename to steempy/__init__.py diff --git a/steem/account.py b/steempy/account.py similarity index 98% rename from steem/account.py rename to steempy/account.py index 330c26bb..0df2a37e 100644 --- a/steem/account.py +++ b/steempy/account.py @@ -1,4 +1,4 @@ -from steem.instance import shared_steem_instance +from steempy.instance import shared_steem_instance from .exceptions import AccountDoesNotExistsException from .blockchainobject import BlockchainObject @@ -196,7 +196,7 @@ class Account(BlockchainObject): :param array exclude_ops: Exclude thse operations from generator (*optional*) """ - from steembase.operations import getOperationNameForId + from steempybase.operations import getOperationNameForId _limit = 100 cnt = 0 diff --git a/steem/aes.py b/steempy/aes.py similarity index 100% rename from steem/aes.py rename to steempy/aes.py diff --git a/steem/amount.py b/steempy/amount.py similarity index 99% rename from steem/amount.py rename to steempy/amount.py index 0d6ab03d..2100bfaa 100644 --- a/steem/amount.py +++ b/steempy/amount.py @@ -1,4 +1,4 @@ -from steem.instance import shared_steem_instance +from steempy.instance import shared_steem_instance from .asset import Asset diff --git a/steem/asset.py b/steempy/asset.py similarity index 95% rename from steem/asset.py rename to steempy/asset.py index 8bd551e2..b44ddf2c 100644 --- a/steem/asset.py +++ b/steempy/asset.py @@ -1,7 +1,7 @@ import json -from steem.account import Account -from steembase import operations -from steembase.asset_permissions import ( +from steempy.account import Account +from steempybase import operations +from steempybase.asset_permissions import ( asset_permissions, force_flag, test_permissions, diff --git a/steem/block.py b/steempy/block.py similarity index 100% rename from steem/block.py rename to steempy/block.py diff --git a/steem/blockchain.py b/steempy/blockchain.py similarity index 98% rename from steem/blockchain.py rename to steempy/blockchain.py index 6f8b57dc..a87b5b66 100644 --- a/steem/blockchain.py +++ b/steempy/blockchain.py @@ -1,7 +1,7 @@ import time from .block import Block -from steem.instance import shared_steem_instance -from steembase.operationids import getOperationNameForId +from steempy.instance import shared_steem_instance +from steempybase.operationids import getOperationNameForId class Blockchain(object): diff --git a/steem/blockchainobject.py b/steempy/blockchainobject.py similarity index 98% rename from steem/blockchainobject.py rename to steempy/blockchainobject.py index ba98dcbd..bb386046 100644 --- a/steem/blockchainobject.py +++ b/steempy/blockchainobject.py @@ -1,4 +1,4 @@ -from steem.instance import shared_steem_instance +from steempy.instance import shared_steem_instance from datetime import datetime, timedelta diff --git a/steem/exceptions.py b/steempy/exceptions.py similarity index 100% rename from steem/exceptions.py rename to steempy/exceptions.py diff --git a/steem/instance.py b/steempy/instance.py similarity index 97% rename from steem/instance.py rename to steempy/instance.py index fd74290b..cc4eefb9 100644 --- a/steem/instance.py +++ b/steempy/instance.py @@ -1,4 +1,4 @@ -import steem as stm +import steempy as stm class SharedInstance(): diff --git a/steem/market.py b/steempy/market.py similarity index 99% rename from steem/market.py rename to steempy/market.py index 8774c22f..72bc4075 100644 --- a/steem/market.py +++ b/steempy/market.py @@ -1,4 +1,4 @@ -from steem.instance import shared_steem_instance +from steempy.instance import shared_steem_instance from datetime import datetime, timedelta from .utils import ( formatTimeFromNow, formatTime, formatTimeString, assets_from_string) @@ -6,7 +6,7 @@ from .asset import Asset from .amount import Amount from .price import Price, Order, FilledOrder from .account import Account -from steembase import operations +from steempybase import operations class Market(dict): diff --git a/steem/memo.py b/steempy/memo.py similarity index 96% rename from steem/memo.py rename to steempy/memo.py index c419d461..5ec2f5da 100644 --- a/steem/memo.py +++ b/steempy/memo.py @@ -1,7 +1,7 @@ -from steem.instance import shared_steem_instance +from steempy.instance import shared_steem_instance import random -from steembase import memo as BtsMemo -from steembase.account import PrivateKey, PublicKey +from steempybase import memo as BtsMemo +from steempybase.account import PrivateKey, PublicKey from .account import Account from .exceptions import MissingKeyError, KeyNotFound diff --git a/steem/message.py b/steempy/message.py similarity index 96% rename from steem/message.py rename to steempy/message.py index e7f2d745..d463db01 100644 --- a/steem/message.py +++ b/steempy/message.py @@ -2,9 +2,9 @@ import re import logging from binascii import hexlify, unhexlify from graphenebase.ecdsa import verify_message, sign_message -from steembase.account import PublicKey -from steem.instance import shared_steem_instance -from steem.account import Account +from steempybase.account import PublicKey +from steempy.instance import shared_steem_instance +from steempy.account import Account from .exceptions import InvalidMessageSignature from .storage import configStorage as config diff --git a/steem/notify.py b/steempy/notify.py similarity index 76% rename from steem/notify.py rename to steempy/notify.py index 2992f337..967f69dd 100644 --- a/steem/notify.py +++ b/steempy/notify.py @@ -1,10 +1,10 @@ import logging from events import Events -from bitsharesapi.websocket import SteemWebsocket -from bitshares.instance import shared_bitshares_instance -from bitshares.market import Market -from bitshares.price import Order, FilledOrder, UpdateCallOrder -from bitshares.account import AccountUpdate +from steempyapi.websocket import SteemWebsocket +from steempy.instance import shared_steem_instance +from steempy.market import Market +from steempy.price import Order, FilledOrder, UpdateCallOrder +from steempy.account import AccountUpdate log = logging.getLogger(__name__) # logging.basicConfig(level=logging.DEBUG) @@ -13,21 +13,21 @@ class Notify(Events): """ Notifications on Blockchain events. :param list accounts: Account names/ids to be notified about when changing - :param list markets: Instances of :class:`bitshares.market.Market` that identify markets to be monitored + :param list markets: Instances of :class:`steempy.market.Market` that identify markets to be monitored :param list objects: Object ids to be notified about when changed :param fnt on_tx: Callback that will be called for each transaction received :param fnt on_block: Callback that will be called for each block received :param fnt on_account: Callback that will be called for changes of the listed accounts :param fnt on_market: Callback that will be called for changes of the listed markets - :param bitshares.bitshares.Steem bitshares_instance: Steem instance + :param steempy.steem.Steem steem_instance: Steem instance **Example** .. code-block:: python from pprint import pprint - from bitshares.notify import Notify - from bitshares.market import Market + from steempy.notify import Notify + from steempy.market import Market notify = Notify( markets=["TEST:GOLD"], @@ -60,21 +60,21 @@ class Notify(Events): on_block=None, on_account=None, on_market=None, - bitshares_instance=None, + steem_instance=None, ): # Events super(Notify, self).__init__() self.events = Events() # Steem instance - self.bitshares = bitshares_instance or shared_bitshares_instance() + self.steem = steem_instance or shared_steem_instance() # Markets market_ids = [] for market_name in markets: market = Market( market_name, - bitshares_instance=self.bitshares + steem_instance=self.steem ) market_ids.append([ market["base"]["id"], @@ -95,9 +95,9 @@ class Notify(Events): # Open the websocket self.websocket = SteemWebsocket( - urls=self.bitshares.rpc.urls, - user=self.bitshares.rpc.user, - password=self.bitshares.rpc.password, + urls=self.steem.rpc.urls, + user=self.steem.rpc.user, + password=self.steem.rpc.password, accounts=accounts, markets=market_ids, objects=objects, @@ -112,9 +112,9 @@ class Notify(Events): """ This method is used for post processing of market notifications. It will return instances of either - * :class:`bitshares.price.Order` or - * :class:`bitshares.price.FilledOrder` or - * :class:`bitshares.price.UpdateCallOrder` + * :class:`steem.price.Order` or + * :class:`steem.price.FilledOrder` or + * :class:`steem.price.UpdateCallOrder` Also possible are limit order updates (margin calls) @@ -127,7 +127,7 @@ class Notify(Events): log.debug("Calling on_market with Order()") self.on_market(Order( d, - bitshares_instance=self.bitshares + steem_instance=self.steem )) continue elif isinstance(d, dict): @@ -142,17 +142,17 @@ class Notify(Events): if "pays" in i and "receives" in i: self.on_market(FilledOrder( i, - bitshares_instance=self.bitshares + steem_instance=self.steem )) elif "for_sale" in i and "sell_price" in i: self.on_market(Order( i, - bitshares_instance=self.bitshares + steem_instance=self.steem )) elif "collateral" in i and "call_price" in i: self.on_market(UpdateCallOrder( i, - bitshares_instance=self.bitshares + steem_instance=self.steem )) else: if i: @@ -162,11 +162,11 @@ class Notify(Events): def process_account(self, message): """ This is used for processing of account Updates. It will - return instances of :class:bitshares.account.AccountUpdate` + return instances of :class:steem.account.AccountUpdate` """ self.on_account(AccountUpdate( message, - bitshares_instance=self.bitshares + steem_instance=self.steem )) def listen(self): diff --git a/steem/price.py b/steempy/price.py similarity index 94% rename from steem/price.py rename to steempy/price.py index 7d0b76f7..172c9c25 100644 --- a/steem/price.py +++ b/steempy/price.py @@ -1,5 +1,5 @@ from fractions import Fraction -from steem.instance import shared_steem_instance +from steempy.instance import shared_steem_instance from .exceptions import InvalidAssetException from .account import Account from .amount import Amount @@ -14,7 +14,7 @@ class Price(dict): (quote, base) - each being an instance of :class:`steem.amount.Amount`. The + each being an instance of :class:`steempy.amount.Amount`. The amount themselves define the price. .. note:: @@ -22,43 +22,43 @@ class Price(dict): The price (floating) is derived as ``base/quote`` :param list args: Allows to deal with different representations of a price - :param steem.asset.Asset base: Base asset - :param steem.asset.Asset quote: Quote asset - :param steem.steem.BitShares steem_instance: BitShares instance + :param steempy.asset.Asset base: Base asset + :param steempy.asset.Asset quote: Quote asset + :param steempy.steem.Steem steem_instance: Steem instance :returns: All data required to represent a price :rtype: dict Way to obtain a proper instance: * ``args`` is a str with a price and two assets - * ``args`` can be a floating number and ``base`` and ``quote`` being instances of :class:`steem.asset.Asset` + * ``args`` can be a floating number and ``base`` and ``quote`` being instances of :class:`steempy.asset.Asset` * ``args`` can be a floating number and ``base`` and ``quote`` being instances of ``str`` * ``args`` can be dict with keys ``price``, ``base``, and ``quote`` (*graphene balances*) * ``args`` can be dict with keys ``base`` and ``quote`` * ``args`` can be dict with key ``receives`` (filled orders) - * ``args`` being a list of ``[quote, base]`` both being instances of :class:`steem.amount.Amount` + * ``args`` being a list of ``[quote, base]`` both being instances of :class:`steempy.amount.Amount` * ``args`` being a list of ``[quote, base]`` both being instances of ``str`` (``amount symbol``) - * ``base`` and ``quote`` being instances of :class:`steem.asset.Amount` + * ``base`` and ``quote`` being instances of :class:`steempy.asset.Amount` This allows instanciations like: - * ``Price("0.315 USD/BTS")`` - * ``Price(0.315, base="USD", quote="BTS")`` - * ``Price(0.315, base=Asset("USD"), quote=Asset("BTS"))`` - * ``Price({"base": {"amount": 1, "asset_id": "1.3.0"}, "quote": {"amount": 10, "asset_id": "1.3.106"}})`` - * ``Price(quote="10 GOLD", base="1 USD")`` - * ``Price("10 GOLD", "1 USD")`` - * ``Price(Amount("10 GOLD"), Amount("1 USD"))`` - * ``Price(1.0, "USD/GOLD")`` + * ``Price("0.315 SBD/STEEM")`` + * ``Price(0.315, base="SBD", quote="STEEM")`` + * ``Price(0.315, base=Asset("SBD"), quote=Asset("STEEM"))`` + * ``Price({"base": {"amount": 1, "asset_id": "SBD"}, "quote": {"amount": 10, "asset_id": "SBD"}})`` + * ``Price(quote="10 STEEM", base="1 SBD")`` + * ``Price("10 STEEM", "1 SBD")`` + * ``Price(Amount("10 STEEM"), Amount("1 SBD"))`` + * ``Price(1.0, "SBD/STEEM")`` Instances of this class can be used in regular mathematical expressions (``+-*/%``) such as: .. code-block:: python - >>> from steem.price import Price - >>> Price("0.3314 USD/BTS") * 2 - 0.662600000 USD/BTS + >>> from steempy.price import Price + >>> Price("0.3314 SBD/STEEM") * 2 + 0.662600000 SBD/STEEM """ def __init__( @@ -190,7 +190,7 @@ class Price(dict): raise InvalidAssetException def invert(self): - """ Invert the price (e.g. go from ``USD/BTS`` into ``BTS/USD``) + """ Invert the price (e.g. go from ``SBD/STEEM`` into ``STEEM/SBD``) """ tmp = self["quote"] self["quote"] = self["base"] @@ -386,7 +386,7 @@ class Order(Price): ratio of base and quote) but instead has those amounts represent the amounts of an actual order! - :param steem.steem.BitShares steem_instance: BitShares instance + :param steem.steem.Steem steem_instance: Steem instance .. note:: @@ -460,7 +460,7 @@ class FilledOrder(Price): ratio of base and quote) but instead has those amounts represent the amounts of an actually filled order! - :param steem.steem.BitShares steem_instance: BitShares instance + :param steem.steem.Steem steem_instance: Steem instance .. note:: Instances of this class come with an additional ``time`` key that shows when the order has been filled! @@ -517,7 +517,7 @@ class UpdateCallOrder(Price): and ``quote`` Amounts not only be used to represent the **call price** (as a ratio of base and quote). - :param steem.steem.BitShares steem_instance: BitShares instance + :param steem.steem.Steem steem_instance: Steem instance """ def __init__(self, call, steem_instance=None, **kwargs): @@ -555,7 +555,7 @@ class PriceFeed(dict): * a settlement price, and * a date - :param steem.steem.BitShares steem_instance: BitShares instance + :param steem.steem.Steem steem_instance: Steem instance """ def __init__(self, feed, steem_instance=None): diff --git a/steem/steem.py b/steempy/steem.py similarity index 96% rename from steem/steem.py rename to steempy/steem.py index 9f19fd4c..8def0613 100644 --- a/steem/steem.py +++ b/steempy/steem.py @@ -2,9 +2,9 @@ import json import logging from datetime import datetime, timedelta -from steemapi.steemnoderpc import SteemNodeRPC -from steembase.account import PrivateKey, PublicKey -from steembase import transactions, operations +from steempyapi.steemnoderpc import SteemNodeRPC +from steempybase.account import PrivateKey, PublicKey +from steempybase import transactions, operations from .asset import Asset from .account import Account from .amount import Amount @@ -83,7 +83,7 @@ class Steem(object): .. code-block:: python - from steem import Steem + from steempy import Steem steem = Steem() print(steem.info()) @@ -174,7 +174,7 @@ class Steem(object): @property def chain_params(self): if self.offline: - from steembase.chains import known_chains + from steempybase.chains import known_chains return known_chains["STEEM"] else: return self.rpc.chain_params @@ -216,8 +216,8 @@ class Steem(object): posting permission. Neither can you use different accounts for different operations! - ... note:: This uses ``steem.txbuffer`` as instance of - :class:`steem.transactionbuilder.TransactionBuilder`. + ... note:: This uses ``steempy.txbuffer`` as instance of + :class:`steempy.transactionbuilder.TransactionBuilder`. You may want to use your own txbuffer """ if "append_to" in kwargs and kwargs["append_to"]: @@ -301,10 +301,10 @@ class Steem(object): # ------------------------------------------------------------------------- def newWallet(self, pwd): """ Create a new wallet. This method is basically only calls - :func:`steem.wallet.create`. + :func:`steempy.wallet.create`. :param str pwd: Password to use for the new wallet - :raises steem.exceptions.WalletExists: if there is already a + :raises steempy.exceptions.WalletExists: if there is already a wallet created """ return self.wallet.create(pwd) @@ -480,7 +480,7 @@ class Steem(object): """ Create new account on Steem The brainkey/password can be used to recover all generated keys - (see `steembase.account` for more details. + (see `steempybase.account` for more details. By default, this call will use ``default_account`` to register a new name ``account_name`` with all keys being @@ -542,7 +542,7 @@ class Steem(object): registrar = Account(registrar, steem_instance=self) " Generate new keys from password" - from steembase.account import PasswordKey, PublicKey + from steempybase.account import PasswordKey, PublicKey if password: active_key = PasswordKey(account_name, password, role="active") owner_key = PasswordKey(account_name, password, role="owner") @@ -596,7 +596,7 @@ class Steem(object): proxy_account or "proxy-to-self", steem_instance=self) op = { - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "registrar": registrar["id"], "referrer": referrer["id"], "referrer_percent": referrer_percent * 100, @@ -635,7 +635,7 @@ class Steem(object): raise ValueError("You need to provide an account") account = Account(account, steem_instance=self) op = operations.Account_upgrade(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "account_to_upgrade": account["id"], "upgrade_to_lifetime_member": True, "prefix": self.prefix @@ -717,7 +717,7 @@ class Steem(object): self._test_weights_treshold(authority) op = operations.Account_update(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "account": account["id"], permission: authority, "extensions": {}, @@ -801,7 +801,7 @@ class Steem(object): self._test_weights_treshold(authority) op = operations.Account_update(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "account": account["id"], permission: authority, "extensions": {} @@ -832,7 +832,7 @@ class Steem(object): account = Account(account, steem_instance=self) account["options"]["memo_key"] = key op = operations.Account_update(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "account": account["id"], "new_options": account["options"], "extensions": {} @@ -871,7 +871,7 @@ class Steem(object): ))) op = operations.Account_update(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "account": account["id"], "new_options": options, "extensions": {}, @@ -909,7 +909,7 @@ class Steem(object): ))) op = operations.Account_update(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "account": account["id"], "new_options": options, "extensions": {}, @@ -946,7 +946,7 @@ class Steem(object): ))) op = operations.Account_update(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "account": account["id"], "new_options": options, "extensions": {}, @@ -984,7 +984,7 @@ class Steem(object): ))) op = operations.Account_update(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "account": account["id"], "new_options": options, "extensions": {}, @@ -1023,7 +1023,7 @@ class Steem(object): for proposal_id in proposal_ids: proposal = Proposal(proposal_id, steem_instance=self) update_dict = { - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, 'fee_paying_account': account["id"], 'proposal': proposal["id"], 'active_approvals_to_add': [approver["id"]], @@ -1099,7 +1099,7 @@ class Steem(object): for order in orderNumbers: op.append( operations.Limit_order_cancel(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "fee_paying_account": account["id"], "order": order, "extensions": [], @@ -1110,7 +1110,7 @@ class Steem(object): """ Withdraw vesting balance :param str vesting_id: Id of the vesting object - :param steem.amount.Amount Amount: to withdraw ("all" if not provided") + :param steempy.amount.Amount Amount: to withdraw ("all" if not provided") :param str account: (optional) the account to allow access to (defaults to ``default_account``) @@ -1127,7 +1127,7 @@ class Steem(object): amount = obj.claimable op = operations.Vesting_balance_withdraw(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "vesting_balance": vesting_id, "owner": account["id"], "amount": { @@ -1150,8 +1150,8 @@ class Steem(object): """ Publish a price feed for a market-pegged asset :param str symbol: Symbol of the asset to publish feed for - :param steem.price.Price settlement_price: Price for settlement - :param steem.price.Price cer: Core exchange Rate (default ``settlement_price + 5%``) + :param steempy.price.Price settlement_price: Price for settlement + :param steempy.price.Price cer: Core exchange Rate (default ``settlement_price + 5%``) :param float mssr: Percentage for max short squeeze ratio (default: 110%) :param float mcr: Percentage for maintenance collateral ratio (default: 200%) :param str account: (optional) the account to allow access @@ -1185,18 +1185,18 @@ class Steem(object): if cer: cer = cer.as_base(symbol) - if cer["quote"]["asset"]["id"] != "1.3.0": + if cer["quote"]["asset"]["id"] != "SBD": raise ValueError( "CER must be defined against core asset '1.3.0'") else: - if settlement_price["quote"]["asset"]["id"] != "1.3.0": + if settlement_price["quote"]["asset"]["id"] != "SBD": raise ValueError( "CER must be manually provided because it relates to core asset '1.3.0'" ) cer = settlement_price.as_quote(symbol) * 0.95 op = operations.Asset_publish_feed(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "publisher": account["id"], "asset_id": asset["id"], "feed": { @@ -1219,7 +1219,7 @@ class Steem(object): witness = Witness(witness_identifier) account = witness.account op = operations.Witness_update(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "prefix": self.prefix, "witness": witness["id"], "witness_account": account["id"], @@ -1245,7 +1245,7 @@ class Steem(object): raise ValueError("You need to provide an account") account = Account(account, steem_instance=self) op = operations.Asset_reserve(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "payer": account["id"], "amount_to_reserve": { "amount": int(amount), @@ -1272,7 +1272,7 @@ class Steem(object): account = Account(account, steem_instance=self) asset = Asset(symbol, steem_instance=self) op = operations.Asset_fund_fee_pool(**{ - "fee": {"amount": 0, "asset_id": "1.3.0"}, + "fee": {"amount": 0, "asset_id": "SBD"}, "from_account": account["id"], "asset_id": asset["id"], "amount": int(float(amount) * 10 ** asset["precision"]), diff --git a/steem/storage.py b/steempy/storage.py similarity index 99% rename from steem/storage.py rename to steempy/storage.py index 4d239413..92b01552 100644 --- a/steem/storage.py +++ b/steempy/storage.py @@ -37,9 +37,9 @@ class DataDir(object): Furthermore, it offers an interface to generated backups in the `backups/` directory every now and then. """ - appname = "steemi" + appname = "steempy" appauthor = "Holger Nahrstaedt" - storageDatabase = "steemi.sqlite" + storageDatabase = "steempy.sqlite" data_dir = user_data_dir(appname, appauthor) sqlDataBaseFile = os.path.join(data_dir, storageDatabase) diff --git a/steem/transactionbuilder.py b/steempy/transactionbuilder.py similarity index 97% rename from steem/transactionbuilder.py rename to steempy/transactionbuilder.py index 0bcc0af9..9ac6c23d 100644 --- a/steem/transactionbuilder.py +++ b/steempy/transactionbuilder.py @@ -1,15 +1,15 @@ from .account import Account -from steembase.objects import Operation -from steembase.account import PrivateKey, PublicKey -from steembase.signedtransactions import Signed_Transaction -from steembase import transactions, operations +from steempybase.objects import Operation +from steempybase.account import PrivateKey, PublicKey +from steempybase.signedtransactions import Signed_Transaction +from steempybase import transactions, operations from .exceptions import ( InsufficientAuthorityError, MissingKeyError, InvalidWifError, WalletLocked ) -from steem.instance import shared_steem_instance +from steempy.instance import shared_steem_instance import logging log = logging.getLogger(__name__) @@ -25,7 +25,7 @@ class ProposalBuilder: proposal :param steem.transactionbuilder.TransactionBuilder: Specify your own instance of transaction builder (optional) - :param steem.steem.BitShares steem_instance: BitShares + :param steempy.steem.BitShares steem_instance: BitShares instance """ def __init__( diff --git a/steem/utils.py b/steempy/utils.py similarity index 100% rename from steem/utils.py rename to steempy/utils.py diff --git a/steem/vesting.py b/steempy/vesting.py similarity index 100% rename from steem/vesting.py rename to steempy/vesting.py diff --git a/steem/vote.py b/steempy/vote.py similarity index 100% rename from steem/vote.py rename to steempy/vote.py diff --git a/steem/wallet.py b/steempy/wallet.py similarity index 99% rename from steem/wallet.py rename to steempy/wallet.py index ed2b731a..bbcb8058 100644 --- a/steem/wallet.py +++ b/steempy/wallet.py @@ -1,7 +1,7 @@ import logging import os from graphenebase import bip38 -from steembase.account import PrivateKey, GPHPrivateKey +from steempybase.account import PrivateKey, GPHPrivateKey from .account import Account from .exceptions import ( KeyNotFound, @@ -27,7 +27,7 @@ class Wallet(): Three wallet operation modes are possible: - * **Wallet Database**: Here, pysteem loads the keys from the + * **Wallet Database**: Here, steempy loads the keys from the locally stored wallet SQLite database (see ``storage.py``). To use this mode, simply call ``Steem()`` without the ``keys`` parameter diff --git a/steem/witness.py b/steempy/witness.py similarity index 96% rename from steem/witness.py rename to steempy/witness.py index 5c1975bc..c6ea5069 100644 --- a/steem/witness.py +++ b/steempy/witness.py @@ -1,4 +1,4 @@ -from steem.instance import shared_steem_instance +from steempy.instance import shared_steem_instance from .account import Account from .exceptions import WitnessDoesNotExistsException from .blockchainobject import BlockchainObject diff --git a/steemapi/__init__.py b/steempyapi/__init__.py similarity index 100% rename from steemapi/__init__.py rename to steempyapi/__init__.py diff --git a/steemapi/exceptions.py b/steempyapi/exceptions.py similarity index 100% rename from steemapi/exceptions.py rename to steempyapi/exceptions.py diff --git a/steemapi/steemnoderpc.py b/steempyapi/steemnoderpc.py similarity index 98% rename from steemapi/steemnoderpc.py rename to steempyapi/steemnoderpc.py index 74cdeac3..7d64c4f7 100644 --- a/steemapi/steemnoderpc.py +++ b/steempyapi/steemnoderpc.py @@ -7,7 +7,7 @@ import json import time from itertools import cycle from grapheneapi.graphenewsrpc import GrapheneWebsocketRPC -from steembase.chains import known_chains +from steempybase.chains import known_chains from . import exceptions import logging log = logging.getLogger(__name__) diff --git a/steemapi/websocket.py b/steempyapi/websocket.py similarity index 100% rename from steemapi/websocket.py rename to steempyapi/websocket.py diff --git a/steembase/__init__.py b/steempybase/__init__.py similarity index 100% rename from steembase/__init__.py rename to steempybase/__init__.py diff --git a/steembase/account.py b/steempybase/account.py similarity index 100% rename from steembase/account.py rename to steempybase/account.py diff --git a/steembase/asset_permissions.py b/steempybase/asset_permissions.py similarity index 100% rename from steembase/asset_permissions.py rename to steempybase/asset_permissions.py diff --git a/steembase/bip38.py b/steempybase/bip38.py similarity index 100% rename from steembase/bip38.py rename to steempybase/bip38.py diff --git a/steembase/chains.py b/steempybase/chains.py similarity index 100% rename from steembase/chains.py rename to steempybase/chains.py diff --git a/steembase/memo.py b/steempybase/memo.py similarity index 100% rename from steembase/memo.py rename to steempybase/memo.py diff --git a/steembase/objects.py b/steempybase/objects.py similarity index 100% rename from steembase/objects.py rename to steempybase/objects.py diff --git a/steembase/objecttypes.py b/steempybase/objecttypes.py similarity index 100% rename from steembase/objecttypes.py rename to steempybase/objecttypes.py diff --git a/steembase/operationids.py b/steempybase/operationids.py similarity index 100% rename from steembase/operationids.py rename to steempybase/operationids.py diff --git a/steembase/operations.py b/steempybase/operations.py similarity index 100% rename from steembase/operations.py rename to steempybase/operations.py diff --git a/steembase/signedtransactions.py b/steempybase/signedtransactions.py similarity index 100% rename from steembase/signedtransactions.py rename to steempybase/signedtransactions.py diff --git a/steembase/transactions.py b/steempybase/transactions.py similarity index 100% rename from steembase/transactions.py rename to steempybase/transactions.py diff --git a/tests/test_account.py b/tests/test_account.py index 0f44e6f2..ce2e49cd 100644 --- a/tests/test_account.py +++ b/tests/test_account.py @@ -1,12 +1,12 @@ import unittest import mock from pprint import pprint -from steem import Steem, exceptions -from steem.account import Account -from steem.amount import Amount -from steem.asset import Asset -from steem.instance import set_shared_steem_instance -from steembase.operationids import getOperationNameForId +from steempy import Steem, exceptions +from steempy.account import Account +from steempy.amount import Amount +from steempy.asset import Asset +from steempy.instance import set_shared_steem_instance +from steempybase.operationids import getOperationNameForId wif = "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3" diff --git a/tests/test_aes.py b/tests/test_aes.py index fc2a0b5f..6f04fcba 100644 --- a/tests/test_aes.py +++ b/tests/test_aes.py @@ -3,7 +3,7 @@ import random import unittest import base64 from pprint import pprint -from steem.aes import AESCipher +from steempy.aes import AESCipher class Testcases(unittest.TestCase): diff --git a/tests/test_amount.py b/tests/test_amount.py index f5029250..00914601 100644 --- a/tests/test_amount.py +++ b/tests/test_amount.py @@ -1,8 +1,8 @@ import unittest -from steem import Steem -from steem.amount import Amount -from steem.asset import Asset -from steem.instance import set_shared_steem_instance, SharedInstance +from steempy import Steem +from steempy.amount import Amount +from steempy.asset import Asset +from steempy.instance import set_shared_steem_instance, SharedInstance class Testcases(unittest.TestCase): diff --git a/tests/test_asset.py b/tests/test_asset.py index 2328dc31..6d90aa62 100644 --- a/tests/test_asset.py +++ b/tests/test_asset.py @@ -1,8 +1,8 @@ import unittest -from steem import Steem -from steem.asset import Asset -from steem.instance import set_shared_steem_instance -from steem.exceptions import AssetDoesNotExistsException +from steempy import Steem +from steempy.asset import Asset +from steempy.instance import set_shared_steem_instance +from steempy.exceptions import AssetDoesNotExistsException class Testcases(unittest.TestCase): diff --git a/tests/test_base_objects.py b/tests/test_base_objects.py index f527c5f0..e8a69503 100644 --- a/tests/test_base_objects.py +++ b/tests/test_base_objects.py @@ -1,8 +1,8 @@ import unittest -from steem import Steem, exceptions -from steem.instance import set_shared_steem_instance -from steem.account import Account -from steem.witness import Witness +from steempy import Steem, exceptions +from steempy.instance import set_shared_steem_instance +from steempy.account import Account +from steempy.witness import Witness class Testcases(unittest.TestCase): diff --git a/tests/test_memo.py b/tests/test_memo.py index cfe32e6a..4ed409e3 100644 --- a/tests/test_memo.py +++ b/tests/test_memo.py @@ -1,8 +1,8 @@ import unittest import os from pprint import pprint -from steembase.account import BrainKey, Address, PublicKey, PrivateKey -from steembase.memo import ( +from steempybase.account import BrainKey, Address, PublicKey, PrivateKey +from steempybase.memo import ( get_shared_secret, _pad, _unpad, diff --git a/tests/test_message.py b/tests/test_message.py index 862b43c7..d059c3a5 100644 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -1,8 +1,8 @@ import unittest import mock -from steem import Steem -from steem.message import Message -from steem.instance import set_shared_steem_instance +from steempy import Steem +from steempy.message import Message +from steempy.instance import set_shared_steem_instance wif = "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3" core_unit = "PPY" diff --git a/tests/test_price.py b/tests/test_price.py index d2e87c51..5e78ad96 100644 --- a/tests/test_price.py +++ b/tests/test_price.py @@ -1,8 +1,8 @@ -from steem import Steem -from steem.instance import set_shared_steem_instance -from steem.amount import Amount -from steem.price import Price -from steem.asset import Asset +from steempy import Steem +from steempy.instance import set_shared_steem_instance +from steempy.amount import Amount +from steempy.price import Price +from steempy.asset import Asset import unittest diff --git a/tests/test_proposals.py b/tests/test_proposals.py index 9b49b251..07703459 100644 --- a/tests/test_proposals.py +++ b/tests/test_proposals.py @@ -1,8 +1,8 @@ import unittest from pprint import pprint -from steem import Steem -from steembase.operationids import getOperationNameForId -from steem.instance import set_shared_steem_instance +from steempy import Steem +from steempybase.operationids import getOperationNameForId +from steempy.instance import set_shared_steem_instance wif = "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3" diff --git a/tests/test_steem.py b/tests/test_steem.py index c8c3462e..10cc8c13 100644 --- a/tests/test_steem.py +++ b/tests/test_steem.py @@ -3,11 +3,11 @@ import string import unittest import random from pprint import pprint -from steem import Steem -from steembase.operationids import getOperationNameForId -from steem.amount import Amount -from steembase.account import PrivateKey -from steem.instance import set_shared_steem_instance +from steempy import Steem +from steempybase.operationids import getOperationNameForId +from steempy.amount import Amount +from steempybase.account import PrivateKey +from steempy.instance import set_shared_steem_instance wif = "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3" core_unit = "TEST" diff --git a/tests/test_transactions.py b/tests/test_transactions.py index 3df0c750..fb4c39b8 100644 --- a/tests/test_transactions.py +++ b/tests/test_transactions.py @@ -5,9 +5,9 @@ from steembase import ( operations, objects ) -from steembase.objects import Operation -from steembase.signedtransactions import Signed_Transaction -from steembase.account import PrivateKey +from steempybase.objects import Operation +from steempybase.signedtransactions import Signed_Transaction +from steempybase.account import PrivateKey import random import unittest from pprint import pprint diff --git a/tests/test_txbuffers.py b/tests/test_txbuffers.py index 4a6dd1e7..338b0b83 100644 --- a/tests/test_txbuffers.py +++ b/tests/test_txbuffers.py @@ -1,7 +1,7 @@ import unittest -from steem import Steem -from steembase import operations -from steem.instance import set_shared_steem_instance +from steempy import Steem +from steempybase import operations +from steempy.instance import set_shared_steem_instance wif = "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3" diff --git a/tests/test_utils.py b/tests/test_utils.py index 6ada01cb..11e53601 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,5 +1,5 @@ -from steem.utils import assets_from_string -from steem.utils import resolve_authorperm +from steempy.utils import assets_from_string +from steempy.utils import resolve_authorperm def test_assets_from_string(): assert assets_from_string('USD:BTS') == ['USD', 'BTS'] diff --git a/tests/test_wallet.py b/tests/test_wallet.py index 75d1f71b..3c9d424d 100644 --- a/tests/test_wallet.py +++ b/tests/test_wallet.py @@ -1,12 +1,12 @@ import unittest import mock from pprint import pprint -from steem import Steem -from steem.account import Account -from steem.amount import Amount -from steem.asset import Asset -from steem.instance import set_shared_steem_instance -from steembase.operationids import getOperationNameForId +from steempy import Steem +from steempy.account import Account +from steempy.amount import Amount +from steempy.asset import Asset +from steempy.instance import set_shared_steem_instance +from steempybase.operationids import getOperationNameForId wif = "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3" -- GitLab