From 7ac2e869d8514930fa06b65946a152107cab39be Mon Sep 17 00:00:00 2001 From: canokaue Date: Sat, 8 Aug 2020 19:28:56 -0300 Subject: [PATCH] prices are now float instead of strings --- dist/satoshi-0.1.4-py3-none-any.whl | Bin 0 -> 5328 bytes dist/satoshi-0.1.4.tar.gz | Bin 0 -> 4047 bytes satoshi/__init__.py | 3 ++- setup.py | 10 +++++++--- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 dist/satoshi-0.1.4-py3-none-any.whl create mode 100644 dist/satoshi-0.1.4.tar.gz diff --git a/dist/satoshi-0.1.4-py3-none-any.whl b/dist/satoshi-0.1.4-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..070bdfadaf8392c162020a77d6b7ba3e8deaf092 GIT binary patch literal 5328 zcma)=2Q(b}+s9WIB}CL9h|by-L=UoSb;4@VMc=sAV)fpGgy_+G4`PWPC89+yL81lG zW7R~DSN{L^zRA5O_nvp=%$YNDW^~<|157CY;b_lSU83Ktwo0)-7p03*M$Z0{c*QflCX*0I6W8>2!0UweIW+}-W z8abrM=*@X*(~Dnm>gHAxc7RT+&ih)d5@tO*Bi9!nFM4y#TWaLYZ$b-QN@^{OtJchp zlql07ET+Lr#j_faEbQGQ9hXk$hQuD#wPPmJC5`FZR>tezrlcgxOr7+E9ae%W3c(`* zknf?#33U`h^wQrA`3!d9k_ikw?-FvUNF-Fs<>=a)2sNQ>5>y;xkHA0@(lFaYAAb55 zH#nH^AzSiV$v|SBe1RYuidU$$X!ork^V&1#Cewb}$-1#+T`yM`&!*?|FCOA@OUW;F zDZ`cDuPR{rZ<1}O>4zDm%IRNG@4jwn%{51j)l?sx;m@zkW8rRp;sL7EW65#}%Z%q? zloZef&G>fIuy8W6$G@meQb6*2$Qa|xXCQFLNC$X`7%%&1lXThTyKfqt_(^1xuSPLi zfK&!<-?-}a`a6uQNO0?I+|?SYmu0$0*wsX!DiyUmCHYkL-HxeEsk8Haeag?dtiIZn zjtBA!TpjxgJIY6%t_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n7XR5v{GZKdqWHf}`$u6P z#XpUI_TDGAJ2zU#rSV@VO`iYEnk`4w6eJ?{Ku_|)eJ1*L z^T!qcH*)Cr>hYh?9DXU;$jL$i^8 zc$THmbD_G@^mlA+kJmpd7%q>>~f6pCE*#YK9I2-bm5xd?Y&;Nn4*pe7HKwCldZq#!%SXB7x>K z4lXRQDSNvCP0}~9xHPsKuoMV+=cz?L__~1~&uFr*97O*7uN*>V#{!>~rj6$Ogd6)0U-pgbyY`PN~`{d^cV?E8ek=_w$S z!~@F-K5j_Rf1$A3-&K+6v^3T3(o^Lpkme2Jc@)g&$fiMxTJ*Ph(#2RCVM_H7IiZKN z9g~JXV)48ZL8FKwiYTIpB8n)Yh$4z8qKG1jD58iWiYTIpBKpD7{{a^tJhK3J001+D B3*P_$ literal 0 HcmV?d00001 diff --git a/satoshi/__init__.py b/satoshi/__init__.py index d164cd1..9127af9 100644 --- a/satoshi/__init__.py +++ b/satoshi/__init__.py @@ -26,7 +26,8 @@ def to_fiat(satoshis=1, fiat='USD'): response = requests.get(quote_url) btc_value = response.json().get(fiat.upper()) fiat_value = float(satoshis * BTC_FRACTION) * float(btc_value) - return '{:.2f}'.format(fiat_value) + return float('{:.2f}'.format(fiat_value)) + def print_art(): '''Read ASCII art from bitcoin_art.txt and print directly''' diff --git a/setup.py b/setup.py index 5ce4a8e..898238e 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ here = dirname(__file__) setup(name='satoshi', - version='0.1.3', + version='0.1.4', description='Manipulate satoshi-related prices in Python 3, simple and sweet.', long_description=open(join(here, 'README.md')).read(), license='MIT', @@ -13,7 +13,7 @@ author='canokaue', author_email='kaue.cano@quan.digital', url='https://github.com/quan-digital/satoshi/', - download_url = 'https://github.com/quan-digital/satoshi/dist/satoshi-0.1.3.tar.gz', + download_url = 'https://github.com/quan-digital/satoshi/dist/satoshi-0.1.4.tar.gz', install_requires=[ 'requests==2.23.0' ], @@ -34,4 +34,8 @@ 'Operating System :: OS Independent', ], include_package_data=True - ) \ No newline at end of file + ) + +# PyPi publish flow +# python3 setup.py sdist bdist_wheel +# python3 -m twine upload dist/* \ No newline at end of file