From 78bf61d19c192c936eb2775db9cded899e0f161f Mon Sep 17 00:00:00 2001 From: Dayal Chand Aichara Date: Thu, 30 May 2019 15:54:16 +0900 Subject: [PATCH] Update --- LICENSE.txt | 13 ++++ PriceIndices/__init__.py | 7 +- .../__pycache__/__init__.cpython-36.pyc | Bin 0 -> 207 bytes .../price_indicators.cpython-36.pyc | Bin 0 -> 6558 bytes PriceIndices/price_indicators.py | 13 ++-- README.md | 69 +++++++++++++++++- setup.cfg | 2 + setup.py | 29 ++++++++ 8 files changed, 126 insertions(+), 7 deletions(-) create mode 100644 LICENSE.txt create mode 100644 PriceIndices/__pycache__/__init__.cpython-36.pyc create mode 100644 PriceIndices/__pycache__/price_indicators.cpython-36.pyc create mode 100644 setup.cfg create mode 100644 setup.py diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..e4bf9ec --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,13 @@ +Copyright (c) 2019 Dayal Chand Aichara + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/PriceIndices/__init__.py b/PriceIndices/__init__.py index 4bb5804..55bbd16 100644 --- a/PriceIndices/__init__.py +++ b/PriceIndices/__init__.py @@ -1 +1,6 @@ -from .price_indicators import PriceIndices +from .price_indicators import price, indices + + + + + diff --git a/PriceIndices/__pycache__/__init__.cpython-36.pyc b/PriceIndices/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..36799de83a62d880b9a4ec7ac627a098f7d0a031 GIT binary patch literal 207 zcmXr!<>gvl`98*ofq~&M5W@izkmUfx#Uel=g&~D8has0SiZPcdiiwdSg(;Xplldhh zP)d{O7HdIKW^(E+_RPE#AYJUI$s8pB7K#UpB$nhC6&HcbD`Ex`D;bJdKx`24%SJ!6 zIJKx)-@w4wKtDaRB)%xMAir2Y0A!%9C&WAm55|cH8VXbwuUAlci^C>2KczG$)ehv4 IVjyM!0Ny+`IsgCw literal 0 HcmV?d00001 diff --git a/PriceIndices/__pycache__/price_indicators.cpython-36.pyc b/PriceIndices/__pycache__/price_indicators.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..53aea3db4bf2c67188bd602ff32289bd85eb7046 GIT binary patch literal 6558 zcmb_h%X1sYnV+5qFnAE8D2gI&$sWscWF!_zN#2Kd71@>)KN5*{MA@+?&dv_e17N@b z2I_7|1PuDH^l7VDmEFUh_8-VK=RNIpFI$yV4pTX#Dkq%ww%PJ&e_sy(KCIp35U}Q( z?w)>p-TnQ(@7K*+3k&5}NB{N3({;o6y>a4aA^i>>*@xf;XNlqGZ|0jiZ}~RfX5w@U zeu3rRiXGQ4>96HZ#jhY`CDrbNzo5U{Nv*r+FEZnOgFC$NwZRLAroV(-k-Nyb$erVC z$EcSk7}eOWvuxpR6b@9}93(sGppSye2ag|r{4NjsDiX*#k0K?84XQr-%~gK`C6VDX zZa`(`Tandd+~n5R4657Q`P%TI1~1}W;4TfDIeif~qS0$@rTX%3Ha8n--0Oy7FH()L zztKp$n~i}GQLhn4ak$ItI@#2wn zV2+KB-NERpI5v6dh#i`=RM4foJ=sT369=M&2f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5_fdVu-{LH;x?u2ZWQ+XLK8;}a0Sggh*Rf;!4hv%nwY|KL0TmDfko@0f+WI{qw@u# z0A~KTVqP-Wm}g!BB5lIr;+X}XFYGBc@UJ-t+jBN>?a#mlG#B8tKgtGhp~BBmY(^}# z2>|*U<~a7BN9b7owi*8H<;##9q`wn?RTcyI-S)iTezq} z{V#L2uy%qieEUM^_3aY@jfs0?BKJxBfCQ1{9MbPm>V1f5P!}H}Ju2l9^YyEB@k6RW z?tNC_0TnzXv7MJv&=(((_%Vrn2;YL0i$_R}F8?1M#d{r9>Vo{msC;wl##`67Ze8EH zk#mIK{rH_x?ap6qc^?5|chfG-ex%!FnM{k7KAa&+}1C75e?*6IBuZ+6TK*2QPk@#iFnZit_f_=3dGNczM@ScCeeZLi{XBon333{qJ+dT=3U&;$e7N``4K@7xJ8dd zN}^BV35oBKSeOg#VHc(zA>> price = price() + +>>> df = price.get_price('bitcoin', '20130428', '20190529') + +>>>print(df.head()) + + date price +0 2019-05-29 8659.49 +1 2019-05-28 8719.96 +2 2019-05-27 8805.78 +3 2019-05-26 8673.22 +4 2019-05-25 8052.54 + +>>> df_bvol = indices.get_bvol_index(df) +>>> print(df_bvol.head()) + date price BVOL_Index +0 2019-05-28 8719.96 0.853529 +1 2019-05-27 8805.78 0.853605 +2 2019-05-26 8673.22 0.849727 +3 2019-05-25 8052.54 0.852357 +4 2019-05-24 7987.37 0.826548 + +>>> indices.get_bvol_graph(df_bvol) + +"""This will return a plot of BVOL index against time.""" + +>>> df_rsi = indices.get_rsi(df) + +>>> print(df_rsi.tail()) + date price price_change gain loss gain_average loss_average RS RSI_1 RS_Smooth RSI_2 +2217 2013-05-02 105.21 7.46 7.46 0.00 1.532143 2.500000 0.612857 37.998229 0.561117 35.943306 +2218 2013-05-01 116.99 11.78 11.78 0.00 2.373571 2.175714 1.090939 52.174596 0.975319 49.375257 +2219 2013-04-30 139.00 22.01 22.01 0.00 3.945714 1.981429 1.991348 66.570258 1.869110 65.145981 +2220 2013-04-29 144.54 5.54 5.54 0.00 3.878571 1.981429 1.957462 66.187226 2.206422 68.812592 +2221 2013-04-28 134.21 -10.33 0.00 10.33 3.878571 2.506429 1.547449 60.745050 1.397158 58.283931 + +>>> indices.get_rsi_graph(df_rsi) + +"""This will return a plot of RSI against time.""" +``` + +### License +[MIT](https://choosealicense.com/licenses/mit/) © [Dayal Chand Aichara](https://github.com/dc-aichara) diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..224a779 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[metadata] +description-file = README.md \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..30d9742 --- /dev/null +++ b/setup.py @@ -0,0 +1,29 @@ +import setuptools +from os import path +this_directory = path.abspath(path.dirname(__file__)) +with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: + long_description = f.read() +setuptools.setup( + name = 'PriceIndices', + packages = ['PriceIndices'], + version = '0.1', + license='MIT', + description = 'This package can be useful to get historical price data of cryptocurrencies from CoinMarketCap, and calculate & plot different indicators.', + author = 'Dayal Chand Aichara', + author_email = 'dc.aichara@gmail.com', + url = 'https://github.com/dc-aichara/Price-Indices', + download_url = 'https://github.com/dc-aichara/Price-Indices/archive/v_0.1.tar.gz', + keywords = ['Volatility', 'blockchain', 'cryptocurrency', 'Price', 'trading'], + install_requires=['requests', 'bs4', 'pandas', 'numpy', 'matplotlib'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Statistics', + 'Intended Audience :: Traders', + 'Topic :: Software Development :: Build Tools', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 3', + 'Operating System :: OS Independent' + ], + long_description=long_description, + long_description_content_type='text/markdown' +)