diff options
Diffstat (limited to 'python-twder.spec')
| -rw-r--r-- | python-twder.spec | 217 |
1 files changed, 217 insertions, 0 deletions
diff --git a/python-twder.spec b/python-twder.spec new file mode 100644 index 0000000..b5b5bcf --- /dev/null +++ b/python-twder.spec @@ -0,0 +1,217 @@ +%global _empty_manifest_terminate_build 0 +Name: python-twder +Version: 0.2.2 +Release: 1 +Summary: 新台幣匯率擷取 (New Taiwan Dollar Exchange Rate) +License: MIT +URL: https://github.com/jimms/twder +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/8c/2f/69beb95fa68f66d4df6ace5917427a6eb953930ad28ad8a945c8ce2671ec/twder-0.2.2.tar.gz +BuildArch: noarch + +Requires: python3-lxml + +%description +# `twder` - 新台幣匯率擷取 (New Taiwan Dollar Exchange Rate) + +[](https://travis-ci.com/jimms/twder) + +擷取台灣銀行新台幣匯率報價 + +# Quick Start + +```python +>>> import twder +>>> twder.currencies() +['CNY', 'THB', 'SEK', 'USD', 'IDR', 'AUD', 'NZD', 'PHP', 'MYR', 'GBP', 'ZAR', 'CHF', 'VND', 'EUR', 'KRW', 'SGD', 'JPY', 'CAD', 'HKD'] + +>>> twder.now_all() # 擷取目前所有幣別報價 +{'THB': ('2017/01/06 16:00', '0.7918', '0.9348', '0.8803', '0.9203'), ...} +# {貨幣代碼: (時間, 現金買入, 現金賣出, 即期買入, 即期賣出), ...} + +>>> twder.now('JPY') # 擷取目前特定幣別報價 +('2017/01/06 16:00', '0.2668', '0.2778', '0.2732', '0.2772') +# (時間, 現金買入, 現金賣出, 即期買入, 即期賣出) + +>>> twder.past_day('JPY') # 擷取昨天報價 +[('2017/01/06 09:02:04', '0.2671', '0.2781', '0.2735', '0.2775'), ...] +# [(時間, 現金買入, 現金賣出, 即期買入, 即期賣出), ...] + +>>> twder.past_six_month('JPY') # 擷取前六個月報價 +[('2017/01/06', '0.2668', '0.2778', '0.2732', '0.2772'), ...] +# [(時間, 現金買入, 現金賣出, 即期買入, 即期賣出), ...] + +>>> twder.specify_month('JPY', 2016, 12) # 擷取特定年月報價 +[('2016/12/30', '0.2672', '0.2782', '0.2736', '0.2776'), ...] +# [(時間, 現金買入, 現金賣出, 即期買入, 即期賣出), ...] +``` + +# APIs + +```python +currencies() +currency_name_dict() + +now(currency) +now_all() +past_day(currency) +past_six_month(currency) +specify_month(currency, year, month) +``` + + + + +%package -n python3-twder +Summary: 新台幣匯率擷取 (New Taiwan Dollar Exchange Rate) +Provides: python-twder +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-twder +# `twder` - 新台幣匯率擷取 (New Taiwan Dollar Exchange Rate) + +[](https://travis-ci.com/jimms/twder) + +擷取台灣銀行新台幣匯率報價 + +# Quick Start + +```python +>>> import twder +>>> twder.currencies() +['CNY', 'THB', 'SEK', 'USD', 'IDR', 'AUD', 'NZD', 'PHP', 'MYR', 'GBP', 'ZAR', 'CHF', 'VND', 'EUR', 'KRW', 'SGD', 'JPY', 'CAD', 'HKD'] + +>>> twder.now_all() # 擷取目前所有幣別報價 +{'THB': ('2017/01/06 16:00', '0.7918', '0.9348', '0.8803', '0.9203'), ...} +# {貨幣代碼: (時間, 現金買入, 現金賣出, 即期買入, 即期賣出), ...} + +>>> twder.now('JPY') # 擷取目前特定幣別報價 +('2017/01/06 16:00', '0.2668', '0.2778', '0.2732', '0.2772') +# (時間, 現金買入, 現金賣出, 即期買入, 即期賣出) + +>>> twder.past_day('JPY') # 擷取昨天報價 +[('2017/01/06 09:02:04', '0.2671', '0.2781', '0.2735', '0.2775'), ...] +# [(時間, 現金買入, 現金賣出, 即期買入, 即期賣出), ...] + +>>> twder.past_six_month('JPY') # 擷取前六個月報價 +[('2017/01/06', '0.2668', '0.2778', '0.2732', '0.2772'), ...] +# [(時間, 現金買入, 現金賣出, 即期買入, 即期賣出), ...] + +>>> twder.specify_month('JPY', 2016, 12) # 擷取特定年月報價 +[('2016/12/30', '0.2672', '0.2782', '0.2736', '0.2776'), ...] +# [(時間, 現金買入, 現金賣出, 即期買入, 即期賣出), ...] +``` + +# APIs + +```python +currencies() +currency_name_dict() + +now(currency) +now_all() +past_day(currency) +past_six_month(currency) +specify_month(currency, year, month) +``` + + + + +%package help +Summary: Development documents and examples for twder +Provides: python3-twder-doc +%description help +# `twder` - 新台幣匯率擷取 (New Taiwan Dollar Exchange Rate) + +[](https://travis-ci.com/jimms/twder) + +擷取台灣銀行新台幣匯率報價 + +# Quick Start + +```python +>>> import twder +>>> twder.currencies() +['CNY', 'THB', 'SEK', 'USD', 'IDR', 'AUD', 'NZD', 'PHP', 'MYR', 'GBP', 'ZAR', 'CHF', 'VND', 'EUR', 'KRW', 'SGD', 'JPY', 'CAD', 'HKD'] + +>>> twder.now_all() # 擷取目前所有幣別報價 +{'THB': ('2017/01/06 16:00', '0.7918', '0.9348', '0.8803', '0.9203'), ...} +# {貨幣代碼: (時間, 現金買入, 現金賣出, 即期買入, 即期賣出), ...} + +>>> twder.now('JPY') # 擷取目前特定幣別報價 +('2017/01/06 16:00', '0.2668', '0.2778', '0.2732', '0.2772') +# (時間, 現金買入, 現金賣出, 即期買入, 即期賣出) + +>>> twder.past_day('JPY') # 擷取昨天報價 +[('2017/01/06 09:02:04', '0.2671', '0.2781', '0.2735', '0.2775'), ...] +# [(時間, 現金買入, 現金賣出, 即期買入, 即期賣出), ...] + +>>> twder.past_six_month('JPY') # 擷取前六個月報價 +[('2017/01/06', '0.2668', '0.2778', '0.2732', '0.2772'), ...] +# [(時間, 現金買入, 現金賣出, 即期買入, 即期賣出), ...] + +>>> twder.specify_month('JPY', 2016, 12) # 擷取特定年月報價 +[('2016/12/30', '0.2672', '0.2782', '0.2736', '0.2776'), ...] +# [(時間, 現金買入, 現金賣出, 即期買入, 即期賣出), ...] +``` + +# APIs + +```python +currencies() +currency_name_dict() + +now(currency) +now_all() +past_day(currency) +past_six_month(currency) +specify_month(currency, year, month) +``` + + + + +%prep +%autosetup -n twder-0.2.2 + +%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-twder -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 0.2.2-1 +- Package Spec generated |
