diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-31 05:27:52 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-31 05:27:52 +0000 |
commit | 8527296f3e1918811e27e5a3e759537f7cc1ad72 (patch) | |
tree | b50b7046a48e3a30d0b149acfbcc724876950d46 /python-opstrat.spec | |
parent | e6b7a6790fe18d052d46596d9528506c12f09d62 (diff) |
automatic import of python-opstrat
Diffstat (limited to 'python-opstrat.spec')
-rw-r--r-- | python-opstrat.spec | 182 |
1 files changed, 182 insertions, 0 deletions
diff --git a/python-opstrat.spec b/python-opstrat.spec new file mode 100644 index 0000000..39451d5 --- /dev/null +++ b/python-opstrat.spec @@ -0,0 +1,182 @@ +%global _empty_manifest_terminate_build 0 +Name: python-opstrat +Version: 0.1.7 +Release: 1 +Summary: Option stategy visualizer +License: MIT +URL: https://github.com/hashabcd/opstrat +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/2d/40/9bde4fc68a5f45f0763bbc11fd4ba49cb56c0c8e9cdaa2d386bca17cb397/opstrat-0.1.7.tar.gz +BuildArch: noarch + +Requires: python3-matplotlib +Requires: python3-pandas +Requires: python3-numpy +Requires: python3-seaborn +Requires: python3-yfinance + +%description +op_type: kind {'c','p'}, default:'c'<br> +   Opion type>> 'c': call option, 'p':put option +spot: int, float, default: 100<br> +  Spot Price +spot_range: int, float, optional, default: 5<br> +  Range of spot variation in percentage +strike: int, float, default: 102<br> +  Strike Price +tr_type: kind {'b', 's'} default:'b'<br> +  Transaction Type>> 'b': long, 's': short +op_pr: int, float, default: 10<br> +  Option Price +### 1.a Default plot +Option type : Call<br> +Spot Price : 100<br> +Spot range : +/- 5% <br> +Strike price: 102 <br> +Position : Long<br> +Option Premium: 10 <br> +```python +op.single_plotter() +``` + +Green : Profit<br>Red : Loss +### 1.b Input parameters +Strike Price : 450<br> +Spot price : 460<br> +Option type : Put Option<br> +Position : Short<br> +Option Premium : 12.5<br> +```python +op.single_plotter(spot=460, strike=460, op_type='p', tr_type='s', op_pr=12.5) +``` + +# 2. multi_plotter() +Used for plotting a single option <br> + +%package -n python3-opstrat +Summary: Option stategy visualizer +Provides: python-opstrat +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-opstrat +op_type: kind {'c','p'}, default:'c'<br> +   Opion type>> 'c': call option, 'p':put option +spot: int, float, default: 100<br> +  Spot Price +spot_range: int, float, optional, default: 5<br> +  Range of spot variation in percentage +strike: int, float, default: 102<br> +  Strike Price +tr_type: kind {'b', 's'} default:'b'<br> +  Transaction Type>> 'b': long, 's': short +op_pr: int, float, default: 10<br> +  Option Price +### 1.a Default plot +Option type : Call<br> +Spot Price : 100<br> +Spot range : +/- 5% <br> +Strike price: 102 <br> +Position : Long<br> +Option Premium: 10 <br> +```python +op.single_plotter() +``` + +Green : Profit<br>Red : Loss +### 1.b Input parameters +Strike Price : 450<br> +Spot price : 460<br> +Option type : Put Option<br> +Position : Short<br> +Option Premium : 12.5<br> +```python +op.single_plotter(spot=460, strike=460, op_type='p', tr_type='s', op_pr=12.5) +``` + +# 2. multi_plotter() +Used for plotting a single option <br> + +%package help +Summary: Development documents and examples for opstrat +Provides: python3-opstrat-doc +%description help +op_type: kind {'c','p'}, default:'c'<br> +   Opion type>> 'c': call option, 'p':put option +spot: int, float, default: 100<br> +  Spot Price +spot_range: int, float, optional, default: 5<br> +  Range of spot variation in percentage +strike: int, float, default: 102<br> +  Strike Price +tr_type: kind {'b', 's'} default:'b'<br> +  Transaction Type>> 'b': long, 's': short +op_pr: int, float, default: 10<br> +  Option Price +### 1.a Default plot +Option type : Call<br> +Spot Price : 100<br> +Spot range : +/- 5% <br> +Strike price: 102 <br> +Position : Long<br> +Option Premium: 10 <br> +```python +op.single_plotter() +``` + +Green : Profit<br>Red : Loss +### 1.b Input parameters +Strike Price : 450<br> +Spot price : 460<br> +Option type : Put Option<br> +Position : Short<br> +Option Premium : 12.5<br> +```python +op.single_plotter(spot=460, strike=460, op_type='p', tr_type='s', op_pr=12.5) +``` + +# 2. multi_plotter() +Used for plotting a single option <br> + +%prep +%autosetup -n opstrat-0.1.7 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-opstrat -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 0.1.7-1 +- Package Spec generated |