diff options
Diffstat (limited to 'python-stqdm.spec')
| -rw-r--r-- | python-stqdm.spec | 311 |
1 files changed, 311 insertions, 0 deletions
diff --git a/python-stqdm.spec b/python-stqdm.spec new file mode 100644 index 0000000..625353b --- /dev/null +++ b/python-stqdm.spec @@ -0,0 +1,311 @@ +%global _empty_manifest_terminate_build 0 +Name: python-stqdm +Version: 0.0.5 +Release: 1 +Summary: Easy progress bar for streamlit based on the awesome streamlit.progress and tqdm +License: Apache-2.0 +URL: https://github.com/Wirg/stqdm +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/6b/f4/770b463dd67fb3bd0204bd3d35423c838e58a5f78f97bf98730b9b1cb991/stqdm-0.0.5.tar.gz +BuildArch: noarch + +Requires: python3-tqdm +Requires: python3-streamlit + +%description +# stqdm + +[](https://codecov.io/gh/Wirg/stqdm) +[](https://github.com/Wirg/stqdm/actions/workflows/codeql-analysis.yml) + +stqdm is the simplest way to handle a progress bar in streamlit app. + + + +## How to install + +```sh +pip install stqdm +``` + +## How to use + +You can find some examples in `examples/` + +### Use stqdm in main +```python +from time import sleep +from stqdm import stqdm + +for _ in stqdm(range(50)): + sleep(0.5) +``` + +### Use stqdm in sidebar +```python +from time import sleep +import streamlit as st +from stqdm import stqdm + +for _ in stqdm(range(50), st_container=st.sidebar): + sleep(0.5) +``` + +### Customize the bar with tqdm parameters + + + +```python +from time import sleep +from stqdm import stqdm + +for _ in stqdm(range(50), desc="This is a slow task", mininterval=1): + sleep(0.5) +``` + +### Display a progress bar during pandas Dataframe & Series operations +STqdm inherits from tqdm, you can call stqdm.pandas() in a similar way. See [tqdm docs](https://github.com/tqdm/tqdm#pandas-integration). +```python +from time import sleep + +import pandas as pd +from stqdm import stqdm + +stqdm.pandas() + +pd.Series(range(50)).progress_map(lambda x: sleep(1)) +pd.Dataframe({"a": range(50)}).progress_apply(lambda x: sleep(1), axis=1) +``` + +### Display the progress bar only in the frontend or the backend + +```python +from time import sleep + +from stqdm import stqdm + +# Default to frontend only +for i in stqdm(range(50), backend=False, frontend=True): + sleep(0.5) + + +for i in stqdm(range(50), backend=True, frontend=False): + sleep(0.5) +``` + + +%package -n python3-stqdm +Summary: Easy progress bar for streamlit based on the awesome streamlit.progress and tqdm +Provides: python-stqdm +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-stqdm +# stqdm + +[](https://codecov.io/gh/Wirg/stqdm) +[](https://github.com/Wirg/stqdm/actions/workflows/codeql-analysis.yml) + +stqdm is the simplest way to handle a progress bar in streamlit app. + + + +## How to install + +```sh +pip install stqdm +``` + +## How to use + +You can find some examples in `examples/` + +### Use stqdm in main +```python +from time import sleep +from stqdm import stqdm + +for _ in stqdm(range(50)): + sleep(0.5) +``` + +### Use stqdm in sidebar +```python +from time import sleep +import streamlit as st +from stqdm import stqdm + +for _ in stqdm(range(50), st_container=st.sidebar): + sleep(0.5) +``` + +### Customize the bar with tqdm parameters + + + +```python +from time import sleep +from stqdm import stqdm + +for _ in stqdm(range(50), desc="This is a slow task", mininterval=1): + sleep(0.5) +``` + +### Display a progress bar during pandas Dataframe & Series operations +STqdm inherits from tqdm, you can call stqdm.pandas() in a similar way. See [tqdm docs](https://github.com/tqdm/tqdm#pandas-integration). +```python +from time import sleep + +import pandas as pd +from stqdm import stqdm + +stqdm.pandas() + +pd.Series(range(50)).progress_map(lambda x: sleep(1)) +pd.Dataframe({"a": range(50)}).progress_apply(lambda x: sleep(1), axis=1) +``` + +### Display the progress bar only in the frontend or the backend + +```python +from time import sleep + +from stqdm import stqdm + +# Default to frontend only +for i in stqdm(range(50), backend=False, frontend=True): + sleep(0.5) + + +for i in stqdm(range(50), backend=True, frontend=False): + sleep(0.5) +``` + + +%package help +Summary: Development documents and examples for stqdm +Provides: python3-stqdm-doc +%description help +# stqdm + +[](https://codecov.io/gh/Wirg/stqdm) +[](https://github.com/Wirg/stqdm/actions/workflows/codeql-analysis.yml) + +stqdm is the simplest way to handle a progress bar in streamlit app. + + + +## How to install + +```sh +pip install stqdm +``` + +## How to use + +You can find some examples in `examples/` + +### Use stqdm in main +```python +from time import sleep +from stqdm import stqdm + +for _ in stqdm(range(50)): + sleep(0.5) +``` + +### Use stqdm in sidebar +```python +from time import sleep +import streamlit as st +from stqdm import stqdm + +for _ in stqdm(range(50), st_container=st.sidebar): + sleep(0.5) +``` + +### Customize the bar with tqdm parameters + + + +```python +from time import sleep +from stqdm import stqdm + +for _ in stqdm(range(50), desc="This is a slow task", mininterval=1): + sleep(0.5) +``` + +### Display a progress bar during pandas Dataframe & Series operations +STqdm inherits from tqdm, you can call stqdm.pandas() in a similar way. See [tqdm docs](https://github.com/tqdm/tqdm#pandas-integration). +```python +from time import sleep + +import pandas as pd +from stqdm import stqdm + +stqdm.pandas() + +pd.Series(range(50)).progress_map(lambda x: sleep(1)) +pd.Dataframe({"a": range(50)}).progress_apply(lambda x: sleep(1), axis=1) +``` + +### Display the progress bar only in the frontend or the backend + +```python +from time import sleep + +from stqdm import stqdm + +# Default to frontend only +for i in stqdm(range(50), backend=False, frontend=True): + sleep(0.5) + + +for i in stqdm(range(50), backend=True, frontend=False): + sleep(0.5) +``` + + +%prep +%autosetup -n stqdm-0.0.5 + +%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-stqdm -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 29 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.5-1 +- Package Spec generated |
