diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-31 04:18:54 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-31 04:18:54 +0000 |
commit | 0720e33d9d880ea1540528c340aa2eac370fd8e2 (patch) | |
tree | 8366f469649e6b01c8778c7831aeef7a1a35ca7e /python-dweather-client.spec | |
parent | 4f94e52b14973f63a55c50863b1626e0f64bbb25 (diff) |
automatic import of python-dweather-client
Diffstat (limited to 'python-dweather-client.spec')
-rw-r--r-- | python-dweather-client.spec | 419 |
1 files changed, 419 insertions, 0 deletions
diff --git a/python-dweather-client.spec b/python-dweather-client.spec new file mode 100644 index 0000000..20f5ade --- /dev/null +++ b/python-dweather-client.spec @@ -0,0 +1,419 @@ +%global _empty_manifest_terminate_build 0 +Name: python-dweather-client +Version: 2.1.0 +Release: 1 +Summary: Python client for interacting with weather data on IPFS. +License: MIT License +URL: https://github.com/Arbol-Project/dWeather-Python-Client.git +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/2f/93/a082a35f1fe4b5dd5039b997aa0cc80dbeddda8e3fc203c4a4d96da3e557/dweather_client-2.1.0.tar.gz +BuildArch: noarch + +Requires: python3-ipfshttpclient +Requires: python3-pandas +Requires: python3-pytest +Requires: python3-requests +Requires: python3-geopy +Requires: python3-zeep +Requires: python3-astropy +Requires: python3-timezonefinder + +%description +# dWeather-Python-Client + +## Quickstart + +Install dweather_client: + + pip3 install dweather_client + +Get valid dataset names and associated hashes: + + http_client.get_heads() + +Get the metadata for a given dataset name: + + http_client.get_metadata('chirps_05-daily') + +Get a rainfall dict for a gridded dataset: + + http_client.get_rainfall_dict(41.175, -75.125, 'chirps_05-daily') + +Get a rainfall dataframe: + + df_loader.get_rainfall_df(41.125, -75.125, 'chirps_05-daily') + +Get a station dataframe: + + df_loader.get_station_rainfall_df('USW00024285') + df_loader.get_station_temperature_df('USW00024285') + df_loader.get_station_snow_df('USW00024285') + +See further examples in `tests` + +## Development + + cd dweather-python-client + python3 -m venv . + bin/pip3 install -r requirements.txt + bin/python3 -m pytest dweather_clieht/tests + +Some dweather_client features require an ipfs daemon to work. + +### Download Go-IPFS version 0.6.0 +See Assets list at the bottom of this page: https://github.com/ipfs/go-ipfs/releases/tag/v0.6.0 +Download the build appropriate for your machine, or just download the source tar if you're not sure. + +### Install go-IPFS + +Unzip the file that you downloaded. + + tar xvfz {filename}.tar.gz + +Move the binary into your path. `sudo` may be required for this. + + mv go-ipfs/ipfs /usr/local/bin/ipfs + +Initialize a ~/.ipfs directory. This is where your files and config will be saved. + + ipfs init + +### Configure go-IPFS + +Remove default peers for performance. + + ipfs bootstrap rm --all + +Add the dWeather server as a peer. + + ipfs bootstrap add "/ip4/198.211.104.50/tcp/4001/p2p/QmWsAFSDajELyneR7LkMsgfaRk2ib1y3SEU7nQuXSNPsQV" + +### Make sure go-IPFS it works + +Start the IPFS daemon. You will need to have the daemon running to use some functionality of the dWeather client. + + ipfs daemon + +In a new window, confirm that you can pull content. + + ipfs cat QmVsy2HZCi39ePJRpNqXEJvHgRMqjcyu1FLqgiFkPTMknq/USW00014704.csv.gz + +Confirm that the dWeather server is a peer. + + ipfs swarm peers + +### Install the Python dWeather Client + +Create an isolated Python installation and install the dependencies. + + git clone https://github.com/Arbol-Project/dWeather-Python-Client.git + cd dWeather-Python-Client + python3 -m venv . + bin/pip3 install -r requirements.txt + +Run the tests, if you want. + + bin/python3 -m pytest -s --log-cli-level=20 dweather_client/tests + +## Local data + +Certain dweather functions will try to save query results locally to disk for faster performance on subsequent loads. This can be overridden by passing `pin=False` in these function calls. + +Load the ipfs UI to browse what files are stored locally. Paste the following into a web browser. http://127.0.0.1:5001/webui + +Navigate to Files, then click "pins." Content can be unpinned via the UI. + +If you just want to remove everything, delete ~/.ipfs and rerun the installation and configuration from `ipfs init`. + + rm -rf ~/.ipfs + +## Further documentation + +See `tests` directory for example usage. Documented examples of usage should appear in a docs repository or in product-dev-notebook. + + + + +%package -n python3-dweather-client +Summary: Python client for interacting with weather data on IPFS. +Provides: python-dweather-client +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-dweather-client +# dWeather-Python-Client + +## Quickstart + +Install dweather_client: + + pip3 install dweather_client + +Get valid dataset names and associated hashes: + + http_client.get_heads() + +Get the metadata for a given dataset name: + + http_client.get_metadata('chirps_05-daily') + +Get a rainfall dict for a gridded dataset: + + http_client.get_rainfall_dict(41.175, -75.125, 'chirps_05-daily') + +Get a rainfall dataframe: + + df_loader.get_rainfall_df(41.125, -75.125, 'chirps_05-daily') + +Get a station dataframe: + + df_loader.get_station_rainfall_df('USW00024285') + df_loader.get_station_temperature_df('USW00024285') + df_loader.get_station_snow_df('USW00024285') + +See further examples in `tests` + +## Development + + cd dweather-python-client + python3 -m venv . + bin/pip3 install -r requirements.txt + bin/python3 -m pytest dweather_clieht/tests + +Some dweather_client features require an ipfs daemon to work. + +### Download Go-IPFS version 0.6.0 +See Assets list at the bottom of this page: https://github.com/ipfs/go-ipfs/releases/tag/v0.6.0 +Download the build appropriate for your machine, or just download the source tar if you're not sure. + +### Install go-IPFS + +Unzip the file that you downloaded. + + tar xvfz {filename}.tar.gz + +Move the binary into your path. `sudo` may be required for this. + + mv go-ipfs/ipfs /usr/local/bin/ipfs + +Initialize a ~/.ipfs directory. This is where your files and config will be saved. + + ipfs init + +### Configure go-IPFS + +Remove default peers for performance. + + ipfs bootstrap rm --all + +Add the dWeather server as a peer. + + ipfs bootstrap add "/ip4/198.211.104.50/tcp/4001/p2p/QmWsAFSDajELyneR7LkMsgfaRk2ib1y3SEU7nQuXSNPsQV" + +### Make sure go-IPFS it works + +Start the IPFS daemon. You will need to have the daemon running to use some functionality of the dWeather client. + + ipfs daemon + +In a new window, confirm that you can pull content. + + ipfs cat QmVsy2HZCi39ePJRpNqXEJvHgRMqjcyu1FLqgiFkPTMknq/USW00014704.csv.gz + +Confirm that the dWeather server is a peer. + + ipfs swarm peers + +### Install the Python dWeather Client + +Create an isolated Python installation and install the dependencies. + + git clone https://github.com/Arbol-Project/dWeather-Python-Client.git + cd dWeather-Python-Client + python3 -m venv . + bin/pip3 install -r requirements.txt + +Run the tests, if you want. + + bin/python3 -m pytest -s --log-cli-level=20 dweather_client/tests + +## Local data + +Certain dweather functions will try to save query results locally to disk for faster performance on subsequent loads. This can be overridden by passing `pin=False` in these function calls. + +Load the ipfs UI to browse what files are stored locally. Paste the following into a web browser. http://127.0.0.1:5001/webui + +Navigate to Files, then click "pins." Content can be unpinned via the UI. + +If you just want to remove everything, delete ~/.ipfs and rerun the installation and configuration from `ipfs init`. + + rm -rf ~/.ipfs + +## Further documentation + +See `tests` directory for example usage. Documented examples of usage should appear in a docs repository or in product-dev-notebook. + + + + +%package help +Summary: Development documents and examples for dweather-client +Provides: python3-dweather-client-doc +%description help +# dWeather-Python-Client + +## Quickstart + +Install dweather_client: + + pip3 install dweather_client + +Get valid dataset names and associated hashes: + + http_client.get_heads() + +Get the metadata for a given dataset name: + + http_client.get_metadata('chirps_05-daily') + +Get a rainfall dict for a gridded dataset: + + http_client.get_rainfall_dict(41.175, -75.125, 'chirps_05-daily') + +Get a rainfall dataframe: + + df_loader.get_rainfall_df(41.125, -75.125, 'chirps_05-daily') + +Get a station dataframe: + + df_loader.get_station_rainfall_df('USW00024285') + df_loader.get_station_temperature_df('USW00024285') + df_loader.get_station_snow_df('USW00024285') + +See further examples in `tests` + +## Development + + cd dweather-python-client + python3 -m venv . + bin/pip3 install -r requirements.txt + bin/python3 -m pytest dweather_clieht/tests + +Some dweather_client features require an ipfs daemon to work. + +### Download Go-IPFS version 0.6.0 +See Assets list at the bottom of this page: https://github.com/ipfs/go-ipfs/releases/tag/v0.6.0 +Download the build appropriate for your machine, or just download the source tar if you're not sure. + +### Install go-IPFS + +Unzip the file that you downloaded. + + tar xvfz {filename}.tar.gz + +Move the binary into your path. `sudo` may be required for this. + + mv go-ipfs/ipfs /usr/local/bin/ipfs + +Initialize a ~/.ipfs directory. This is where your files and config will be saved. + + ipfs init + +### Configure go-IPFS + +Remove default peers for performance. + + ipfs bootstrap rm --all + +Add the dWeather server as a peer. + + ipfs bootstrap add "/ip4/198.211.104.50/tcp/4001/p2p/QmWsAFSDajELyneR7LkMsgfaRk2ib1y3SEU7nQuXSNPsQV" + +### Make sure go-IPFS it works + +Start the IPFS daemon. You will need to have the daemon running to use some functionality of the dWeather client. + + ipfs daemon + +In a new window, confirm that you can pull content. + + ipfs cat QmVsy2HZCi39ePJRpNqXEJvHgRMqjcyu1FLqgiFkPTMknq/USW00014704.csv.gz + +Confirm that the dWeather server is a peer. + + ipfs swarm peers + +### Install the Python dWeather Client + +Create an isolated Python installation and install the dependencies. + + git clone https://github.com/Arbol-Project/dWeather-Python-Client.git + cd dWeather-Python-Client + python3 -m venv . + bin/pip3 install -r requirements.txt + +Run the tests, if you want. + + bin/python3 -m pytest -s --log-cli-level=20 dweather_client/tests + +## Local data + +Certain dweather functions will try to save query results locally to disk for faster performance on subsequent loads. This can be overridden by passing `pin=False` in these function calls. + +Load the ipfs UI to browse what files are stored locally. Paste the following into a web browser. http://127.0.0.1:5001/webui + +Navigate to Files, then click "pins." Content can be unpinned via the UI. + +If you just want to remove everything, delete ~/.ipfs and rerun the installation and configuration from `ipfs init`. + + rm -rf ~/.ipfs + +## Further documentation + +See `tests` directory for example usage. Documented examples of usage should appear in a docs repository or in product-dev-notebook. + + + + +%prep +%autosetup -n dweather-client-2.1.0 + +%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-dweather-client -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 2.1.0-1 +- Package Spec generated |