diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-10 05:12:35 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-10 05:12:35 +0000 |
commit | d6cc1810860823cb4e72385619d585565dfc9c84 (patch) | |
tree | 2c36fdffdacadf5185d96201e0811b261d26a2d5 | |
parent | 28fa5847306caecf4f3f4970ed969a29a90dccce (diff) |
automatic import of python-canalyst-candasopeneuler20.03
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-canalyst-candas.spec | 613 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 615 insertions, 0 deletions
@@ -0,0 +1 @@ +/canalyst_candas-0.0.44.tar.gz diff --git a/python-canalyst-candas.spec b/python-canalyst-candas.spec new file mode 100644 index 0000000..4a54b94 --- /dev/null +++ b/python-canalyst-candas.spec @@ -0,0 +1,613 @@ +%global _empty_manifest_terminate_build 0 +Name: python-canalyst-candas +Version: 0.0.44 +Release: 1 +Summary: The official Canalyst Software Development Kit (SDK) for our public API +License: Apache-2.0 +URL: https://pypi.org/project/canalyst-candas/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/7e/c0/4b10cfaae0448a39d8fcc45b3e21a95b12ec4bdbd2a10b68819bed2f6f7e/canalyst_candas-0.0.44.tar.gz +BuildArch: noarch + +Requires: python3-boto +Requires: python3-boto3 +Requires: python3-botocore +Requires: python3-fred +Requires: python3-fredapi +Requires: python3-future +Requires: python3-graphviz +Requires: python3-joblib +Requires: python3-networkx +Requires: python3-numexpr +Requires: python3-numpy +Requires: python3-pandas +Requires: python3-plotly +Requires: python3-pydantic +Requires: python3-pydot +Requires: python3-graphql-client +Requires: python3-pyvis +Requires: python3-openpyxl +Requires: python3-requests +Requires: python3-requests-html +Requires: python3-urllib3 +Requires: python3-matplotlib +Requires: python3-statsmodels +Requires: python3-yahoo-fin +Requires: python3-pyarrow + +%description +# Canalyst Data Science Library + +Canalyst's Python SDK is intended as a full featured data science library facilitating dataframe manipulation, data model mapping, and interactive scenario analysis of core Model, ModelSet, and ModelMap objects. + +# Python Version Requirement +This package requires Python version `>=3.7`. Recommended Python version `>=3.8`. + +# Usage + +## Install Required Packages +Run `pip install -r requirements.txt` to install the requried packages. + +## To Preview Sample Data +The Python SDK supports a preview of sample data for three tickers: DIS US, TSLA US, or NFLX US. +``` +import canalyst_candas as cd +model = cd.SampleModel(ticker="DIS US") +df = model.model_frame() +``` + +## Configuration +The Python SDK supports three ways of providing configuration, in order of precedence: + 1. [Creating a `Config` instance](#using-config) + 2. [Using environment variables](#using-environment-variables) + 3. [Using a configuration file](#using-configuration-file) + +`Config` is used to store a user's configuration information. On initial `canalyst_candas` import, it will attempt to retrieve the configuration. + +### Using `Config` +A `Config` instance can be created with the desired configurations. + +In Python/iPython or Jupyter Notebook. Replace `<..>` with values + +``` +import sys +sys.path.append('<path to sdk-python>/src') +import canalyst_candas as cd +from canalyst_candas.configuration.config import Config + +# if you want to set a default directory, otherwise `default_dir` will be a temporary directory +# from pathlib import Path +# home = Path.home() +# default_dir = f"{home}/<any place under your home directory>" + +config_info = { + "canalyst_api_key": "<Canalyst API key>", + "s3_access_key_id": "<S3 Access Key ID>", + "s3_secret_key": "<S3 Secret Key>", + "fred_key": "<Fred key>", + "default_dir": "", + "mds_host": "", + "wp_host": "", + "verify_ssl": "True", +} + +config = Config(config=config_info) + +ticker = "<ticker you want test with>" +model = cd.Model(ticker=ticker, config=config) +model_set = cd.ModelSet(ticker_list=[ticker], config=config) +cd.ModelMap( + ticker=ticker, + config=config, + time_series_name=time_series, + col_for_labels=<label>, + common_size_tree=True, + notebook=False, + auto_download=False, +) +``` + +### Using Environment Variables +Environment variables can be set in your terminal. The SDK looks for +- CANALYST_API_KEY +- S3_ACCESS_KEY_ID +- S3_SECRET_KEY +- FRED_KEY (optional) +- DEFAULT_DIR (optional; default is a temporary directory) +- MDS_HOST (optional; default is production Model Data System) +- WP_HOST (optional; default is production Web Portal) +- VERIFY_SSL (optional: default is "True") + +In Python/iPython or Jupyter Notebook. Replace `<..>` with values + +``` +import sys +sys.path.append('<path to sdk-python>/src') +import canalyst_candas as cd + +ticker = "<ticker to test with>" +time_series = "<time series to test with>" +label = "<label of interest> +model = cd.Model(ticker=ticker) +model_set = cd.ModelSet(ticker_list=[ticker]) +cd.ModelMap( + ticker=ticker, + time_series_name=time_series, + col_for_labels=<label>, + common_size_tree=True, + notebook=False, + auto_download=False, +) +``` + +### Using a Configuration File +When `canalyst_candas` is imported and if there is not already an existing configuration file, a configuration file, `keys.json`, is created in the user's home directory, `C:\Users\<username>\canalyst\keys.json` on Windows or `/User/<username>/canalyst/keys.json` on a Unix-based OS (e.g. Mac, Linux). The configuration file can be moved but must be under a user's home directory and must be in directly under a 'canalyst' folder. Examples of valid locations: + +Windows +- `C:\Users\<username>\canalyst\keys.json` +- `C:\Users\<username\Downloads\canalyst\keys.json'` + +Unix-based OS +- `/Users/<username/canalyst/keys.json` +- `/Users/<username>/Downloads/canalyst/keys.json` + +The contents of `keys.json`: +``` +{ + "canalyst_api_key": "", + "canalyst_s3_id": "", + "canalyst_s3_key": "", + "fred_key": "", + "default_dir": "", + "mds_host": "", + "wp_host": "", + "verify_ssl": "", + "proxies": "" +} +``` + +Fill in +1. `canalyst_api_key`: Canalyst API token. Get it at https://app.canalyst.com/settings/api-tokens +2. `canalyst_s3_id`: AWS S3 Access Key ID +3. `canalyst_s3_key`: AWS S3 Secret Key +4. (Optional) `default_dir`: your chosen directory for where downloads will go. The default is a temporary directory. + +In Python/iPython or Jupyter Notebook. Replace `<..>` with values + +``` +import sys +sys.path.append('<path to sdk-python>/src') +import canalyst_candas as cd + +ticker = "<ticker to test with>" +time_series = "<time series to test with>" +label = "<label of interest> +model = cd.Model(ticker=ticker) +model_set = cd.ModelSet(ticker_list=[ticker]) +cd.ModelMap( + ticker=ticker, + time_series_name=time_series, + col_for_labels=<label>, + common_size_tree=True, + notebook=False, + auto_download=False, +) +``` + +## Proxy Support +The Candas library allows for proxies to be passed in as part of the request. The proxies are to be formatted as a python dictionary: + +`{"http": "http://http_proxy.com:8000", "https": "https://https_proxy.com:8001"}` + +If you only have one proxy, the `http` and `https` keys can have the same proxy link. +This dictionary is to be passed in as part of the config object: + +``` + "proxies": { + "http": "http://18.206.117.131:3128", + "https": "http://18.206.117.131:3128" + } +``` + + +%package -n python3-canalyst-candas +Summary: The official Canalyst Software Development Kit (SDK) for our public API +Provides: python-canalyst-candas +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-canalyst-candas +# Canalyst Data Science Library + +Canalyst's Python SDK is intended as a full featured data science library facilitating dataframe manipulation, data model mapping, and interactive scenario analysis of core Model, ModelSet, and ModelMap objects. + +# Python Version Requirement +This package requires Python version `>=3.7`. Recommended Python version `>=3.8`. + +# Usage + +## Install Required Packages +Run `pip install -r requirements.txt` to install the requried packages. + +## To Preview Sample Data +The Python SDK supports a preview of sample data for three tickers: DIS US, TSLA US, or NFLX US. +``` +import canalyst_candas as cd +model = cd.SampleModel(ticker="DIS US") +df = model.model_frame() +``` + +## Configuration +The Python SDK supports three ways of providing configuration, in order of precedence: + 1. [Creating a `Config` instance](#using-config) + 2. [Using environment variables](#using-environment-variables) + 3. [Using a configuration file](#using-configuration-file) + +`Config` is used to store a user's configuration information. On initial `canalyst_candas` import, it will attempt to retrieve the configuration. + +### Using `Config` +A `Config` instance can be created with the desired configurations. + +In Python/iPython or Jupyter Notebook. Replace `<..>` with values + +``` +import sys +sys.path.append('<path to sdk-python>/src') +import canalyst_candas as cd +from canalyst_candas.configuration.config import Config + +# if you want to set a default directory, otherwise `default_dir` will be a temporary directory +# from pathlib import Path +# home = Path.home() +# default_dir = f"{home}/<any place under your home directory>" + +config_info = { + "canalyst_api_key": "<Canalyst API key>", + "s3_access_key_id": "<S3 Access Key ID>", + "s3_secret_key": "<S3 Secret Key>", + "fred_key": "<Fred key>", + "default_dir": "", + "mds_host": "", + "wp_host": "", + "verify_ssl": "True", +} + +config = Config(config=config_info) + +ticker = "<ticker you want test with>" +model = cd.Model(ticker=ticker, config=config) +model_set = cd.ModelSet(ticker_list=[ticker], config=config) +cd.ModelMap( + ticker=ticker, + config=config, + time_series_name=time_series, + col_for_labels=<label>, + common_size_tree=True, + notebook=False, + auto_download=False, +) +``` + +### Using Environment Variables +Environment variables can be set in your terminal. The SDK looks for +- CANALYST_API_KEY +- S3_ACCESS_KEY_ID +- S3_SECRET_KEY +- FRED_KEY (optional) +- DEFAULT_DIR (optional; default is a temporary directory) +- MDS_HOST (optional; default is production Model Data System) +- WP_HOST (optional; default is production Web Portal) +- VERIFY_SSL (optional: default is "True") + +In Python/iPython or Jupyter Notebook. Replace `<..>` with values + +``` +import sys +sys.path.append('<path to sdk-python>/src') +import canalyst_candas as cd + +ticker = "<ticker to test with>" +time_series = "<time series to test with>" +label = "<label of interest> +model = cd.Model(ticker=ticker) +model_set = cd.ModelSet(ticker_list=[ticker]) +cd.ModelMap( + ticker=ticker, + time_series_name=time_series, + col_for_labels=<label>, + common_size_tree=True, + notebook=False, + auto_download=False, +) +``` + +### Using a Configuration File +When `canalyst_candas` is imported and if there is not already an existing configuration file, a configuration file, `keys.json`, is created in the user's home directory, `C:\Users\<username>\canalyst\keys.json` on Windows or `/User/<username>/canalyst/keys.json` on a Unix-based OS (e.g. Mac, Linux). The configuration file can be moved but must be under a user's home directory and must be in directly under a 'canalyst' folder. Examples of valid locations: + +Windows +- `C:\Users\<username>\canalyst\keys.json` +- `C:\Users\<username\Downloads\canalyst\keys.json'` + +Unix-based OS +- `/Users/<username/canalyst/keys.json` +- `/Users/<username>/Downloads/canalyst/keys.json` + +The contents of `keys.json`: +``` +{ + "canalyst_api_key": "", + "canalyst_s3_id": "", + "canalyst_s3_key": "", + "fred_key": "", + "default_dir": "", + "mds_host": "", + "wp_host": "", + "verify_ssl": "", + "proxies": "" +} +``` + +Fill in +1. `canalyst_api_key`: Canalyst API token. Get it at https://app.canalyst.com/settings/api-tokens +2. `canalyst_s3_id`: AWS S3 Access Key ID +3. `canalyst_s3_key`: AWS S3 Secret Key +4. (Optional) `default_dir`: your chosen directory for where downloads will go. The default is a temporary directory. + +In Python/iPython or Jupyter Notebook. Replace `<..>` with values + +``` +import sys +sys.path.append('<path to sdk-python>/src') +import canalyst_candas as cd + +ticker = "<ticker to test with>" +time_series = "<time series to test with>" +label = "<label of interest> +model = cd.Model(ticker=ticker) +model_set = cd.ModelSet(ticker_list=[ticker]) +cd.ModelMap( + ticker=ticker, + time_series_name=time_series, + col_for_labels=<label>, + common_size_tree=True, + notebook=False, + auto_download=False, +) +``` + +## Proxy Support +The Candas library allows for proxies to be passed in as part of the request. The proxies are to be formatted as a python dictionary: + +`{"http": "http://http_proxy.com:8000", "https": "https://https_proxy.com:8001"}` + +If you only have one proxy, the `http` and `https` keys can have the same proxy link. +This dictionary is to be passed in as part of the config object: + +``` + "proxies": { + "http": "http://18.206.117.131:3128", + "https": "http://18.206.117.131:3128" + } +``` + + +%package help +Summary: Development documents and examples for canalyst-candas +Provides: python3-canalyst-candas-doc +%description help +# Canalyst Data Science Library + +Canalyst's Python SDK is intended as a full featured data science library facilitating dataframe manipulation, data model mapping, and interactive scenario analysis of core Model, ModelSet, and ModelMap objects. + +# Python Version Requirement +This package requires Python version `>=3.7`. Recommended Python version `>=3.8`. + +# Usage + +## Install Required Packages +Run `pip install -r requirements.txt` to install the requried packages. + +## To Preview Sample Data +The Python SDK supports a preview of sample data for three tickers: DIS US, TSLA US, or NFLX US. +``` +import canalyst_candas as cd +model = cd.SampleModel(ticker="DIS US") +df = model.model_frame() +``` + +## Configuration +The Python SDK supports three ways of providing configuration, in order of precedence: + 1. [Creating a `Config` instance](#using-config) + 2. [Using environment variables](#using-environment-variables) + 3. [Using a configuration file](#using-configuration-file) + +`Config` is used to store a user's configuration information. On initial `canalyst_candas` import, it will attempt to retrieve the configuration. + +### Using `Config` +A `Config` instance can be created with the desired configurations. + +In Python/iPython or Jupyter Notebook. Replace `<..>` with values + +``` +import sys +sys.path.append('<path to sdk-python>/src') +import canalyst_candas as cd +from canalyst_candas.configuration.config import Config + +# if you want to set a default directory, otherwise `default_dir` will be a temporary directory +# from pathlib import Path +# home = Path.home() +# default_dir = f"{home}/<any place under your home directory>" + +config_info = { + "canalyst_api_key": "<Canalyst API key>", + "s3_access_key_id": "<S3 Access Key ID>", + "s3_secret_key": "<S3 Secret Key>", + "fred_key": "<Fred key>", + "default_dir": "", + "mds_host": "", + "wp_host": "", + "verify_ssl": "True", +} + +config = Config(config=config_info) + +ticker = "<ticker you want test with>" +model = cd.Model(ticker=ticker, config=config) +model_set = cd.ModelSet(ticker_list=[ticker], config=config) +cd.ModelMap( + ticker=ticker, + config=config, + time_series_name=time_series, + col_for_labels=<label>, + common_size_tree=True, + notebook=False, + auto_download=False, +) +``` + +### Using Environment Variables +Environment variables can be set in your terminal. The SDK looks for +- CANALYST_API_KEY +- S3_ACCESS_KEY_ID +- S3_SECRET_KEY +- FRED_KEY (optional) +- DEFAULT_DIR (optional; default is a temporary directory) +- MDS_HOST (optional; default is production Model Data System) +- WP_HOST (optional; default is production Web Portal) +- VERIFY_SSL (optional: default is "True") + +In Python/iPython or Jupyter Notebook. Replace `<..>` with values + +``` +import sys +sys.path.append('<path to sdk-python>/src') +import canalyst_candas as cd + +ticker = "<ticker to test with>" +time_series = "<time series to test with>" +label = "<label of interest> +model = cd.Model(ticker=ticker) +model_set = cd.ModelSet(ticker_list=[ticker]) +cd.ModelMap( + ticker=ticker, + time_series_name=time_series, + col_for_labels=<label>, + common_size_tree=True, + notebook=False, + auto_download=False, +) +``` + +### Using a Configuration File +When `canalyst_candas` is imported and if there is not already an existing configuration file, a configuration file, `keys.json`, is created in the user's home directory, `C:\Users\<username>\canalyst\keys.json` on Windows or `/User/<username>/canalyst/keys.json` on a Unix-based OS (e.g. Mac, Linux). The configuration file can be moved but must be under a user's home directory and must be in directly under a 'canalyst' folder. Examples of valid locations: + +Windows +- `C:\Users\<username>\canalyst\keys.json` +- `C:\Users\<username\Downloads\canalyst\keys.json'` + +Unix-based OS +- `/Users/<username/canalyst/keys.json` +- `/Users/<username>/Downloads/canalyst/keys.json` + +The contents of `keys.json`: +``` +{ + "canalyst_api_key": "", + "canalyst_s3_id": "", + "canalyst_s3_key": "", + "fred_key": "", + "default_dir": "", + "mds_host": "", + "wp_host": "", + "verify_ssl": "", + "proxies": "" +} +``` + +Fill in +1. `canalyst_api_key`: Canalyst API token. Get it at https://app.canalyst.com/settings/api-tokens +2. `canalyst_s3_id`: AWS S3 Access Key ID +3. `canalyst_s3_key`: AWS S3 Secret Key +4. (Optional) `default_dir`: your chosen directory for where downloads will go. The default is a temporary directory. + +In Python/iPython or Jupyter Notebook. Replace `<..>` with values + +``` +import sys +sys.path.append('<path to sdk-python>/src') +import canalyst_candas as cd + +ticker = "<ticker to test with>" +time_series = "<time series to test with>" +label = "<label of interest> +model = cd.Model(ticker=ticker) +model_set = cd.ModelSet(ticker_list=[ticker]) +cd.ModelMap( + ticker=ticker, + time_series_name=time_series, + col_for_labels=<label>, + common_size_tree=True, + notebook=False, + auto_download=False, +) +``` + +## Proxy Support +The Candas library allows for proxies to be passed in as part of the request. The proxies are to be formatted as a python dictionary: + +`{"http": "http://http_proxy.com:8000", "https": "https://https_proxy.com:8001"}` + +If you only have one proxy, the `http` and `https` keys can have the same proxy link. +This dictionary is to be passed in as part of the config object: + +``` + "proxies": { + "http": "http://18.206.117.131:3128", + "https": "http://18.206.117.131:3128" + } +``` + + +%prep +%autosetup -n canalyst-candas-0.0.44 + +%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-canalyst-candas -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.44-1 +- Package Spec generated @@ -0,0 +1 @@ +fe44ec73bdddc8593915ca364f2ead29 canalyst_candas-0.0.44.tar.gz |